/* 
    The Cool School - Educational Products Storefront
    Focus: playful learning, premium binders, kits, and worksheets
*/

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary-yellow: #FACC15;
    --primary-blue: #2563EB;
    --primary-pink: #F472B6;
    --primary-mint: #14B8A6;
    --primary-orange: #FB923C;
    --primary-violet: #8B5CF6;
    
    --soft-yellow: #FFF9C4;
    --soft-blue: #E1F5FE;
    --soft-pink: #FCE4EC;
    --soft-mint: #E8F5E9;
    --soft-purple: #F3E5F5;
    
    --learning-phonics: #FACC15;
    --learning-math: #38BDF8;
    --learning-writing: #F472B6;
    --learning-brain: #8B5CF6;
    --learning-montessori: #14B8A6;
    --learning-kits: #FB923C;

    --text-dark: #2D3436;
    --text-muted: #636E72;
    --bg-light: #F8FAFC;
    --white: #FFFFFF;
    
    --radius-lg: 22px;
    --radius-md: 14px;
    --shadow-soft: 0 14px 35px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 20px 50px rgba(15, 23, 42, 0.14);
}

body {
    font-family: 'Nunito', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

img {
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

/* Navbar */
.navbar {
    background-color: var(--white);
    box-shadow: var(--shadow-soft);
    padding: 12px 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-blue) !important;
}

.navbar-logo {
    height: 58px;
    width: auto;
    object-fit: contain;
}

/* Mobile Toggle via Logo Styles */
@media (max-width: 991.98px) {
    .navbar-toggler {
        display: none !important; /* Hide default hamburger */
    }
    
    .navbar-brand {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    .navbar-brand:active {
        opacity: 0.7;
    }

    /* Ensure icons don't overlap on very small screens */
    .navbar .container {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
    }

    .navbar .d-flex.align-items-center {
        gap: 0.5rem !important;
    }

    .cart-icon {
        padding: 5px !important;
    }

    .navbar-collapse {
        background: white;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 1rem 2rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
        z-index: 1050;
    }
}

.footer-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.nav-link {
    font-weight: 600;
    margin: 0 10px;
    color: var(--text-dark) !important;
}

.nav-link:hover {
    color: var(--primary-blue) !important;
}

.nav-link.active {
    color: var(--primary-mint) !important;
}

.cart-icon {
    position: relative;
    padding: 10px;
}

.cart-badge, .wishlist-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--primary-pink);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

.wishlist-badge {
    background-color: var(--primary-blue);
}

/* Hero Section */
.hero-section {
    padding: 86px 0 78px;
    background:
        radial-gradient(circle at 12% 18%, rgba(250, 204, 21, 0.24), transparent 28%),
        radial-gradient(circle at 92% 12%, rgba(244, 114, 182, 0.18), transparent 30%),
        linear-gradient(135deg, #ECFEFF 0%, #FDF2F8 58%, #FFF7ED 100%);
    border-bottom-left-radius: 72px;
    border-bottom-right-radius: 72px;
}

.hero-title {
    font-size: clamp(2.3rem, 6vw, 4.1rem);
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--primary-mint);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 800;
    box-shadow: var(--shadow-soft);
    margin-bottom: 18px;
}

.hero-video-container {
    max-width: calc(100% + 50px);
    width: calc(100% + 50px);
    min-height: 510px;
    max-height: 710px;
    aspect-ratio: 4 / 5;
    margin-left: auto;
    margin-right: -50px;
    border-radius: 40px;
    overflow: hidden;
    box-shadow: var(--shadow-hover);
    background-color: #000;
}

.hero-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

@media (max-width: 991px) {
    .hero-video-container {
        max-width: 100%;
        width: 100%;
        min-height: 420px;
        max-height: 520px;
    }
}

.bg-soft-yellow { background-color: var(--soft-yellow); }
.bg-soft-blue { background-color: var(--soft-blue); }
.bg-soft-pink { background-color: var(--soft-pink); }
.bg-soft-mint { background-color: var(--soft-mint); }
.bg-soft-purple { background-color: var(--soft-purple); }
.text-primary-blue { color: var(--primary-blue); }
.text-primary-pink { color: var(--primary-pink); }
.bg-primary-blue { background-color: var(--primary-blue); }
.bg-primary-pink { background-color: var(--primary-pink); }
.text-primary-mint { color: var(--primary-mint); }
.bg-primary-mint { background-color: var(--primary-mint); }
.text-primary-orange { color: var(--primary-orange); }

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-mint), var(--primary-blue));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: var(--radius-lg);
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #0F766E, #1D4ED8);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    color: white;
}

.btn-outline-secondary-custom {
    border: 2px solid rgba(37, 99, 235, 0.18);
    background: #fff;
    color: var(--text-dark);
    padding: 12px 30px;
    border-radius: var(--radius-lg);
    font-weight: 800;
}

.btn-outline-secondary-custom:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.65rem);
    letter-spacing: 0;
}

.section-eyebrow {
    color: var(--primary-mint);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Category Cards */
.category-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    box-shadow: var(--shadow-soft);
    cursor: default;
    text-decoration: none;
    display: block;
    height: 100%;
    color: var(--text-dark);
}

.category-card:hover {
    transform: none;
    box-shadow: var(--shadow-soft);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Product Cards */
.product-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
    height: calc(100% - 30px);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/5;
    background: linear-gradient(135deg, #F8FAFC, #EEF2FF);
}

.product-card-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.wishlist-btn {
    background: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-pink);
    box-shadow: var(--shadow-soft);
    z-index: 10;
    transition: all 0.3s ease;
}

.card-action-btn {
    text-decoration: none;
}

.cart-btn {
    background: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    box-shadow: var(--shadow-soft);
    z-index: 10;
    transition: all 0.3s ease;
}

.wishlist-btn:hover {
    transform: scale(1.1);
    color: #e91e63;
}

.cart-btn:hover {
    transform: scale(1.1);
    color: #2563eb;
}

.product-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.16);
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    color: #1e3a8a;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.12);
    transition: all 0.25s ease;
}

.product-view-btn:hover {
    background: linear-gradient(135deg, #dbeafe, #e0e7ff);
    color: #172554;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.18);
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.product-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    background: #F1F5F9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 5px 10px;
}

.product-card:hover .product-img {
    transform: scale(1.1);
}

.emotion-badge,
.learning-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

.badge-happy, .badge-phonics { background-color: var(--learning-phonics); color: #5D4037; }
.badge-sad, .badge-math { background-color: var(--learning-math); }
.badge-brave, .badge-montessori { background-color: var(--learning-montessori); }
.badge-shy, .badge-brain { background-color: var(--learning-brain); }
.badge-comfortable, .badge-writing { background-color: var(--learning-writing); }
.badge-food, .badge-kit { background-color: var(--learning-kits); }

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
    min-height: 2.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-weight: 800;
    color: var(--primary-pink);
    font-size: 1.2rem;
}

/* Footer */
footer {
    background-color: var(--white);
    padding: 80px 0 30px;
    border-top-left-radius: 100px;
    border-top-right-radius: 100px;
    margin-top: 100px;
}

.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.12);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}

.mobile-bottom-nav a {
    color: #475569;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.72rem;
    font-weight: 800;
}

.mobile-bottom-nav i {
    font-size: 1.25rem;
    color: var(--primary-mint);
}

.feature-tile,
.stat-tile,
.testimonial-card,
.policy-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.feature-icon {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--soft-blue);
    color: var(--primary-blue);
    font-size: 1.55rem;
}

.age-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 26px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.14);
    height: 100%;
    text-decoration: none;
    color: var(--text-dark);
    display: block;
    cursor: default;
}

.age-card:hover {
    transform: none;
    box-shadow: var(--shadow-soft);
}

.skeleton-line {
    overflow: hidden;
    position: relative;
    background: #E2E8F0;
    border-radius: 999px;
}

.skeleton-line::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.75), transparent);
    animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* Cart Sidebar / Toast */
.toast-container {
    z-index: 1060;
}

.cart-item-img {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-section {
        padding: 60px 0;
        border-bottom-left-radius: 36px;
        border-bottom-right-radius: 36px;
    }
    body { padding-bottom: 72px; }
    footer { border-top-left-radius: 42px; border-top-right-radius: 42px; }
    .product-title { min-height: auto; }
}

/* Testimonials */
.testimonial-text {
    font-style: italic;
    line-height: 1.8;
    max-height: 200px;
    overflow-y: auto;
    padding: 0 15px;
}

/* Custom scrollbar for long testimonials */
.testimonial-text::-webkit-scrollbar {
    width: 4px;
}
.testimonial-text::-webkit-scrollbar-track {
    background: transparent;
}
.testimonial-text::-webkit-scrollbar-thumb {
    background: var(--primary-pink);
    border-radius: 10px;
    opacity: 0.3;
}

.testimonial-avatar-wrapper {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}

.testimonial-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 3px solid #fff;
}

/* Instagram Reels */
.stories-slider {
    position: relative;
    padding: 0 3.5rem;
    margin-bottom: 1.5rem;
}

.stories-viewport {
    overflow: hidden;
}

.stories-track {
    display: flex;
    gap: 1.5rem;
    will-change: transform;
}

.stories-slide {
    flex: 0 0 calc((100% - 4.5rem) / 4);
    min-width: 0;
}

.stories-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #233044;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    z-index: 2;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.stories-prev {
    left: 0;
}

.stories-next {
    right: 0;
}

.stories-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.stories-nav:disabled {
    opacity: 0.45;
    cursor: default;
    transform: translateY(-50%);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.stories-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.stories-dot {
    width: 0.65rem;
    height: 0.65rem;
    border: 0;
    border-radius: 999px;
    background: rgba(35, 48, 68, 0.22);
    padding: 0;
    transition: all 0.25s ease;
}

.stories-dot:hover {
    background: rgba(91, 108, 255, 0.55);
}

.stories-dot.active {
    width: 1.9rem;
    background: #5b6cff;
}

.reel-card {
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #f8f9fa;
    min-height: 300px;
}

.reel-thumbnail-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    min-height: 300px;
    background-color: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reel-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.reel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    opacity: 1; /* Always show the play icon for better UX */
    transition: all 0.3s ease;
}

.reel-card:hover .reel-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.reel-card:hover .reel-thumb {
    transform: scale(1.05);
}

.reel-caption {
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1199.98px) {
    .stories-slide {
        flex-basis: calc((100% - 3rem) / 3);
    }
}

@media (max-width: 767.98px) {
    .stories-slider {
        padding: 0 2.75rem;
        margin-bottom: 1.2rem;
    }

    .stories-track {
        gap: 1rem;
    }

    .stories-slide {
        flex-basis: calc((100% - 1rem) / 2);
    }

    .reel-card,
    .reel-thumbnail-container {
        min-height: 260px;
    }
}

@media (max-width: 575.98px) {
    .stories-slider {
        padding: 0 2.25rem;
        margin-bottom: 1rem;
    }

    .stories-slide {
        flex-basis: 100%;
    }

    .stories-nav {
        width: 2.35rem;
        height: 2.35rem;
    }

    .reel-card,
    .reel-thumbnail-container {
        min-height: 320px;
    }
}

.bg-white {
    background: var(--glass-bg-strong) !important;
    border: 1px solid var(--glass-border);
}

.shadow-sm {
    box-shadow: 0 18px 70px rgba(0,0,0,0.35) !important;
}

.border-bottom {
    border-bottom-color: rgba(255,255,255,0.08) !important;
}

hr,
.opacity-25 {
    border-color: rgba(255,255,255,0.12) !important;
}

.breadcrumb {
    margin-bottom: 0;
}

.breadcrumb-item,
.breadcrumb-item a {
    color: rgba(148,163,184,0.95) !important;
}

.breadcrumb-item.active {
    color: rgba(229,231,235,0.92) !important;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(148,163,184,0.65) !important;
}

.form-control,
.form-select {
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    color: rgba(229,231,235,0.92) !important;
    box-shadow: none !important;
}

.form-control::placeholder {
    color: rgba(148,163,184,0.70) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(34,211,238,0.45) !important;
    box-shadow: 0 0 0 0.2rem rgba(34,211,238,0.12) !important;
}

.btn-outline-primary {
    border: 1px solid rgba(255,255,255,0.14) !important;
    background: rgba(255,255,255,0.04) !important;
    color: rgba(229,231,235,0.92) !important;
    font-weight: 800;
}

.btn-outline-primary:hover {
    border-color: rgba(34,211,238,0.45) !important;
    color: rgba(229,231,235,0.96) !important;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(34,211,238,1), rgba(167,139,250,1)) !important;
    color: #06101a !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    font-weight: 900;
}

.nav-pills .nav-link {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.10);
    color: rgba(229,231,235,0.86);
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, rgba(34,211,238,0.18), rgba(167,139,250,0.18));
    border-color: rgba(34,211,238,0.22);
    color: rgba(229,231,235,0.96);
}

.feature-tile,
.stat-tile,
.testimonial-card,
.policy-card {
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    box-shadow: 0 26px 90px rgba(0,0,0,0.35) !important;
}

.product-chip {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(229,231,235,0.78);
}

.wishlist-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    color: rgba(244,114,182,0.95);
}

.cart-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    color: rgba(96,165,250,0.95);
}

.wishlist-btn:hover {
    color: rgba(253,224,71,0.95);
}

.cart-btn:hover {
    color: rgba(196,181,253,0.95);
}

.product-view-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 48px;
    padding: 0.95rem 1rem !important;
    border: 1px solid rgba(96,165,250,0.55) !important;
    background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    box-shadow: 0 20px 38px rgba(15,23,42,0.32);
}

.product-view-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #6d28d9) !important;
    color: #ffffff !important;
    border-color: rgba(191,219,254,0.75) !important;
}

.product-view-btn i,
.product-view-btn span {
    color: inherit !important;
}

.toast {
    background: rgba(7, 10, 18, 0.82);
    border: 1px solid rgba(255,255,255,0.10);
    color: rgba(229,231,235,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.toast .toast-header {
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: rgba(229,231,235,0.92);
}
