@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600&family=Urbanist:wght@500;600;700&display=swap');

/* Page Container Layout */
.categories-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 100px 20px 60px;
}

@media (max-width: 1023px) {
    .categories-container {
        padding-top: 20px;
        padding-right: 85px;
        /* Space for Mobile Railing Nav */
    }

    .left-handed-mode .categories-container {
        padding-right: 16px !important;
        padding-left: 85px !important;
    }
}

/* Hero Feature Banner */
.category-hero-banner {
    width: 100%;
    height: 280px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.category-hero-banner picture,
.category-hero-banner a {
    display: block;
    width: 100%;
    height: 100%;
}

.category-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .category-hero-banner {
        height: 140px;
        border-radius: 14px;
    }
}

/* Category Search Bar */
.category-search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    background: rgba(35, 44, 69, 0.4);
    border: 1px solid rgba(92, 98, 131, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 0 20px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.category-search-box img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    opacity: 0.7;
}

.category-search-box input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-family: 'Urbanist', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.category-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Horizontal Filter Deck Chips */
.category-filter-deck {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 24px;
    scrollbar-width: none;
}

.category-filter-deck::-webkit-scrollbar {
    display: none;
}

.deck-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    height: 38px;
    background: rgba(35, 41, 66, 0.6);
    border-radius: 20px;
    color: #A0A5B5;
    font-family: 'Urbanist', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid rgba(92, 98, 131, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.deck-chip.active,
.deck-chip:hover {
    background: #FFEABD;
    color: #141E3A;
    font-weight: 600;
    border-color: #FFEABD;
}

/* Category Cards Grid Base (Desktop: 4 columns) */
.category-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.category-card-item {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
}

.category-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.category-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.category-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 14, 25, 0.2) 0%, rgba(10, 14, 25, 0.85) 100%);
    z-index: 2;
}

.category-card-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.category-tag-sub {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: #A0A5B5;
    text-transform: uppercase;
}

.category-title {
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 22px;
    margin-bottom: 4px;
}

.category-explore-link {
    font-size: 12px;
    font-weight: 600;
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
}

/* Badge on Header Cart */
.cart-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #FFEABD;
    color: #0A0E19;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Grid: Tablet & Mobile are strictly 2 columns */
@media (max-width: 1100px) {
    .category-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .category-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .category-card-item {
        height: 155px;
        padding: 12px 10px;
        border-radius: 14px;
    }

    .category-title {
        font-size: 13.5px;
        line-height: 16px;
        margin-bottom: 2px;
    }

    .category-tag-sub {
        font-size: 9px;
    }

    .category-explore-link {
        font-size: 10.5px;
    }
}

/* ==========================================================================
   CATEGORY PRODUCTS LISTING SECTION & GRID
   ========================================================================== */
.category-products-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.category-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.category-products-heading {
    font-family: 'Urbanist', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
    line-height: 1.2;
}

.category-products-count {
    font-family: 'Urbanist', sans-serif;
    font-size: 14px;
    color: #94A3B8;
    font-weight: 500;
    margin-top: 4px;
    display: block;
}

/* Category Products Grid (Mobile 2 cols, Tablet 3 cols, Desktop 4 cols) */
.category-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

@media (min-width: 768px) {
    .category-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .category-products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Trending & Custom Badges on Category Product Cards (Matches PDP .trending-pill) */
.product-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(90deg, #E9D0B3 0%, #C5955D 100%);
    color: #0A0E19;
    border-radius: 53px;
    font-family: 'Urbanist', 'Manrope', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 12px rgba(197, 149, 93, 0.25);
    z-index: 2;
    border: none;
}

/* Empty State */
.empty-products-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: rgba(20, 30, 58, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    margin: 10px 0;
}

.empty-products-state .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.empty-products-state h3 {
    font-family: 'Urbanist', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 8px 0;
}

.empty-products-state p {
    font-family: 'Urbanist', sans-serif;
    font-size: 14px;
    color: #94A3B8;
    margin: 0 0 20px 0;
}

.empty-products-state .btn-explore-all {
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    border-radius: 20px;
    padding: 10px 24px;
    font-family: 'Urbanist', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.empty-products-state .btn-explore-all:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
}