/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --primary: #1e2b3c;
    --primary-light: #2a3a4f;
    --accent: #e8b84b;
    --accent-dark: #d4a23a;
    --bg: #f4f2ee;
    --card-bg: #ffffff;
    --text: #1e1e1e;
    --text-light: #5a5a5a;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --danger: #d14a4a;
    --success: #2a8e5c;
    --suggestion-hover: #f0ede8;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: "Inter", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a {
    text-decoration: none;
    color: inherit;
}
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}
input,
select,
textarea {
    font-family: inherit;
    outline: none;
    border: none;
}
img {
    display: block;
    max-width: 100%;
}
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* ===== HEADER ===== */
.header {
    background: var(--primary);
    color: #fff;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    white-space: nowrap;
    cursor: pointer;
}
.logo .logo-img {
    height: 48px;          /* ← logo size increased */
    width: auto;
    margin-right: 8px;
}
.logo span {
    color: var(--accent);
}
.header-right {
    width: 40px;
}

/* ===== SEARCH ===== */
.search-wrap {
    flex: 1;
    min-width: 200px;
    max-width: 600px;
    position: relative;
}
.search-wrap .search-inner {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 40px;
    padding: 4px 4px 4px 18px;
    transition: var(--transition);
    border: 1px solid transparent;
}
.search-wrap .search-inner:focus-within {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232, 184, 75, 0.2);
}
.search-wrap .search-inner input {
    flex: 1;
    background: transparent;
    color: #fff;
    font-size: 15px;
    padding: 10px 0;
    min-width: 80px;
}
.search-wrap .search-inner input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}
.search-wrap .search-inner button {
    background: var(--accent);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
}
.search-wrap .search-inner button:hover {
    background: var(--accent-dark);
    transform: scale(1.02);
}

/* ===== SUGGESTIONS ===== */
.suggestions-box {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    padding: 8px 0;
    max-height: 340px;
    overflow-y: auto;
    z-index: 999;
    display: none;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.suggestions-box.open {
    display: block;
    animation: fadeUp 0.2s ease;
}
.suggestions-box .suggestion-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text);
    font-size: 14px;
    border-bottom: 1px solid #f5f3f0;
}
.suggestions-box .suggestion-item:last-child {
    border-bottom: none;
}
.suggestions-box .suggestion-item:hover,
.suggestions-box .suggestion-item.active {
    background: var(--suggestion-hover);
}
.suggestions-box .suggestion-item .s-icon {
    color: var(--text-light);
    font-size: 14px;
    width: 20px;
    text-align: center;
}
.suggestions-box .suggestion-item .s-title {
    font-weight: 500;
    flex: 1;
}
.suggestions-box .suggestion-item .s-cat {
    font-size: 12px;
    color: var(--text-light);
    background: #f0ede8;
    padding: 2px 12px;
    border-radius: 20px;
}
.suggestions-box .suggestion-item .s-highlight {
    color: var(--accent-dark);
    font-weight: 700;
}
.suggestions-box .suggestion-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* ===== MAIN ===== */
.main {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 24px 40px;
    width: 100%;
}
.view {
    display: none;
    animation: fadeUp 0.4s ease;
}
.view.active {
    display: block;
}
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 404 ===== */
.view-404 {
    text-align: center;
    padding: 60px 20px 80px;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}
.view-404 .big-icon {
    font-size: 80px;
    color: #d0cdc8;
    margin-bottom: 20px;
    transition: var(--transition);
}
.view-404 h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
    transition: var(--transition);
}
.view-404 p {
    color: var(--text-light);
    font-size: 18px;
    transition: var(--transition);
}
.view-404 .home-link {
    display: inline-block;
    margin-top: 24px;
    padding: 12px 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 40px;
    font-weight: 600;
    transition: var(--transition);
}
.view-404 .home-link:hover {
    background: var(--primary-light);
    transform: scale(1.03);
}
.notfound-state {
    transition: opacity 0.6s ease, transform 0.6s ease, max-height 0.6s ease;
    opacity: 1;
    transform: translateY(0);
    max-height: 800px;
    overflow: hidden;
}
.notfound-state.hidden {
    opacity: 0;
    transform: translateY(-30px);
    max-height: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
}
.password-state,
.admin-form-state {
    transition: opacity 0.6s ease, transform 0.6s ease, max-height 0.6s ease;
    opacity: 0;
    transform: translateY(20px);
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
}
.password-state.visible,
.admin-form-state.visible {
    opacity: 1;
    transform: translateY(0);
    max-height: 2000px;
    pointer-events: auto;
    overflow: visible;
}
.password-state .lock-icon {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 12px;
    display: block;
}
.password-state h3 {
    font-size: 22px;
    margin-bottom: 4px;
    color: var(--primary);
}
.password-state p {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 20px;
}
.password-state .pw-input-wrap {
    max-width: 320px;
    margin: 0 auto;
    position: relative;
}
.password-state .pw-input-wrap input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    text-align: center;
    transition: var(--transition);
    background: #fafafa;
}
.password-state .pw-input-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(232, 184, 75, 0.2);
    background: #fff;
}
.password-state .pw-input-wrap input:first-child {
    margin-bottom: 10px;
}
.password-state .pw-error {
    color: var(--danger);
    font-size: 14px;
    margin-top: 12px;
    display: none;
}
.password-state .pw-error.show {
    display: block;
}
.password-state .pw-hint {
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-light);
    opacity: 0.5;
}

/* ===== ADMIN PANEL ===== */
.admin-form-state h2 {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--primary);
}
.admin-form-state h2 i {
    color: var(--accent);
}
.admin-form-state .sub {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
}
.admin-form-state label {
    font-weight: 500;
    font-size: 14px;
    display: block;
    margin-top: 14px;
    margin-bottom: 4px;
    text-align: left;
}
.admin-form-state input,
.admin-form-state select,
.admin-form-state textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    transition: var(--transition);
    background: #fafafa;
    text-align: left;
    letter-spacing: normal;
}
.admin-form-state input:focus,
.admin-form-state select:focus,
.admin-form-state textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232, 184, 75, 0.2);
    background: #fff;
}
.admin-form-state select[multiple] {
    min-height: 60px;
}
.admin-form-state textarea {
    resize: vertical;
    min-height: 70px;
}
.admin-form-state .file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}
.admin-form-state .file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.admin-form-state .file-input-wrapper .file-label {
    display: block;
    padding: 12px 16px;
    background: #fafafa;
    border: 1.5px dashed #ddd;
    border-radius: 10px;
    text-align: center;
    color: var(--text-light);
    transition: var(--transition);
    cursor: pointer;
}
.admin-form-state .file-input-wrapper .file-label:hover {
    border-color: var(--accent);
    background: #f0ede8;
}
.admin-form-state .file-input-wrapper .file-label i {
    margin-right: 8px;
}
.admin-form-state .file-name {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}
.admin-form-state .modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: center;
    flex-wrap: wrap;
}
.admin-form-state .modal-actions button {
    padding: 12px 32px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}
.admin-form-state .modal-actions .cancel {
    background: #f0ede8;
    color: var(--text);
}
.admin-form-state .modal-actions .cancel:hover {
    background: #e0dbd3;
}
.admin-form-state .modal-actions .submit {
    background: var(--primary);
    color: #fff;
}
.admin-form-state .modal-actions .submit:hover {
    background: var(--primary-light);
    transform: scale(1.02);
}
.admin-form-state .modal-actions .submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== MANAGE SECTIONS ===== */
.manage-section {
    margin-top: 32px;
    border-top: 2px solid #eee;
    padding-top: 20px;
    text-align: left;
}
.manage-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}
.manage-section .list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f6f3;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: background 0.15s;
}
.manage-section .list-item:hover {
    background: #f0ede8;
}
.manage-section .list-item .item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.manage-section .list-item .item-info .thumb {
    width: 36px;
    height: 48px;
    background: #eae7e2;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-light);
}
.manage-section .list-item .item-info .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.manage-section .list-item .item-info .details {
    flex: 1;
    min-width: 0;
}
.manage-section .list-item .item-info .details .title {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.manage-section .list-item .item-info .details .sub {
    font-size: 13px;
    color: var(--text-light);
}
.manage-section .list-item .item-info .details .sub .category-tag {
    display: inline-block;
    background: #e8e3dc;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin: 1px 2px;
}
.manage-section .list-item .item-info .details .price {
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
}
.manage-section .list-item .actions {
    display: flex;
    gap: 6px;
}
.manage-section .list-item .actions button {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    transition: var(--transition);
}
.manage-section .list-item .actions .edit-btn {
    color: var(--primary-light);
    background: #e8e3dc;
}
.manage-section .list-item .actions .edit-btn:hover {
    background: #d0cdc8;
}
.manage-section .list-item .actions .delete-btn {
    color: var(--danger);
}
.manage-section .list-item .actions .delete-btn:hover {
    background: #fce4e4;
}
.manage-section .empty-msg {
    color: var(--text-light);
    font-size: 14px;
    text-align: center;
    padding: 16px 0;
}

/* ===== CATEGORIES ===== */
.category-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.category-input-row input {
    flex: 1;
    min-width: 160px;
    padding: 10px 16px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    background: #fafafa;
    transition: var(--transition);
}
.category-input-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232, 184, 75, 0.2);
    background: #fff;
}
.category-input-row button {
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    white-space: nowrap;
}
.category-input-row button:hover {
    background: var(--primary-light);
    transform: scale(1.02);
}
.category-tag {
    display: inline-block;
    background: #e8e3dc;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    margin: 3px 4px 3px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.category-tag .remove-cat {
    color: var(--danger);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    padding: 0 2px;
}
.category-tag .remove-cat:hover {
    transform: scale(1.2);
}

/* ===== HOME VIEW ===== */
.categories-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}
.category-btn {
    padding: 8px 22px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    background: #fff;
    color: var(--text-light);
    border: 1px solid #ddd;
    transition: var(--transition);
}
.category-btn:hover {
    border-color: var(--accent);
    color: var(--primary);
}
.category-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== BOOK GRID ===== */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}
.book-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}
.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}
.book-card .cover {
    aspect-ratio: 3 / 4;
    background: #eae7e2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--primary-light);
    position: relative;
    overflow: hidden;
}
.book-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.book-card .cover .badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.book-card .info {
    padding: 16px 18px 18px;
}
.book-card .info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-card .info .author {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 6px;
}
.book-card .info .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-light);
}
.book-card .info .meta .price {
    font-weight: 700;
    color: var(--primary);
    font-size: 16px;
}
.book-card .info .meta .price .currency {
    font-size: 12px;
    font-weight: 400;
}
.book-card .info .categories {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.book-card .info .categories .cat-tag {
    font-size: 10px;
    background: #f0ede8;
    padding: 2px 10px;
    border-radius: 12px;
    color: var(--text-light);
}

/* ===== DETAIL VIEW ===== */
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border-radius: 40px;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.detail-back:hover {
    background: var(--primary);
    color: #fff;
}
.detail-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 40px;
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}
.detail-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.detail-cover {
    aspect-ratio: 3 / 4;
    background: #eae7e2;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    color: var(--primary-light);
    position: relative;
}
.detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.social-section {
    background: #f8f6f3;
    border-radius: var(--radius);
    padding: 16px 12px;
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    border: 1px solid #e8e3dc;
}
.social-section .social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-light);
    transition: var(--transition);
    text-decoration: none;
}
.social-section .social-item:hover {
    color: var(--accent-dark);
    transform: scale(1.05);
}
.social-section .social-item i {
    font-size: 28px;
}
.social-section .social-item .social-label {
    font-size: 12px;
    opacity: 0.8;
}
.detail-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.detail-info .title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}
.detail-info .author {
    font-size: 18px;
    color: var(--text-light);
}
.detail-info .category-tag {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    width: fit-content;
}
.detail-info .description {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 15px;
    margin-top: 4px;
}
.detail-info .price-large {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}
.detail-info .price-large .currency {
    font-weight: 400;
    font-size: 16px;
    color: var(--text-light);
}
.demo-section {
    margin-top: 12px;
    border-top: 2px solid #f0ede8;
    padding-top: 20px;
}
.demo-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.demo-section h4 i {
    color: var(--accent-dark);
}
.demo-section h4 .preview-note-highlight {
    color: var(--danger);
    font-weight: 400;
}
.demo-viewer {
    background: #f8f6f3;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e8e3dc;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-light);
    font-size: 14px;
    position: relative;
    max-height: 600px;
    overflow-y: auto;
}
.demo-viewer .page-preview {
    width: 100%;
    max-width: 500px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.demo-viewer .page-preview canvas {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}
.demo-viewer .preview-note {
    font-size: 13px;
    color: var(--text-light);
    background: #f0ede8;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}
.demo-viewer .loading-preview {
    padding: 40px 20px;
    text-align: center;
}
.whatsapp-cta {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f0f7ee;
    border-radius: 12px;
    padding: 16px 24px;
    margin-top: 8px;
    border: 1px solid #d4e8d0;
    flex-wrap: wrap;
}
.whatsapp-cta .wa-icon {
    background: #25d366;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}
.whatsapp-cta .wa-text {
    flex: 1;
}
.whatsapp-cta .wa-text strong {
    display: block;
    font-size: 16px;
}
.whatsapp-cta .wa-text span {
    font-size: 14px;
    color: var(--text-light);
}
.whatsapp-cta .wa-btn {
    background: #25d366;
    color: #fff;
    padding: 12px 28px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    white-space: nowrap;
}
.whatsapp-cta .wa-btn:hover {
    background: #1da851;
    transform: scale(1.03);
}

/* ===== EMPTY / LOADING ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    grid-column: 1 / -1;
}
.empty-state i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 16px;
    display: block;
}
.empty-state h3 {
    font-size: 20px;
    color: var(--text);
    margin-bottom: 4px;
}
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    grid-column: 1 / -1;
}
.loading-state i {
    font-size: 40px;
    color: var(--accent);
    margin-bottom: 16px;
    display: block;
    animation: spin 1.2s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    z-index: 4000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    max-width: 90vw;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.toast i {
    margin-right: 10px;
    color: var(--accent);
}
.toast .danger {
    color: #ff6b6b;
}
.footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.7);
    padding: 20px 24px;
    text-align: center;
    font-size: 14px;
    margin-top: auto;
}
.footer strong {
    color: #fff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .detail-container {
        grid-template-columns: 280px 1fr;
        gap: 28px;
        padding: 24px;
    }
}
@media (max-width: 820px) {
    .header-inner {
        gap: 12px;
    }
    .logo {
        font-size: 20px;
    }
    .logo .logo-img {
        height: 40px;  /* slightly smaller on tablet */
    }
    .search-wrap {
        order: 3;
        flex-basis: 100%;
        max-width: 100%;
    }
    .search-wrap .search-inner button span {
        display: none;
    }
    .detail-container {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 20px;
    }
    .detail-cover {
        max-width: 260px;
        margin: 0 auto;
        width: 100%;
    }
    .detail-info .title {
        font-size: 26px;
    }
    .admin-form-state .form-row {
        grid-template-columns: 1fr;
    }
    .view-404 h1 {
        font-size: 32px;
    }
    .suggestions-box {
        max-height: 260px;
    }
    .social-section {
        gap: 20px;
    }
}
@media (max-width: 520px) {
    .header {
        padding: 12px 16px;
    }
    .logo .logo-img {
        height: 32px;  /* smaller on mobile */
    }
    .main {
        padding: 16px 16px 32px;
    }
    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    .book-card .info {
        padding: 12px 14px 14px;
    }
    .book-card .info h3 {
        font-size: 14px;
    }
    .categories-filter {
        gap: 6px;
    }
    .category-btn {
        padding: 6px 14px;
        font-size: 12px;
    }
    .detail-container {
        padding: 16px;
    }
    .whatsapp-cta {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 16px;
    }
    .whatsapp-cta .wa-btn {
        justify-content: center;
    }
    .view-404 {
        padding: 40px 16px 60px;
    }
    .view-404 .big-icon {
        font-size: 56px;
    }
    .view-404 h1 {
        font-size: 28px;
    }
    .admin-form-state .modal-actions button {
        padding: 10px 20px;
        font-size: 13px;
    }
    .suggestions-box .suggestion-item {
        padding: 10px 14px;
        font-size: 13px;
    }
    .manage-section .list-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    .category-input-row {
        flex-direction: column;
    }
    .category-input-row button {
        width: 100%;
        justify-content: center;
    }
    .social-section {
        gap: 16px;
    }
}
.hidden {
    display: none !important;
}
.mt-8 {
    margin-top: 8px;
}
.text-center {
    text-align: center;
}
.text-danger {
    color: var(--danger);
}
.text-success {
    color: var(--success);
}
/* ===== FOOTER ===== */
.footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.7);
    padding: 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.footer-left p,
.footer-right p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}
.footer-left strong {
    color: #fff;
}
.footer-right a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}
.footer-right a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 16px 20px;
    }
    .footer-left p,
    .footer-right p {
        font-size: 13px;
    }
}