/* === VIBRANT COLORFUL BOOKSTORE DESIGN === */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Playfair+Display:wght@600;700;800&display=swap');

/* === CSS VARIABLES === */
:root {
    /* Grey and Maroon Color Palette */
    --primary-maroon: #800020;
    --dark-maroon: #5C0016;
    --light-maroon: #C4909E;

    --primary-grey: #6B7280;
    --dark-grey: #4B5563;
    --light-grey: #D1D5DB;

    --accent-grey: #9CA3AF;
    --warm-grey: #8B8680;
    --light-warm-grey: #E5E3DF;

    --bg-cream: #FAF9F7;
    --bg-light: #FFFFFF;
    --bg-accent: #F3F2F0;
    --pattern-dots: radial-gradient(circle, rgba(128, 0, 32, 0.05) 1px, transparent 1px);

    --dark-text: #1F2937;
    --medium-text: #6B7280;
    --light-text: #9CA3AF;

    /* Borders & Shadows */
    --border-color: #E0E0E0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-color: 0 4px 12px rgba(128, 0, 32, 0.3);

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Poppins', sans-serif;

    /* Spacing */
    --radius-sm: 10px;
    --radius-md: 15px;
    --radius-lg: 20px;
}

/* === BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-light) 100%);
    background-image: var(--pattern-dots);
    background-size: 20px 20px;
    color: var(--dark-text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === HEADER === */
.header-top {
    background: linear-gradient(135deg, var(--primary-maroon), var(--dark-maroon));
    color: white;
    padding: 0.875rem 0;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.header-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.header-main {
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 4px solid;
    border-image: linear-gradient(90deg, var(--primary-maroon), var(--primary-grey), var(--dark-grey)) 1;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-maroon), var(--primary-grey));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s;
}

.logo:hover {
    transform: translateY(-2px);
}

.logo-icon {
    font-size: 1.8rem;
    filter: drop-shadow(2px 2px 4px rgba(128, 0, 32, 0.3));
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.95rem;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-maroon);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-maroon);
    transition: width 0.3s;
}

.nav-menu a:hover::after {
    width: 100%;
}

.cart-icon {
    position: relative;
    font-size: 1.1rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--primary-maroon), var(--dark-maroon));
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.cart-icon:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-grey);
    color: var(--dark-text);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    border: 2px solid white;
}

/* === SEARCH BAR === */
.search-section {
    background: linear-gradient(135deg, var(--primary-maroon) 0%, var(--dark-maroon) 100%);
    padding: 2rem 0;
    box-shadow: var(--shadow-md);
}

.search-bar {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    background: white;
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-family: var(--font-body);
    background: transparent;
}

.search-bar input:focus {
    outline: none;
}

.search-bar button {
    background: linear-gradient(135deg, var(--primary-grey), var(--dark-grey));
    color: white;
    border: none;
    padding: 0.875rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.search-bar button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* === SECTIONS === */
.section {
    padding: 3rem 0;
}

.section-colored {
    background: linear-gradient(135deg, var(--light-maroon) 0%, var(--light-warm-grey) 100%);
    padding: 4rem 0;
}

/* === TYPOGRAPHY === */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--dark-text);
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-size: 3rem;
    line-height: 1.2;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.6rem;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--medium-text);
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 1rem 2.25rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-maroon), var(--dark-maroon));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary-grey), var(--dark-grey));
    color: white;
}

.btn-orange {
    background: linear-gradient(135deg, var(--primary-maroon), var(--dark-maroon));
    color: white;
}

.btn-outline {
    background: transparent;
    border: 3px solid var(--primary-maroon);
    color: var(--primary-maroon);
}

.btn-outline:hover {
    background: var(--primary-maroon);
    color: white;
}

.btn-small {
    padding: 0.625rem 1.5rem;
    font-size: 0.9rem;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* === FILTER PILLS === */
.filter-pills {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-pill {
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    background: white;
    border: 2px solid var(--border-color);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--dark-text);
}

.filter-pill:hover,
.filter-pill.active {
    background: linear-gradient(135deg, var(--primary-maroon), var(--dark-maroon));
    color: white;
    border-color: var(--primary-maroon);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* === CARDS === */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    border: 2px solid transparent;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
    border-color: var(--primary-maroon);
}

/* === PRODUCT CARDS === */
.product-card {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-image-wrapper {
    position: relative;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    cursor: pointer;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    height: 550px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}

.product-image {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    transition: transform 0.3s;
    display: block;
    margin: 0 auto;
}

.product-image-wrapper:hover .product-image {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--accent-grey), var(--warm-grey));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    color: var(--dark-text);
}

.product-title a {
    color: var(--dark-text);
    text-decoration: none;
    transition: color 0.3s;
}

.product-title a:hover {
    color: var(--primary-maroon);
}

.product-author {
    color: var(--medium-text);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.product-price {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary-maroon), var(--primary-grey));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    margin: auto 0 1rem 0;
}

/* === GRID === MOBILE FIRST === */
.grid {
    display: grid;
    gap: 1.5rem;
}

/* Mobile: All grids are single column */
.grid-2,
.grid-3,
.grid-4 {
    grid-template-columns: 1fr;
}

/* Tablet: 2 columns */
@media (min-width: 640px) {
    .grid {
        gap: 2rem;
    }

    .grid-2,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: Full columns */
@media (min-width: 992px) {
    .grid {
        gap: 2.5rem;
    }

    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* === FORMS === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-text);
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-maroon);
    box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.1);
}

/* === ALERTS === */
.alert {
    padding: 1.25rem 1.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 600;
    border-left: 4px solid;
}

.alert-success {
    background: #D4EDDA;
    color: #155724;
    border-color: var(--primary-maroon);
}

.alert-error {
    background: #F8D7DA;
    color: #721C24;
    border-color: #dc3545;
}

.alert-info {
    background: #D1ECF1;
    color: #0C5460;
    border-color: #17a2b8;
}

/* === TABLE === */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead {
    background: linear-gradient(135deg, var(--primary-maroon), var(--dark-maroon));
    color: white;
}

.table th {
    padding: 1.25rem;
    text-align: left;
    font-weight: 700;
}

.table td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: var(--bg-cream);
}

/* === FOOTER === */
.footer {
    background: linear-gradient(135deg, var(--dark-text), #1a252f);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--light-warm-grey);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.625rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--light-grey);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* === UTILITY CLASSES === */
.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.flex {
    display: flex;
}

.flex-between {
    justify-content: space-between;
}

.flex-center {
    justify-content: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-toggle span {
    width: 28px;
    height: 3px;
    background: var(--primary-maroon);
    border-radius: 2px;
    transition: 0.3s;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1.5rem;
        box-shadow: var(--shadow-md);
        gap: 1rem;
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-toggle {
        display: flex;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .product-image {
        height: 320px;
    }

    .search-bar {
        flex-direction: column;
        border-radius: var(--radius-md);
    }

    .search-bar button {
        border-radius: var(--radius-md);
    }
}