/* ==========================================================================
   SHOP PAGE - MASTERPIECE EDITION (ULTRA-PREMIUM)
   - Dynamic Glassmorphism (blur-25px)
   - Electric Neon Accents
   - Motion-driven Hover Effects
   - Luxury Typography
   ========================================================================== */

:root {
    --master-accent: #3b82f6;
    --master-accent-glow: rgba(59, 130, 246, 0.4);
    --master-bg: #0a0a0a;
    --master-card-bg: rgba(255, 255, 255, 0.03);
    --master-glass-border: rgba(255, 255, 255, 0.08);
    --master-neon: #fff;
}

.shop-hero .courses-hero-paragraph {
    font-family: 'Tenor Sans', sans-serif;
    font-size: clamp(1.15rem, 1.5vw, 1.35rem);
    /* Matched to courses.css */
    line-height: 1.7;
    color: #ffffff;
    opacity: 0.9;
    margin: 0 auto;
    max-width: 800px;
}

.shop-page {
    position: relative;
    background-color: #222222;
    color: #fff;
    min-height: 100vh;
    padding-bottom: 8rem;
    overflow-x: hidden;
    font-family: 'Tenor Sans', sans-serif;
    z-index: 1;
}

.shop-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(34, 34, 34, 0.25) 0%, rgba(34, 34, 34, 0.5) 100%),
        url('../bg/test.webp');
    background-size: cover;
    background-position: center;
    z-index: -1;
    pointer-events: none;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
}

@media (max-width: 768px) {
    .shop-page::before {
        position: fixed;
        height: 100vh;
    }
}

/* Force remove the global header gap for shop page */
body.page-inner main.flex-shrink-0 {
    padding-top: 0 !important;
}

/* --- Subtitle & Paragraph (copied from courses.css) --- */
.courses-subtitle {
    margin: 0 0 clamp(1rem, 2vw, 1.5rem);
    font-family: 'Archivo', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #3b82f6;
    display: block;
}

.courses-hero-paragraph {
    font-family: 'Tenor Sans', sans-serif;
    font-size: clamp(1.15rem, 1.5vw, 1.35rem);
    line-height: 1.7;
    color: #ffffff;
    margin: 0;
    max-width: 750px;
    width: 100%;
    font-weight: 400;
}

/* --- Master Hero --- */
.shop-hero {
    padding: clamp(6rem, 15vw, 12rem) 0 clamp(4rem, 10vw, 6rem);
    text-align: center;
    position: relative;
}

.shop-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--master-accent), transparent);
}

.shop-title-main {
    font-family: 'Archivo', sans-serif;
    font-size: 65px;
    /* Hardcoded to match .courses-title exactly */
    font-weight: 500;
    line-height: 1.17;
    letter-spacing: 0.02em;
    text-transform: none;
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.4) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 1.25rem;
    /* Matched to .courses-title margin */
}

/* --- Filter & Search (EXACT courses.css copy) --- */
.courses-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
}

/* --- Filter & Search --- */
.courses-filter-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
    border-top: 1px solid #616161;
    gap: 2rem;
}

.courses-filter {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1001;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.filter-label {
    font-family: 'Archivo', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.4);
}

.courses-search {
    flex-grow: 1;
    max-width: 450px;
    position: relative;
    z-index: 10;
}

.custom-dropdown {
    position: relative;
    min-width: 260px;
    font-family: 'Archivo', sans-serif;
    z-index: 1001;
}

.dropdown-trigger {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.85rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    width: 100%;
    outline: none;
}

.dropdown-trigger * {
    pointer-events: none;
}

.dropdown-trigger:hover {
    border-color: var(--master-accent);
    background: rgba(255, 255, 255, 0.08);
}

.custom-dropdown.is-open .dropdown-trigger {
    border-color: var(--master-accent);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 100%;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.75rem;
    margin: 0;
    list-style: none;
    display: none;
    transform: translateY(-10px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    max-height: 350px;
    overflow-y: auto;
    z-index: 2000;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.dropdown-menu::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.custom-dropdown.is-open .dropdown-menu {
    display: block;
    transform: translateY(0);
}

.dropdown-item {
    padding: 0.85rem 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.dropdown-item:last-child {
    margin-bottom: 0;
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--master-accent);
    padding-left: 1.5rem;
}

.dropdown-item.is-active {
    background: var(--master-accent);
    color: #fff;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.85rem 3.5rem 0.85rem 1.5rem;
    color: #fff;
    font-family: 'Archivo', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-field:focus {
    outline: none;
    border-color: var(--master-accent);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.search-btn {
    position: absolute;
    right: 5px;
    background: var(--master-accent);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    box-sizing: border-box !important;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: scale(1.1);
    background: #2563eb;
}

@media (max-width: 768px) {
    .courses-filter-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        padding: 2rem 0;
    }

    .courses-search {
        max-width: 100%;
    }
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1100px) {
    .shop-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

.product-card {
    position: relative;
    background: rgba(34, 34, 34, 0.45);
    border: 1px solid #616161;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.product-card-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
}

.product-thumb {
    position: relative;
    aspect-ratio: 3/2;
    /* Shorter image for density */
    overflow: hidden;
    border-radius: 20px;
    margin: 0.75rem 0.75rem 0 0.75rem;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-discount {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    background: #e11d48;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.45rem 0.9rem;
    letter-spacing: 0.06em;
    border-radius: 0 8px 0 8px;
}

/* --- Info Section --- */
.product-info {
    padding: 1.25rem;
    /* Reduced for density */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-family: 'Archivo', sans-serif;
    font-size: 1.25rem;
    /* Smaller for density */
    font-weight: 600;
    margin-bottom: 0.4rem;
    line-height: 1.2;
    color: #f1f1f1;
}

.product-description {
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.3em;
}

/* --- Star Rating --- */
.product-rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.product-stars {
    display: flex;
    align-items: center;
    gap: 3px;
}

.product-stars i {
    color: #facc15;
    font-size: 0.85rem;
}

.product-stars .bi-star {
    color: rgba(255, 255, 255, 0.15);
}

.rating-value {
    font-family: 'Archivo', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-left: 8px;
}

.review-count {
    font-family: 'Archivo', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.product-price-stock-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-shrink: 1;
}

.price-current {
    font-size: 1.2rem;
    /* Compact desktop price */
    font-weight: 800;
    font-family: 'Archivo', sans-serif;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.price-original {
    font-size: 0.85rem;
    color: #ef4444;
    text-decoration: line-through;
    font-weight: 600;
    opacity: 0.6;
}

/* --- Stock Indicator --- */
.stock-indicator {
    font-family: 'Archivo', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    color: rgba(255, 255, 255, 0.7);
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.stock-indicator.is-low {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.product-actions {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #616161;
}

.add-to-cart-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}

.add-to-cart-btn:hover {
    background: #fff;
    color: #000;
}

.buy-now-btn {
    background: var(--master-accent);
    color: #fff;
    padding: 10px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.buy-now-btn:hover {
    background: #2563eb;
    color: #fff;
}

/* }

/* --- Related to Grid/Filters below --- */
@media (max-width: 991px) {
    .courses-container {
        padding: 0 0.75rem;
    }

    .shop-grid {
        gap: 0.6rem;
    }

    .product-card {
        border-radius: 15px;
    }

    .product-thumb {
        border-radius: 12px;
        margin: 0.4rem 0.4rem 0 0.4rem;
        aspect-ratio: 16/10;
    }

    .product-info {
        padding: 0.6rem 0.5rem;
    }

    .product-title {
        font-size: 0.95rem;
        margin-bottom: 0.2rem;
    }

    .product-description {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
        -webkit-line-clamp: 3;
        min-height: 3.9em;
    }

    .product-rating-row {
        margin-bottom: 0.4rem;
    }

    .product-stars i,
    .rating-value,
    .review-count {
        font-size: 0.6rem;
    }

    .product-price-stock-row {
        margin-bottom: 0.65rem;
        gap: 0.2rem;
    }

    .price-current {
        font-size: 0.95rem;
    }

    .stock-indicator {
        font-size: 0.5rem;
        padding: 0.1rem 0.35rem;
    }

    .product-actions {
        padding-top: 0.5rem;
        gap: 4px;
    }

    .add-to-cart-btn,
    .buy-now-btn {
        padding: 6px 4px;
        font-size: 0.65rem;
        border-radius: 8px;
    }

    .product-discount {
        font-size: 0.55rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0 6px 0 6px;
    }
}
