/* Shop Styles - Wonderful Modern E-commerce Design */
:root {
    /* Bookshop Earthy & Premium Palette */
    --primary: #2C5530;
    /* Forest Green */
    --primary-dark: #1e3b22;
    --primary-light: #4A7A50;
    --primary-soft: #E8F5E9;

    --secondary: #D4AF37;
    /* Metallic Gold for accents/CTAs */
    --secondary-hover: #b8962e;

    --accent: #C19A6B;
    /* Camel/Leather color */

    --success: #27ae60;
    --danger: #c0392b;

    /* Neutrals & Backgrounds */
    --bg-body: #FDFBF7;
    /* Warm Cream/Off-white */
    --bg-surface: #FFFFFF;
    --bg-surface-alt: #F3F0E6;
    /* Slightly darker cream for cards/sections */

    --text-main: #1A1A1A;
    /* Near Black for readability */
    --text-muted: #5D5D5D;
    /* Dark Gray */
    --border: #DCD6CC;
    /* Warm Gray/Beige border */

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #2C5530 0%, #1e3b22 100%);
    --gradient-card: linear-gradient(180deg, #FFFFFF 0%, #FDFBF7 100%);
    --gradient-text: linear-gradient(135deg, #2C5530 0%, #D4AF37 100%);

    /* Shadows & Effects */
    --shadow-sm: 0 1px 3px rgba(44, 85, 48, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(44, 85, 48, 0.1), 0 2px 4px -1px rgba(44, 85, 48, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(44, 85, 48, 0.1), 0 4px 6px -2px rgba(44, 85, 48, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(44, 85, 48, 0.15), 0 10px 10px -5px rgba(44, 85, 48, 0.04);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --glass: rgba(253, 251, 247, 0.85);
    --glass-border: rgba(253, 251, 247, 0.5);
    --blur: blur(12px);

    /* Animation */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    direction: rtl;
    overflow-x: hidden;
}

/* Fix font inheritance for form elements */
button,
input,
textarea,
select {
    font-family: inherit;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-main);
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Layout Containers */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Nav - Glassmorphism */
.shop-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
}

.shop-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
}

.shop-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.shop-logo {
    font-size: 1.8rem;
    font-weight: 900;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shop-logo-image {
    height: 48px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Search Bar */
.shop-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.shop-search input {
    width: 100%;
    padding: 0.8rem 1.5rem;
    padding-left: 3.5rem;
    /* Space for button on left */
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-body);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.shop-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.shop-search button {
    position: absolute;
    left: 4px;
    top: 4px;
    bottom: 4px;
    width: 3rem;
    border: none;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.shop-search button:hover {
    background: var(--primary-dark);
}

/* Nav Links */
.shop-nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Dropdowns should work on touch devices too */
.dropdown:focus-within .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
}

.nav-link:hover {
    color: var(--primary);
}

.cart-icon {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: var(--radius-full);
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.cart-icon:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--secondary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.wishlist-icon {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: var(--radius-full);
    background: #fef2f2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.wishlist-icon:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
}

/* Hero Section */
.hero-modern {
    position: relative;
    padding: 6rem 0;
    background: var(--gradient-hero);
    overflow: hidden;
    color: white;
    text-align: center;
    margin-bottom: 4rem;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.hero-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 30%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    background: white;
    color: var(--primary-dark);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.btn-action {
    background: var(--primary);
    color: white;
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-md);
}

.btn-action:hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.4);
    transform: translateY(-2px);
}

/* Section Styling */
.section {
    padding: 2rem 0;
    margin-bottom: 4rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--secondary);
    border-radius: var(--radius-full);
    margin: 0.5rem auto 0;
}

/* Category Grid - Horizontal Scroll */
/* Category Grid - Horizontal Scroll */
/* Category Grid - Horizontal Scroll */
.category-wrapper {
    position: relative;
    /* Wrapper to hold buttons */
}

.category-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1.5rem;
    padding-bottom: 2rem;
    padding-top: 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    /* Hide scrollbar for clean UI */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-grid::-webkit-scrollbar {
    display: none;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    opacity: 0.9;
}

.scroll-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
    box-shadow: var(--shadow-lg);
}

.scroll-btn.next {
    right: -20px;
}

.scroll-btn.prev {
    left: -20px;
}

.category-card {
    min-width: 200px;
    flex: 0 0 auto;
    scroll-snap-align: center;
    /* Center is often safer for RTL/LTR mix */
    background: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: var(--transition);
}

.category-card:hover .category-icon {
    background: var(--primary);
    color: white;
    transform: rotate(-5deg) scale(1.1);
}

/* Book Grid & Cards - Robust Uniform Height Layout */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
    /* Force all cards to same height per row */
}

@media (min-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.75rem;
    }
}

@media (min-width: 1024px) {
    .books-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    .books-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.book-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    /* Ensures card fills grid cell */
    width: 100%;
    max-width: 320px;
    margin-inline: auto;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

/* Image wrapper now uses aspect-ratio for consistent sizing */
.book-image-wrapper {
    position: relative;
    aspect-ratio: 2/3;
    /* Modern CSS: ensures all images have same ratio */
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--bg-surface-alt) 100%);
    overflow: hidden;
    flex-shrink: 0;
    /* Prevents image from shrinking */
}

/* Fallback for older browsers without aspect-ratio support */
@supports not (aspect-ratio: 2/3) {
    .book-image-wrapper {
        padding-top: 150%;
        /* 3:2 ratio fallback */
    }

    .book-image-wrapper>* {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

.book-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.book-card:hover .book-image {
    transform: scale(1.08);
}

/* Book content uses flex-grow to push footer to bottom */
.book-content,
.book-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Expands to fill remaining card space */
}

.book-category {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Title with fixed min-height for consistent alignment across cards */
.book-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    min-height: 2.8rem;
    /* Reserves space for 2 lines */
    margin-bottom: 0.5rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.book-card:hover .book-title {
    color: var(--primary);
}

.book-author {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: auto;
    /* Pushes author up, creates space before footer */
}

/* Footer is pushed to bottom by flex-grow on content area */
.book-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
}

.book-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--secondary);
}

.book-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Favorite button styling */
.favorite-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    transform: scale(1.15);
    background: #fef2f2;
}

.favorite-btn i {
    color: #ef4444;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.favorite-btn:hover i {
    color: #dc2626;
}

.favorite-btn.active i {
    font-weight: 900;
}

/* Badge */
.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.badge.new {
    background: var(--success);
}

.badge.sale {
    background: var(--danger);
}

/* Footer - Modern Branded Design */
.shop-footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-dark) 100%);
    color: #fff;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.shop-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    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='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M30 30c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10-10-4.477-10-10zm0 0c0 5.523-4.477 10-10 10S10 35.523 10 30s4.477-10 10-10 10 4.477 10 10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Wave Effect */
.footer-wave {
    color: var(--primary-dark);
    line-height: 0;
    margin-bottom: -1px;
}

.footer-wave svg {
    width: 100%;
    height: 60px;
}

/* Footer Main */
.footer-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 3rem 0;
    position: relative;
    z-index: 1;
}

@media (min-width: 992px) {
    .footer-main {
        grid-template-columns: 300px 1fr;
        gap: 4rem;
    }
}

/* Brand Section */
.footer-brand {
    text-align: center;
}

@media (min-width: 992px) {
    .footer-brand {
        text-align: right;
        border-left: 1px solid rgba(255, 255, 255, 0.15);
        padding-left: 2rem;
    }
}

.footer-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1rem;
    border: 3px solid var(--secondary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@media (min-width: 992px) {
    .footer-logo {
        margin: 0 0 1rem auto;
    }
}

.footer-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer-brand-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fff 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Social Links */
.footer-social {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

@media (min-width: 992px) {
    .footer-social {
        justify-content: flex-end;
    }
}

.social-link {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
    background: var(--secondary);
    color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* Footer Links Grid */
.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (min-width: 768px) {
    .footer-links-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Footer Section */
.footer-section {
    text-align: right;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.title-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--secondary) 0%, #f0d78c 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 0.85rem;
}

/* Footer Lists */
.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    margin-bottom: 0.6rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 0.25rem 0;
}

.footer-link i {
    font-size: 0.65rem;
    transition: transform 0.3s ease;
}

.footer-link:hover {
    color: var(--secondary);
}

.footer-link:hover i {
    transform: translateX(-4px);
}

/* Contact Info */
.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    margin-bottom: 1rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.contact-item:hover {
    color: var(--secondary);
}

.contact-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1.5rem 0;
    position: relative;
    z-index: 1;
}

.footer-bottom-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.footer-bottom-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-bottom-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
    color: var(--secondary);
}

.footer-bottom-links .divider {
    color: rgba(255, 255, 255, 0.3);
}

/* Utilities */
.text-center {
    text-align: center;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .container {
        padding: 0 1rem;
    }

    .shop-header {
        padding: 0.75rem 0;
    }

    /* Keep header compact and avoid overflow */
    .shop-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: center;
    }

    .shop-logo {
        order: 1;
        flex: 1 1 auto;
    }

    .shop-logo-image {
        height: 42px;
    }

    .shop-nav-links {
        order: 2;
        flex: 0 0 auto;
        gap: 0.5rem;
    }

    .shop-search {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
    }

    .shop-menu {
        order: 4;
        flex: 1 1 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem !important;
    }

    .nav-link {
        font-size: 0.95rem;
    }

    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .shop-logo-image {
        height: 38px;
    }

    .shop-search input {
        padding: 0.7rem 1.1rem;
        padding-left: 3.2rem;
        font-size: 0.9rem;
    }

    .search-btn-text {
        display: none;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }
}

/* Cart Page Styles - ADDED */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    margin-top: 2rem;
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cart-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
}

.cart-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.cart-item-image {
    width: 100px;
    height: 140px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    display: block;
}

.cart-item-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cart-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    flex-wrap: wrap;
    gap: 1rem;
}

.quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-body);
    padding: 0.25rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.qty-btn:hover {
    background: var(--primary);
    color: white;
}

.qty-input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-main);
}

.qty-input:focus {
    outline: none;
}

.item-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.btn-remove {
    color: var(--danger);
    background: #fef2f2;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-remove:hover {
    background: var(--danger);
    color: white;
}

/* Order Summary */
.cart-summary {
    position: sticky;
    top: 100px;
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    height: fit-content;
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.summary-row.total {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px dashed var(--border);
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.25rem;
}

.summary-row.total span:last-child {
    color: var(--primary);
    font-size: 1.75rem;
}

/* Empty Cart */
.empty-cart-state {
    text-align: center;
    padding: 6rem 2rem;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.empty-icon {
    font-size: 5rem;
    color: var(--primary-soft);
    margin-bottom: 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@media (max-width: 900px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 600px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-item-image {
        width: 100%;
        height: 200px;
    }

    .cart-controls {
        width: 100%;
        margin-top: 1rem;
    }
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-surface);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 0.5rem 0;
    z-index: 1001;
    border: 1px solid var(--border);
    top: 100%;
    right: 0;
    /* RTL alignment */
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content,
.dropdown.group:hover .dropdown-content {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: fadeIn 0.2s ease;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    color: var(--text-main);
    display: block;
    transition: var(--transition);
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: var(--primary-soft);
    color: var(--primary);
}

/* Additional Responsive Utilities */
@media (max-width: 1024px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 640px) {
    .hero-modern {
        padding: 3rem 0;
        margin-bottom: 2rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .section {
        padding: 1.5rem 0;
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .category-card {
        min-width: 160px;
        padding: 1.25rem;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Review Cards */
.review-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-card {
    background: var(--bg-surface-alt);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.review-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
}

.review-meta h4 {
    margin-bottom: 0.2rem;
    font-size: 1rem;
    color: var(--text-main);
}

.review-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.review-stars {
    margin-right: auto;
    color: var(--secondary);
}

.review-body {
    color: var(--text-muted);
    line-height: 1.6;
}