/* ========================================
   Liblee — Warm bookshop aesthetic
   Custom CSS — no frameworks
   ======================================== */

/* === CSS Variables === */
:root {
    --color-primary: #8b4513;
    --color-primary-dark: #6b3410;
    --color-primary-light: #a0522d;
    --color-secondary: #c4956a;
    --color-accent: #c45e3a;
    --color-cream: #faf6f0;
    --color-cream-dark: #f0e8db;
    --color-warm-white: #fdfbf7;
    --color-paper: #f5efe6;
    --color-text: #3d2c1e;
    --color-text-light: #8b7355;
    --color-text-muted: #a69680;
    --color-border: #e0d5c7;
    --color-border-light: #ede6da;
    --color-success: #5a8a5e;
    --color-error: #c44e3a;
    --color-warning: #d4a33e;
    --color-info: #5a7a9a;

    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Source Sans 3', 'Segoe UI', Tahoma, sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 3px rgba(61,44,30,0.06);
    --shadow-md: 0 4px 12px rgba(61,44,30,0.08);
    --shadow-lg: 0 8px 30px rgba(61,44,30,0.12);
    --shadow-xl: 0 12px 40px rgba(61,44,30,0.16);

    --transition: 0.2s ease;
    --transition-slow: 0.4s ease;

    --container-max: 1200px;
    --nav-height: 70px;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-cream);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
    padding-top: var(--nav-height);
}

/* === Navbar === */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: rgba(250,246,240,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border-light);
    z-index: 1000;
    transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow-md); }

.nav-container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 20px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.nav-search { flex: 1; max-width: 500px; }
.search-form {
    display: flex;
    align-items: center;
    background: var(--color-warm-white);
    border: 1.5px solid var(--color-border);
    border-radius: 100px;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-form:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139,69,19,0.1);
}
.search-input {
    flex: 1;
    border: none;
    background: none;
    padding: 10px 16px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text);
    outline: none;
}
.search-input::placeholder { color: var(--color-text-muted); }
.search-btn {
    background: none;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--color-text-light);
    transition: color var(--transition);
}
.search-btn:hover { color: var(--color-primary); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lang-switcher {
    display: flex;
    gap: 2px;
    background: var(--color-cream-dark);
    border-radius: 100px;
    padding: 2px;
}
.lang-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 100px;
    color: var(--color-text-light);
    transition: all var(--transition);
    letter-spacing: 0.5px;
}
.lang-btn.active {
    background: var(--color-primary);
    color: white;
}
.lang-btn:hover:not(.active) { color: var(--color-text); }

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-btn-sell {
    background: var(--color-primary);
    color: white;
}
.nav-btn-sell:hover {
    background: var(--color-primary-dark);
    color: white;
    transform: translateY(-1px);
}
.nav-btn-login {
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
}
.nav-btn-login:hover { background: var(--color-primary); color: white; }
.nav-btn-register {
    background: var(--color-primary);
    color: white;
}
.nav-btn-register:hover { background: var(--color-primary-dark); color: white; }

.nav-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--color-text-light);
    transition: all var(--transition);
}
.nav-icon-btn:hover { background: var(--color-cream-dark); color: var(--color-text); }
.badge-count {
    position: absolute;
    top: -2px; right: -2px;
    background: var(--color-accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-avatar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 100px;
    transition: background var(--transition);
}
.nav-avatar-btn:hover { background: var(--color-cream-dark); }
.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}
.nav-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-secondary);
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    z-index: 100;
}
.nav-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border-light);
}
.dropdown-header strong { display: block; font-size: 0.9rem; }
.dropdown-header small { color: var(--color-text-muted); font-size: 0.8rem; }
.dropdown-item {
    display: block;
    padding: 10px 16px;
    font-size: 0.875rem;
    color: var(--color-text);
    transition: background var(--transition);
}
.dropdown-item:hover { background: var(--color-paper); color: var(--color-text); }
.dropdown-admin { color: var(--color-primary); font-weight: 600; }
.dropdown-logout { color: var(--color-error); }
.dropdown-divider { height: 1px; background: var(--color-border-light); margin: 4px 0; }

/* Mobile */
.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-mobile-toggle span {
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition);
}

.mobile-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: white;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.mobile-menu.open { max-height: 80vh; overflow-y: auto; }
.mobile-menu-inner { padding: 16px 20px; }
.mobile-search { margin-bottom: 12px; }
.mobile-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: var(--color-paper);
}
.mobile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-light);
    font-weight: 500;
}
.mobile-logout { color: var(--color-error); }
.mobile-lang {
    display: flex;
    gap: 8px;
    padding-top: 12px;
}

/* === Alerts === */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin: 16px auto;
    max-width: var(--container-max);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-error { background: #fce4ec; color: #c62828; border: 1px solid #f8bbd0; }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }
.alert-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
    padding: 0 4px;
}

/* === Hero Section === */
.hero {
    background: linear-gradient(135deg, var(--color-paper) 0%, var(--color-cream-dark) 100%);
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139,69,19,0.04) 0%, transparent 70%);
    border-radius: 50%;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -30%; left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(196,94,58,0.03) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: 16px;
    color: var(--color-primary-dark);
}
.hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--color-text-light);
    margin-bottom: 32px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}
.hero-search {
    max-width: 560px;
    margin: 0 auto;
}
.hero-search .search-form {
    border-width: 2px;
    box-shadow: var(--shadow-md);
}
.hero-search .search-input { padding: 14px 20px; font-size: 1rem; }
.hero-search .search-btn { padding: 14px 18px; }

/* === Sections === */
.section {
    padding: 60px 0;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}
.section-header h2 { margin: 0; }
.section-header a {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* === Book Cards === */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.book-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}
.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.book-card-img {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--color-paper);
}
.book-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.book-card:hover .book-card-img img { transform: scale(1.05); }

.condition-badge {
    position: absolute;
    top: 10px; left: 10px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-new { background: #e8f5e9; color: #2e7d32; }
.badge-good { background: #e3f2fd; color: #1565c0; }
.badge-fair { background: #fff3e0; color: #e65100; }
.badge-poor { background: #fce4ec; color: #c62828; }
.badge-default { background: var(--color-cream-dark); color: var(--color-text-light); }

.book-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.book-card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-card-author {
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-bottom: 12px;
}
.book-card-price {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.book-card-price .price-main {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
}
.book-card-price .price-fee {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* === Categories Grid === */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}
.category-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text);
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--color-primary);
}
.category-card .cat-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: block;
}
.category-card .cat-name {
    font-size: 0.85rem;
    font-weight: 600;
}

/* === How It Works === */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
    text-align: center;
}
.step-card {
    padding: 32px 24px;
}
.step-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 auto 16px;
}
.step-card h3 { margin-bottom: 8px; }
.step-card p { color: var(--color-text-light); font-size: 0.95rem; }

/* === CTA Section === */
.cta-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 60px 0;
    text-align: center;
    color: white;
    border-radius: var(--radius-xl);
    margin: 40px auto;
    max-width: calc(var(--container-max) - 40px);
}
.cta-section h2 { color: white; margin-bottom: 12px; }
.cta-section p { opacity: 0.9; margin-bottom: 24px; max-width: 480px; margin-left: auto; margin-right: auto; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}
.btn-primary {
    background: var(--color-primary);
    color: white;
}
.btn-primary:hover { background: var(--color-primary-dark); color: white; transform: translateY(-1px); }
.btn-secondary {
    background: white;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
}
.btn-secondary:hover { background: var(--color-primary); color: white; }
.btn-white {
    background: white;
    color: var(--color-primary);
}
.btn-white:hover { background: var(--color-cream); color: var(--color-primary-dark); }
.btn-danger {
    background: var(--color-error);
    color: white;
}
.btn-danger:hover { background: #b71c1c; color: white; }
.btn-ghost {
    background: transparent;
    color: var(--color-text-light);
    border: 1.5px solid var(--color-border);
}
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* === Forms === */
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 6px;
    color: var(--color-text);
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text);
    background: white;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139,69,19,0.1);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 4px; }
.form-error { font-size: 0.8rem; color: var(--color-error); margin-top: 4px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

/* Radio cards */
.radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.radio-card {
    position: relative;
    cursor: pointer;
}
.radio-card input { position: absolute; opacity: 0; }
.radio-card-label {
    display: block;
    padding: 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition);
}
.radio-card input:checked + .radio-card-label {
    border-color: var(--color-primary);
    background: rgba(139,69,19,0.04);
}
.radio-card-label strong { display: block; margin-bottom: 4px; font-size: 0.9rem; }
.radio-card-label small { color: var(--color-text-muted); font-size: 0.75rem; }

/* === Auth Pages === */
.auth-page {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}
.auth-card h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
    text-align: center;
}
.auth-subtitle {
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 32px;
}
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--color-text-light);
}
.auth-footer a { font-weight: 600; }

/* === Book Detail === */
.book-detail {
    padding: 40px 0;
}
.book-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}
.book-gallery {
    position: sticky;
    top: calc(var(--nav-height) + 20px);
}
.gallery-main {
    aspect-ratio: 3/4;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-paper);
    margin-bottom: 12px;
}
.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}
.gallery-thumbs {
    display: flex;
    gap: 8px;
}
.gallery-thumb {
    width: 64px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition);
}
.gallery-thumb.active, .gallery-thumb:hover {
    border-color: var(--color-primary);
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info h1 { margin-bottom: 8px; }
.book-author {
    font-size: 1.1rem;
    color: var(--color-text-light);
    margin-bottom: 16px;
}
.book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.book-meta-item {
    padding: 6px 14px;
    background: var(--color-paper);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
}
.book-price-box {
    background: var(--color-paper);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}
.book-price-main {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}
.book-price-fee {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}
.book-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.book-description {
    margin: 24px 0;
    line-height: 1.8;
    color: var(--color-text);
}

.seller-box {
    background: white;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.seller-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.seller-info h4 { font-size: 1rem; margin-bottom: 2px; }
.seller-info p { font-size: 0.8rem; color: var(--color-text-muted); }

/* === Browse / Filters === */
.browse-page { padding: 32px 0; }
.browse-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    align-items: start;
}
.filter-sidebar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: calc(var(--nav-height) + 20px);
}
.filter-sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
}
.filter-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border-light);
}
.filter-section:last-child { border: none; margin-bottom: 0; padding-bottom: 0; }
.filter-section h4 {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.browse-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.browse-count { color: var(--color-text-light); font-size: 0.9rem; }

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
}
.pagination a {
    background: white;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.pagination a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.pagination .active {
    background: var(--color-primary);
    color: white;
    border: 1px solid var(--color-primary);
}
.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* === Dashboard === */
.dashboard-page { padding: 32px 0; }
.dashboard-welcome {
    margin-bottom: 32px;
}
.dashboard-welcome h1 { font-size: 1.8rem; margin-bottom: 4px; }
.dashboard-welcome p { color: var(--color-text-light); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-display);
}
.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 4px;
}
.stat-card .stat-icon {
    float: right;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-paper);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

/* === Tables === */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    background: var(--color-paper);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.data-table td {
    padding: 14px 16px;
    border-top: 1px solid var(--color-border-light);
    font-size: 0.9rem;
    vertical-align: middle;
}
.data-table tr:hover td { background: var(--color-warm-white); }

.status-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-active, .status-betaald, .status-ontvangen { background: #e8f5e9; color: #2e7d32; }
.status-pending, .status-wacht { background: #fff3e0; color: #e65100; }
.status-sold, .status-verzonden { background: #e3f2fd; color: #1565c0; }
.status-removed, .status-mislukt { background: #fce4ec; color: #c62828; }

/* === Messages === */
.messages-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-height: 500px;
}
.conversations-list {
    border-right: 1px solid var(--color-border-light);
    overflow-y: auto;
}
.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: background var(--transition);
}
.conversation-item:hover, .conversation-item.active { background: var(--color-paper); }
.conversation-item.unread { background: rgba(139,69,19,0.04); }
.conversation-item.unread .conv-name { font-weight: 700; }

.conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
}
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-size: 0.9rem; font-weight: 600; }
.conv-preview {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conv-time { font-size: 0.7rem; color: var(--color-text-muted); flex-shrink: 0; }

.chat-area { display: flex; flex-direction: column; }
.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border-light);
    font-weight: 600;
}
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-msg {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    line-height: 1.5;
}
.chat-msg.sent {
    align-self: flex-end;
    background: var(--color-primary);
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-msg.received {
    align-self: flex-start;
    background: var(--color-paper);
    border-bottom-left-radius: 4px;
}
.chat-msg .msg-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
}
.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--color-border-light);
    display: flex;
    gap: 10px;
}
.chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
}
.chat-input-area input:focus { border-color: var(--color-primary); }

/* === Photo Upload === */
.photo-upload-area {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--color-warm-white);
}
.photo-upload-area:hover, .photo-upload-area.dragover {
    border-color: var(--color-primary);
    background: rgba(139,69,19,0.02);
}
.photo-upload-area svg { margin-bottom: 8px; color: var(--color-text-muted); }
.photo-upload-area p { color: var(--color-text-muted); font-size: 0.9rem; }

.photo-preview-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.photo-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview-remove {
    position: absolute;
    top: 4px; right: 4px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* === Stars === */
.stars { display: inline-flex; gap: 2px; }
.star { color: var(--color-border); font-size: 1.1rem; }
.star.filled { color: #f4a940; }
.star.half { color: #f4a940; }
.stars-sm .star { font-size: 0.85rem; }

/* Star rating input */
.star-rating-input {
    display: flex;
    gap: 4px;
    direction: rtl;
}
.star-rating-input input { display: none; }
.star-rating-input label {
    cursor: pointer;
    font-size: 1.6rem;
    color: var(--color-border);
    transition: color var(--transition);
}
.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
    color: #f4a940;
}

/* === Admin === */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    min-height: calc(100vh - var(--nav-height));
}
.admin-sidebar {
    background: var(--color-primary-dark);
    padding: 24px 0;
}
.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    transition: all var(--transition);
}
.admin-sidebar-link:hover, .admin-sidebar-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
}
.admin-sidebar-title {
    padding: 12px 24px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    margin-top: 16px;
}
.admin-content {
    padding: 32px;
    background: var(--color-cream);
}
.admin-content h1 {
    font-size: 1.5rem;
    margin-bottom: 24px;
}

/* === Checkout === */
.checkout-page { padding: 40px 0; }
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}
.checkout-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}
.order-summary-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: calc(var(--nav-height) + 20px);
}
.order-item {
    display: flex;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border-light);
}
.order-item-img {
    width: 80px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.order-item-img img { width: 100%; height: 100%; object-fit: cover; }
.order-totals {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}
.order-total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
}
.order-total-row.total {
    font-weight: 700;
    font-size: 1.1rem;
    border-top: 2px solid var(--color-text);
    padding-top: 12px;
    margin-top: 8px;
}

/* Payment method cards */
.payment-methods {
    display: grid;
    gap: 10px;
}
.payment-method {
    position: relative;
    cursor: pointer;
}
.payment-method input { position: absolute; opacity: 0; }
.payment-method-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
.payment-method input:checked + .payment-method-label {
    border-color: var(--color-primary);
    background: rgba(139,69,19,0.03);
}
.payment-method-label strong { font-size: 0.9rem; }

/* === Success Page === */
.success-page {
    text-align: center;
    padding: 80px 20px;
}
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e8f5e9;
    color: #2e7d32;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2rem;
}
.success-page h1 { margin-bottom: 12px; }
.success-page p { color: var(--color-text-light); margin-bottom: 32px; }
.success-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* === Testimonials === */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.testimonial-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.testimonial-card .stars { margin-bottom: 12px; }
.testimonial-card p { font-style: italic; margin-bottom: 16px; color: var(--color-text); line-height: 1.7; }
.testimonial-author {
    font-weight: 600;
    font-size: 0.9rem;
}

/* === Profile Page === */
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* === Wishlist === */
.wishlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.wishlist-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}
.wishlist-item-img {
    width: 70px;
    height: 90px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.wishlist-item-img img { width: 100%; height: 100%; object-fit: cover; }

/* === Image Lightbox === */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-md);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* === Empty States === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state svg { margin-bottom: 16px; color: var(--color-text-muted); }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--color-text-light); margin-bottom: 24px; }

/* === Utility === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-error { color: var(--color-error); }
.text-success { color: var(--color-success); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .browse-layout { grid-template-columns: 1fr; }
    .filter-sidebar { position: static; }
    .book-detail-grid { grid-template-columns: 1fr; gap: 32px; }
    .book-gallery { position: static; }
    .checkout-grid { grid-template-columns: 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar {
        display: flex;
        overflow-x: auto;
        padding: 0;
    }
    .admin-sidebar-link { white-space: nowrap; padding: 12px 16px; }
    .admin-sidebar-title { display: none; }
    .messages-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    :root { --nav-height: 60px; }
    .nav-search { display: none; }
    .nav-btn-label { display: none; }
    .nav-btn-sell span.nav-btn-label { display: none; }
    .lang-switcher { display: none; }
    .nav-mobile-toggle { display: flex; }
    .nav-btn-login, .nav-btn-register { display: none; }

    .hero { padding: 48px 0 40px; }
    .hero h1 { font-size: 1.8rem; }

    .book-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
    .categories-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .steps-grid { grid-template-columns: 1fr; gap: 16px; }

    .auth-card { padding: 28px 20px; }
    .form-row { grid-template-columns: 1fr; }
    .section { padding: 40px 0; }
    .cta-section { margin: 20px; padding: 40px 20px; border-radius: var(--radius-lg); }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .conversations-list { display: none; }
    .conversations-list.mobile-show { display: block; }
}

@media (max-width: 480px) {
    .book-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .book-card-body { padding: 12px; }
    .book-card-title { font-size: 0.9rem; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease forwards; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.loading-pulse { animation: pulse 1.5s ease-in-out infinite; }

/* === Chart container === */
.chart-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

/* === No-cover placeholder === */
.no-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-paper);
    color: var(--color-text-muted);
}

/* Print */
@media print {
    .navbar, .footer, .admin-sidebar { display: none; }
    .main-content { padding-top: 0; }
}
