@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #0F6B50;
    --primary-dark: #0A5740;
    --primary-light: #E8F5F0;
    --accent: #D4A017;
    --accent-light: #FDF8E8;
    --navy: #1E3A5F;
    --navy-light: #2A4A6F;
    --dark: #111827;
    --text: #374151;
    --text-light: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --bg: #F9FAFB;
    --white: #FFFFFF;
    --green: #059669;
    --green-bg: #ECFDF5;
    --red: #DC2626;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.12);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.nav-brand, .section-header h2, .feature-card h3,
.sidebar-info h4, .main-header h2 {
    font-family: 'Sora', sans-serif;
}

a { text-decoration: none; }

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ══════════════════════════════════════
   NAV
   ══════════════════════════════════════ */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: all 0.3s;
}
.nav.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}
.nav-brand {
    font-family: 'Sora', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}
.nav-brand b { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--dark); }
.nav-cta {
    background: var(--primary) !important;
    color: var(--white) !important;
    padding: 8px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
    transition: all 0.2s !important;
    box-shadow: 0 2px 8px rgba(15,107,80,0.3) !important;
}
.nav-cta:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px) !important;
}
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ══════════════════════════════════════
   HERO
   ══════════════════════════════════════ */
.hero {
    margin-top: 60px;
    padding: 56px 24px 48px;
    background: linear-gradient(135deg, #1a2e4a 0%, #1E3A5F 40%, #1a3352 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 60% at 15% 50%, rgba(15,107,80,0.15), transparent),
        radial-gradient(ellipse 50% 60% at 85% 50%, rgba(212,160,23,0.1), transparent);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,160,23,0.3), transparent);
}
.hero * { position: relative; }
.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(212,160,23,0.12);
    color: var(--accent);
    padding: 7px 18px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(212,160,23,0.2);
    letter-spacing: 0.3px;
}
.hero h1 {
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--white);
    line-height: 1.15;
    letter-spacing: -0.8px;
    margin-bottom: 16px;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}
.hero h1 em {
    font-style: normal;
    color: var(--accent);
    background: linear-gradient(135deg, #D4A017, #f0c040);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.6);
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.7;
}
.hero-search {
    display: flex;
    max-width: 520px;
    margin: 0 auto 28px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.12);
    transition: all 0.3s;
}
.hero-search:focus-within {
    border-color: rgba(212,160,23,0.5);
    background: rgba(255,255,255,0.12);
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.hero-search input[type="text"],
.hero-search input {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
.hero-search input::placeholder { color: rgba(255,255,255,0.4); }
.hero-search input:focus { outline: none; border: none; box-shadow: none; }
.hero-search button {
    padding: 14px 28px;
    background: var(--accent);
    color: var(--dark);
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.hero-search button:hover { background: #c49215; }
.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ══════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(15,107,80,0.3);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-dark {
    background: var(--accent);
    color: var(--dark);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(212,160,23,0.3);
}
.btn-dark:hover { background: #c49215; transform: translateY(-1px); }
.btn-outline {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    border: 1.5px solid rgba(255,255,255,0.15);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    color: var(--white);
}
.btn-buy {
    background: var(--primary);
    color: var(--white);
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(15,107,80,0.2);
}
.btn-buy:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,107,80,0.3);
}

/* ══════════════════════════════════════
   STORE LAYOUT
   ══════════════════════════════════════ */
.store-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 80px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    align-items: start;
    overflow: hidden;
}

/* ══════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════ */
.sidebar {
    position: sticky;
    top: 92px;
}
.sidebar-section { margin-bottom: 24px; }
.sidebar-title {
    font-family: 'Sora', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding: 0 10px;
}
.sidebar-list { list-style: none; }
.sidebar-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    transition: all 0.15s;
}
.sidebar-list li a:hover {
    background: var(--white);
    color: var(--dark);
}
.sidebar-list li a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.sidebar-count {
    font-size: 0.7rem;
    background: var(--bg);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}
.sidebar-list li a.active .sidebar-count {
    background: rgba(15,107,80,0.15);
    color: var(--primary);
}

.sidebar-info {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
}
.sidebar-info h4 {
    font-family: 'Sora', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}
.sidebar-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    font-size: 0.8rem;
    color: var(--text);
}
.sidebar-info-icon {
    width: 26px;
    height: 26px;
    background: var(--primary);
    color: var(--white);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ══════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════ */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.main-header h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
}
.main-header .results-count {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}
.sort-dropdown select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    color: var(--text);
    background: var(--white);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.sort-dropdown select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,107,80,0.1);
}

/* ══════════════════════════════════════
   EBOOK GRID
   ══════════════════════════════════════ */
.main-content {
    min-width: 0;
    overflow: hidden;
}
.ebooks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.ebook-card {
    background: var(--white);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
}
.ebook-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.ebook-cover {
    height: 280px;
    overflow: hidden;
    background: linear-gradient(145deg, #F3F4F6, #E5E7EB);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.ebook-cover img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
    border-radius: 4px;
    filter: drop-shadow(2px 4px 8px rgba(0,0,0,0.15));
}
.ebook-card:hover .ebook-cover img {
    transform: scale(1.04);
}
.ebook-cover .format-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--navy);
    color: var(--white);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.8px;
}
.ebook-cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, var(--navy), var(--navy-light));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    border-radius: 6px;
}
.ebook-cover-placeholder h4 {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
}

.ebook-info { padding: 14px 16px; }
.ebook-info h3 {
    font-family: 'Sora', sans-serif;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ebook-info p {
    color: var(--text-light);
    font-size: 0.76rem;
    margin-bottom: 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ebook-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}
.ebook-meta span {
    background: var(--bg);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-light);
}
.ebook-bottom {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.ebook-price {
    font-family: 'Sora', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
    white-space: nowrap;
}
.ebook-price small {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-muted);
    display: block;
}

/* ══════════════════════════════════════
   FEATURES / HOW IT WORKS
   ══════════════════════════════════════ */
.features-section {
    padding: 72px 24px;
    background: var(--white);
    border-top: 1px solid var(--border);
}
.section-header {
    text-align: center;
    margin-bottom: 44px;
}
.section-header h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.section-header p {
    color: var(--text-light);
    font-size: 0.92rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 880px;
    margin: 0 auto;
}
.feature-card {
    padding: 28px 22px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--white);
    text-align: center;
    transition: all 0.25s;
}
.feature-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 auto 14px;
}
.feature-card h3 {
    font-family: 'Sora', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--dark);
}
.feature-card p {
    color: var(--text-light);
    font-size: 0.82rem;
    line-height: 1.65;
}

/* ══════════════════════════════════════
   CTA SECTION
   ══════════════════════════════════════ */
.cta-section {
    padding: 56px 24px;
    background: linear-gradient(135deg, #1a2e4a 0%, #1E3A5F 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 80% at 20% 50%, rgba(15,107,80,0.12), transparent),
        radial-gradient(ellipse 50% 80% at 80% 50%, rgba(212,160,23,0.08), transparent);
    pointer-events: none;
}
.cta-section * { position: relative; }
.cta-section h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.7rem;
    color: var(--white);
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.cta-section p {
    color: rgba(255,255,255,0.55);
    margin-bottom: 24px;
    font-size: 0.92rem;
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.4);
    text-align: center;
    padding: 18px 24px;
    font-size: 0.76rem;
}

/* ══════════════════════════════════════
   MODAL
   ══════════════════════════════════════ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.modal.active { display: flex; }
.modal-content {
    background: var(--white);
    border-radius: 18px;
    padding: 32px;
    max-width: 400px;
    width: 92%;
    position: relative;
    text-align: center;
    box-shadow: var(--shadow-xl);
}
.modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s;
}
.modal-close:hover { background: var(--bg); color: var(--dark); }
.modal-content h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}
.modal-book-title {
    color: var(--text-light);
    font-size: 0.84rem;
    margin-bottom: 4px;
}
.modal-price {
    font-family: 'Sora', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
    letter-spacing: -1px;
}
.modal-content label {
    display: block;
    text-align: left;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.82rem;
    color: var(--dark);
}
.modal-content input[type="email"],
.modal-content input[type="tel"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    text-align: center;
    letter-spacing: 1.5px;
    transition: all 0.2s;
    background: var(--bg);
    color: var(--dark);
}
.modal-content input[type="email"]:focus,
.modal-content input[type="tel"]:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(15,107,80,0.1);
}
.help-text {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 8px;
}
.btn-pay {
    background: var(--primary);
    color: var(--white);
    width: 100%;
    padding: 13px;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    margin-top: 14px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(15,107,80,0.25);
}
.btn-pay:hover { background: var(--primary-dark); transform: translateY(-1px); }

.mpesa-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.74rem;
}
.mpesa-badge {
    background: #16A34A;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.66rem;
    font-weight: 700;
}

.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.success-icon {
    width: 52px; height: 52px;
    background: var(--green-bg);
    color: var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 14px;
}
.error-icon {
    width: 52px; height: 52px;
    background: #FEF2F2;
    color: var(--red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 14px;
}
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: var(--white);
    padding: 12px 28px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(15,107,80,0.25);
}
.btn-download:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ══════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--white);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ══════════════════════════════════════
   DELIVERY OPTIONS (book.php modal)
   ══════════════════════════════════════ */
.delivery-options label {
    text-align: center !important;
}

/* ══════════════════════════════════════
   RESPONSIVE — TABLET
   ══════════════════════════════════════ */
@media (max-width: 960px) {
    .store-layout {
        grid-template-columns: 1fr;
        padding: 20px 16px 60px;
    }
    .sidebar {
        position: static;
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .sidebar::-webkit-scrollbar { display: none; }
    .sidebar-section { margin-bottom: 0; flex-shrink: 0; }
    .sidebar-section:last-child { display: none; }
    .sidebar-title { display: none; }
    .sidebar-list { display: flex; gap: 6px; }
    .sidebar-list li a {
        padding: 8px 14px;
        white-space: nowrap;
        border: 1.5px solid var(--border);
        border-radius: 100px;
        font-size: 0.8rem;
        background: var(--white);
    }
    .sidebar-list li a.active {
        border-color: var(--primary);
        background: var(--primary-light);
    }
    .sidebar-count { display: none; }
    .main-header { flex-direction: column; align-items: flex-start; }
    .sort-dropdown { width: 100%; }
    .sort-dropdown select { width: 100%; }
    .ebooks-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ══════════════════════════════════════
   RESPONSIVE — MOBILE
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    .nav { padding: 0 16px; height: 56px; }
    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 12px 16px;
        gap: 0;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        padding: 12px 14px;
        border-radius: 8px;
        display: block;
        width: 100%;
    }
    .nav-links a:hover { background: var(--bg); }
    .nav-cta { margin-top: 6px; text-align: center !important; display: block !important; }
    .hero { margin-top: 56px; padding: 36px 16px 32px; }
    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: 0.85rem; margin-bottom: 20px; }
    .hero-search { flex-direction: column; border-radius: 10px; }
    .hero-search input { padding: 12px 14px; font-size: 0.88rem; border-radius: 0; }
    .hero-search button { padding: 12px 16px; font-size: 0.84rem; }
    .hero-actions .btn { padding: 10px 20px; font-size: 0.84rem; }
    .ebooks-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .ebook-cover { height: 200px; padding: 10px; }
    .ebook-info { padding: 10px 12px; }
    .ebook-info h3 { font-size: 0.78rem; }
    .ebook-info p { display: none; }
    .ebook-meta { display: none; }
    .ebook-bottom { padding-top: 10px; flex-direction: column; align-items: stretch; gap: 6px; }
    .ebook-price { font-size: 0.92rem; text-align: center; }
    .ebook-price small { display: none; }
    .btn-buy { padding: 8px 12px; font-size: 0.78rem; }
    .features-section { padding: 40px 16px; }
    .features-grid { grid-template-columns: 1fr; gap: 14px; }
    .section-header h2 { font-size: 1.35rem; }
    .cta-section { padding: 36px 16px; }
    .cta-section h2 { font-size: 1.3rem; }
    .cta-section p { font-size: 0.85rem; }
    .modal-content { padding: 24px 18px; max-width: 95%; border-radius: 14px; }
    .modal-price { font-size: 1.6rem; }
    .pagination { flex-wrap: wrap; }
    .footer { padding: 14px 16px; font-size: 0.7rem; }
}

/* ══════════════════════════════════════
   RESPONSIVE — SMALL PHONE
   ══════════════════════════════════════ */
@media (max-width: 480px) {
    .ebooks-grid { grid-template-columns: 1fr; }
    .ebook-cover { height: 240px; padding: 14px; }
    .ebook-info { padding: 12px 14px; }
    .ebook-info p { display: block; }
    .ebook-meta { display: flex; }
    .ebook-bottom { flex-direction: row; }
    .ebook-price { text-align: left; }
    .hero h1 { font-size: 1.35rem; }
    .hero-tag { font-size: 0.7rem; padding: 6px 14px; }
    .nav-brand { font-size: 1.1rem; }
    .nav-cta { padding: 6px 14px !important; font-size: 0.76rem !important; }
}
