/* =============================================
   NIGEL R KHAN BOOKSELLER - MAIN STYLESHEET
   The Future of Bookselling
   ============================================= */

/* CSS Variables */
:root {
    /* Brand Colors - Warm Literary Palette */
    --burgundy: #722F37;
    --burgundy-dark: #5a252c;
    --burgundy-light: #8b3a44;
    --gold: #C5A572;
    --gold-dark: #a68a5b;
    --gold-light: #d4bb8a;
    --cream: #FDF8F3;
    --cream-dark: #f5ebe0;
    --espresso: #2C1810;
    --espresso-light: #4a2c20;

    /* Accent Colors */
    --success: #2E7D32;
    --warning: #F57C00;
    --error: #C62828;
    --info: #1565C0;

    /* Neutrals */
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Crimson Pro', Georgia, serif;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--espresso);
    background-color: var(--cream);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--espresso);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: var(--space-md);
}

/* =============================================
   NAVIGATION
   ============================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--cream);
    border-bottom: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(253, 248, 243, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--burgundy);
}

.logo-icon {
    font-size: 1.75rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav-link {
    font-family: var(--font-ui);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--espresso);
    padding: var(--space-sm) 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--burgundy);
    transition: width var(--transition-normal);
}

.nav-link:hover {
    color: var(--burgundy);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--espresso);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-icon-btn:hover {
    background: var(--gray-100);
    color: var(--burgundy);
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    background: var(--burgundy);
    color: var(--white);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-fast);
}

.cart-badge.visible {
    opacity: 1;
    transform: scale(1);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-sm);
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--espresso);
    transition: all var(--transition-fast);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-ui);
    font-weight: 500;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.0625rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--burgundy);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--burgundy-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gold);
    color: var(--espresso);
}

.btn-secondary:hover {
    background: var(--gold-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--burgundy);
    color: var(--burgundy);
}

.btn-outline:hover {
    background: var(--burgundy);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--espresso);
}

.btn-ghost:hover {
    background: var(--gray-100);
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
    padding-top: 72px;
    min-height: 85vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23722F37' fill-opacity='0.03'%3E%3Crect x='0' y='0' width='4' height='60'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--gold-light);
    color: var(--espresso);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-lg);
}

.hero h1 {
    margin-bottom: var(--space-lg);
    color: var(--espresso);
}

.hero h1 span {
    color: var(--burgundy);
}

.hero-text {
    font-size: 1.25rem;
    color: var(--gray-700);
    margin-bottom: var(--space-xl);
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.hero-stats {
    display: flex;
    gap: var(--space-2xl);
}

.hero-stat {
    text-align: left;
}

.hero-stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--burgundy);
}

.hero-stat-label {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-books {
    display: flex;
    gap: -20px;
    transform: perspective(1000px) rotateY(-5deg);
}

.hero-book {
    width: 180px;
    height: 260px;
    background: linear-gradient(145deg, var(--burgundy), var(--burgundy-dark));
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xl);
    position: relative;
    transform-style: preserve-3d;
    animation: float 6s ease-in-out infinite;
}

.hero-book:nth-child(1) { animation-delay: 0s; z-index: 3; }
.hero-book:nth-child(2) { animation-delay: 0.5s; z-index: 2; margin-left: -40px; transform: translateY(20px); }
.hero-book:nth-child(3) { animation-delay: 1s; z-index: 1; margin-left: -40px; transform: translateY(40px); }

.hero-book::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid var(--gold);
    opacity: 0.5;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* =============================================
   FEATURES BAR
   ============================================= */
.features-bar {
    background: var(--espresso);
    padding: var(--space-lg) 0;
}

.features-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--white);
}

.feature-icon {
    font-size: 1.5rem;
}

.feature-text {
    font-family: var(--font-ui);
    font-size: 0.9375rem;
}

.feature-text strong {
    display: block;
    font-weight: 600;
}

.feature-text span {
    color: var(--gray-400);
    font-size: 0.8125rem;
}

/* =============================================
   SECTION STYLES
   ============================================= */
.section {
    padding: var(--space-3xl) 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-2xl);
}

.section-header h2 {
    margin-bottom: var(--space-md);
}

.section-header p {
    color: var(--gray-600);
    font-size: 1.125rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* =============================================
   CATEGORIES GRID
   ============================================= */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.category-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--burgundy);
}

.category-icon {
    font-size: 2.5rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    border-radius: var(--radius-lg);
}

.category-info h3 {
    margin-bottom: var(--space-xs);
    font-size: 1.25rem;
}

.category-info p {
    color: var(--gray-600);
    font-size: 0.9375rem;
    margin: 0;
}

/* =============================================
   BOOK GRID
   ============================================= */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-lg);
}

.book-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.book-image {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.book-card:hover .book-image img {
    transform: scale(1.05);
}

.book-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--burgundy);
    color: var(--white);
    font-family: var(--font-ui);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

.book-badge.sale {
    background: var(--warning);
}

.book-actions {
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-sm);
    display: flex;
    gap: var(--space-xs);
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-normal);
}

.book-card:hover .book-actions {
    opacity: 1;
    transform: translateY(0);
}

.book-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    color: var(--espresso);
    transition: all var(--transition-fast);
}

.book-action-btn:hover {
    background: var(--burgundy);
    color: var(--white);
}

.book-info {
    padding: var(--space-md);
}

.book-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: var(--space-sm);
}

.book-price {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.book-price-current {
    font-family: var(--font-ui);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--burgundy);
}

.book-price-original {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    color: var(--gray-500);
    text-decoration: line-through;
}

.book-stock {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--success);
    margin-top: var(--space-xs);
}

.book-stock.low {
    color: var(--warning);
}

/* =============================================
   MEMBERSHIP SECTION
   ============================================= */
.membership-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.membership-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    border: 2px solid var(--gray-200);
    transition: all var(--transition-normal);
    position: relative;
}

.membership-card.highlight {
    border-color: var(--burgundy);
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.membership-card.highlight::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-xs) var(--space-md);
    background: var(--burgundy);
    color: var(--white);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.membership-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.membership-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.membership-price {
    margin-bottom: var(--space-lg);
}

.membership-price .amount {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--burgundy);
}

.membership-price .period {
    color: var(--gray-600);
    font-size: 0.9375rem;
}

.membership-benefits {
    text-align: left;
    margin-bottom: var(--space-xl);
}

.membership-benefit {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--gray-100);
}

.membership-benefit:last-child {
    border-bottom: none;
}

.membership-benefit svg {
    width: 20px;
    height: 20px;
    color: var(--success);
    flex-shrink: 0;
    margin-top: 2px;
}

/* =============================================
   SCHOOL BOOK FINDER
   ============================================= */
.school-finder {
    background: var(--espresso);
    color: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl);
}

.school-finder-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}

.school-finder-content h2 {
    color: var(--white);
    margin-bottom: var(--space-md);
}

.school-finder-content p {
    color: var(--gray-400);
    font-size: 1.125rem;
}

.school-finder-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.finder-select {
    padding: var(--space-md);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    color: var(--white);
    font-family: var(--font-ui);
    font-size: 1rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    cursor: pointer;
}

.finder-select option {
    background: var(--espresso);
    color: var(--white);
}

.finder-btn {
    background: var(--gold);
    color: var(--espresso);
    padding: var(--space-md) var(--space-xl);
    font-weight: 600;
}

.finder-btn:hover {
    background: var(--gold-dark);
}

/* =============================================
   STORE LOCATIONS
   ============================================= */
.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.store-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
}

.store-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--burgundy);
}

.store-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.store-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
}

.store-badge {
    padding: var(--space-xs) var(--space-sm);
    background: var(--success);
    color: var(--white);
    font-family: var(--font-ui);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.store-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    color: var(--gray-600);
    font-size: 0.9375rem;
}

.store-info-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.store-info-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--burgundy);
}

/* =============================================
   BOOKBOT CHAT WIDGET
   ============================================= */
.bookbot-widget {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 999;
}

.bookbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: var(--burgundy);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: all var(--transition-normal);
}

.bookbot-toggle:hover {
    transform: scale(1.1);
    background: var(--burgundy-dark);
}

.bookbot-icon {
    font-size: 1.75rem;
}

.bookbot-pulse {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 16px;
    height: 16px;
    background: var(--success);
    border: 2px solid var(--white);
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.bookbot-chat {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    height: 520px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all var(--transition-normal);
}

.bookbot-chat.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.bookbot-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--burgundy);
    color: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.bookbot-avatar {
    font-size: 1.5rem;
}

.bookbot-info {
    flex: 1;
}

.bookbot-name {
    font-family: var(--font-display);
    font-weight: 600;
    display: block;
}

.bookbot-status {
    font-size: 0.75rem;
    opacity: 0.8;
}

.bookbot-minimize {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    color: var(--white);
    font-size: 1.25rem;
}

.bookbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.bot-message, .user-message {
    max-width: 85%;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.message-content {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.bot-message .message-content {
    background: var(--gray-100);
    color: var(--espresso);
    border-bottom-left-radius: var(--radius-sm);
}

.user-message .message-content {
    background: var(--burgundy);
    color: var(--white);
    border-bottom-right-radius: var(--radius-sm);
}

.message-content ul {
    margin-top: var(--space-sm);
    padding-left: var(--space-md);
    list-style: disc;
}

.message-content li {
    margin-bottom: var(--space-xs);
}

.bookbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--gray-100);
}

.suggestion-chip {
    padding: var(--space-xs) var(--space-sm);
    background: var(--cream);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    color: var(--espresso);
    transition: all var(--transition-fast);
}

.suggestion-chip:hover {
    background: var(--burgundy);
    color: var(--white);
    border-color: var(--burgundy);
}

.bookbot-input {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-top: 1px solid var(--gray-200);
}

.bookbot-input input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-family: var(--font-ui);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.bookbot-input input:focus {
    border-color: var(--burgundy);
}

.bookbot-send {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--burgundy);
    color: var(--white);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.bookbot-send:hover {
    background: var(--burgundy-dark);
}

/* =============================================
   CART SIDEBAR
   ============================================= */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
}

.cart-sidebar.open {
    transform: translateX(0);
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
}

.cart-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
}

.cart-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gray-600);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.cart-close:hover {
    background: var(--gray-100);
    color: var(--espresso);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.cart-item {
    display: flex;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--gray-100);
}

.cart-item-image {
    width: 70px;
    height: 90px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.cart-item-price {
    color: var(--burgundy);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.cart-item-qty button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--espresso);
}

.cart-item-qty button:hover {
    background: var(--gray-200);
}

.cart-item-qty span {
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.cart-empty {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--gray-500);
}

.cart-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.cart-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    font-size: 1.125rem;
}

.cart-subtotal span:last-child {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--burgundy);
    font-size: 1.5rem;
}

/* =============================================
   MODALS
   ============================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gray-600);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    z-index: 1;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--espresso);
}

/* Search Modal */
.search-modal-content {
    width: 600px;
    max-width: 90%;
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
}

.search-input-wrapper svg {
    color: var(--gray-500);
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    font-family: var(--font-ui);
    font-size: 1.125rem;
    outline: none;
}

.search-close {
    font-size: 1.5rem;
    color: var(--gray-500);
    padding: var(--space-sm);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:hover {
    background: var(--gray-50);
}

.search-result-image {
    width: 50px;
    height: 65px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info h4 {
    font-size: 0.9375rem;
    margin-bottom: var(--space-xs);
}

.search-result-info p {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0;
}

/* Login Modal */
.login-modal {
    width: 420px;
    padding: var(--space-2xl);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--space-md);
}

.login-header h2 {
    margin-bottom: var(--space-sm);
}

.login-header p {
    color: var(--gray-600);
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--burgundy);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.login-footer {
    text-align: center;
    margin-top: var(--space-lg);
    color: var(--gray-600);
}

.login-footer a {
    color: var(--burgundy);
    font-weight: 500;
}

/* Checkout Modal */
.checkout-modal {
    width: 600px;
    padding: var(--space-xl);
}

.checkout-header {
    margin-bottom: var(--space-xl);
}

.checkout-section h3 {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--gray-200);
}

.checkout-summary {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.checkout-summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    border-top: 1px solid var(--gray-300);
    padding-top: var(--space-md);
    margin-top: var(--space-md);
    color: var(--burgundy);
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1003;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--espresso);
    color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--error);
}

.toast.warning {
    background: var(--warning);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    background: var(--espresso);
    color: var(--white);
    padding: var(--space-3xl) 0 var(--space-lg);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.footer-main {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: var(--space-3xl);
    padding-bottom: var(--space-2xl);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.footer-tagline {
    color: var(--gold);
    font-style: italic;
    margin-bottom: var(--space-md);
}

.footer-description {
    color: var(--gray-400);
    font-size: 0.9375rem;
    max-width: 300px;
}

.footer-social {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    color: var(--white);
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--burgundy);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.footer-col h4 {
    color: var(--white);
    font-family: var(--font-display);
    font-size: 1rem;
    margin-bottom: var(--space-lg);
}

.footer-col a {
    display: block;
    color: var(--gray-400);
    font-size: 0.9375rem;
    padding: var(--space-xs) 0;
    transition: color var(--transition-fast);
}

.footer-col a:hover {
    color: var(--gold);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-lg);
    color: var(--gray-500);
    font-size: 0.875rem;
}

.footer-legal {
    display: flex;
    gap: var(--space-lg);
}

.footer-legal a {
    color: var(--gray-500);
    transition: color var(--transition-fast);
}

.footer-legal a:hover {
    color: var(--gold);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-visual {
        display: none;
    }

    .hero-text {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .membership-grid {
        grid-template-columns: 1fr;
    }

    .membership-card.highlight {
        transform: none;
        order: -1;
    }

    .school-finder-grid {
        grid-template-columns: 1fr;
    }

    .footer-main {
        grid-template-columns: 1fr;
    }

    .footer-links {
        margin-top: var(--space-xl);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .features-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .book-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-links {
        grid-template-columns: 1fr 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .cart-sidebar {
        width: 100%;
    }

    .bookbot-chat {
        width: calc(100vw - 32px);
        right: -16px;
    }
}

@media (max-width: 480px) {
    .features-container {
        grid-template-columns: 1fr;
    }

    .book-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--space-md);
    }

    .footer-links {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   PAGE-SPECIFIC STYLES
   ============================================= */

/* Shop Page */
.shop-header {
    background: linear-gradient(135deg, var(--burgundy) 0%, var(--burgundy-dark) 100%);
    color: var(--white);
    padding: calc(72px + var(--space-3xl)) 0 var(--space-3xl);
    text-align: center;
}

.shop-header h1 {
    color: var(--white);
    margin-bottom: var(--space-md);
}

.shop-header p {
    color: rgba(255,255,255,0.8);
    max-width: 600px;
    margin: 0 auto;
}

.shop-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: var(--space-xl);
}

.filter-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-100);
    border-radius: var(--radius-full);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    color: var(--gray-700);
    transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--burgundy);
    color: var(--white);
}

/* About Page */
.about-hero {
    background: linear-gradient(135deg, var(--espresso) 0%, var(--espresso-light) 100%);
    color: var(--white);
    padding: calc(72px + var(--space-3xl)) 0 var(--space-3xl);
}

.about-hero h1 {
    color: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-3xl);
}

.about-story {
    font-size: 1.125rem;
    line-height: 1.8;
}

.about-stats {
    background: var(--cream);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    height: fit-content;
}

.about-stat {
    text-align: center;
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--gray-200);
}

.about-stat:last-child {
    border-bottom: none;
}

.about-stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--burgundy);
}

.about-stat-label {
    font-size: 0.9375rem;
    color: var(--gray-600);
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--burgundy);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}



/* Add these styles AT THE END of your existing main.css file */

/* =============================================
   MOBILE MENU FIXES
   ============================================= */

/* Mobile Navigation Menu - Full screen overlay */
.nav-links.mobile-open {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--cream);
    padding: var(--space-xl);
    gap: var(--space-md);
    z-index: 999;
    animation: slideIn 0.3s ease;
    overflow-y: auto;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-links.mobile-open .nav-link {
    font-size: 1.25rem;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--gray-200);
}

/* Mobile menu button animation (hamburger to X) */
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu-btn span {
    transition: all 0.3s ease;
}

/* =============================================
   MOBILE RESPONSIVE FIXES
   ============================================= */
@media (max-width: 768px) {
    /* Fix navbar height and logo */
    .nav-container {
        padding: 0 var(--space-md);
        height: 64px;
    }

    .logo {
        font-size: 1rem;
        max-width: 120px;
        flex-shrink: 0;
    }

    .logo-text {
        line-height: 1.2;
    }

    .logo-icon {
        font-size: 1.25rem;
    }

    /* Fix nav actions spacing */
    .nav-actions {
        gap: var(--space-xs);
    }

    .nav-icon-btn {
        width: 36px;
        height: 36px;
    }

    #loginBtn {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.75rem;
    }

    /* Fix hero section */
    .hero {
        padding-top: 64px;
        min-height: auto;
    }

    .hero-container {
        padding: var(--space-xl) var(--space-md);
    }

    .hero-content {
        text-align: center;
    }

    .hero h1 {
        font-size: 1.75rem;
        word-wrap: break-word;
    }

    .hero-text {
        font-size: 1rem;
        padding: 0;
        max-width: 100%;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: var(--space-xs) var(--space-sm);
    }

    .hero-actions {
        flex-direction: column;
        gap: var(--space-md);
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    /* Fix about page */
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .about-hero {
        padding: calc(64px + var(--space-xl)) var(--space-md) var(--space-xl);
    }

    .about-hero h1 {
        font-size: 1.75rem;
    }

    .about-story {
        font-size: 1rem;
    }

    /* Fix shop header */
    .shop-header {
        padding: calc(64px + var(--space-xl)) var(--space-md) var(--space-xl);
    }

    .shop-header h1 {
        font-size: 1.75rem;
    }

    /* Fix footer */
    .footer-container {
        padding: var(--space-xl) var(--space-md);
    }

    .footer-brand {
        text-align: center;
    }

    .footer-description {
        max-width: 100%;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-links {
        text-align: center;
    }

    /* Fix BookBot */
    .bookbot-widget {
        bottom: 16px;
        right: 16px;
    }

    .bookbot-toggle {
        width: 50px;
        height: 50px;
    }

    .bookbot-chat {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 70vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .bookbot-chat.open {
        bottom: 0;
    }

    /* Fix sections */
    .section {
        padding: var(--space-xl) var(--space-md);
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* Prevent horizontal scroll */
    main, body {
        overflow-x: hidden;
    }

    /* Fix school finder */
    .school-finder {
        padding: var(--space-xl);
    }

    .school-finder h2 {
        font-size: 1.25rem;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .logo {
        font-size: 0.875rem;
        max-width: 90px;
    }

    .logo-icon {
        font-size: 1rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    #loginBtn {
        display: none;
    }

    .nav-icon-btn {
        width: 32px;
        height: 32px;
    }
}
