:root {
    --yellow:       #FFD600;
    --yellow-light: #FFF176;
    --yellow-dark:  #F9A825;
    --blue:         #1565C0;
    --blue-light:   #1E88E5;
    --blue-soft:    #E3F0FF;
    --theme-primary: #4361ee;
    --theme-primary-hover: #3a56d4;
    --white:        #FFFFFF;
    --off-white:    #FFFDE7;
    --text-dark:    #1A1A2E;
    --text-mid:     #4A4A6A;
    --text-muted:   #9E9E9E;
    --radius-lg:    20px;
    --radius-md:    14px;
    --radius-sm:    10px;
    --radius-pill:  999px;
    --shadow:       0 8px 28px rgba(0,0,0,0.08);
    --transition:   all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Nunito', sans-serif;
    background: var(--off-white);
    color: var(--text-dark);
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
.main-content img { max-width: 100%; display: block; }

/* ── LAYOUT ── */
.main-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── HERO ── */
.products-hero {
    background: linear-gradient(120deg, var(--blue) 0%, var(--blue-light) 100%);
    border-radius: var(--radius-lg);
    padding: 44px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 36px rgba(21,101,192,0.35);
}

.products-hero::before {
    content: '';
    position: absolute;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: rgba(255,214,0,0.15);
    top: -80px; left: -60px;
    pointer-events: none;
}

.products-hero::after {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,214,0,0.1);
    bottom: -70px; right: -50px;
    pointer-events: none;
}

.products-hero .stripe {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--yellow), var(--yellow-dark), var(--yellow));
}

.hero-eyebrow {
    display: inline-block;
    background: var(--yellow);
    color: var(--blue);
    font-size: 11px;
    font-weight: 900;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 8px;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.82);
    font-weight: 600;
    margin-bottom: 26px;
}

/* ── SEARCH (scoped to .search-container to avoid overriding header search) ── */
.search-container {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-pill);
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}

.search-container .search-icon-wrap {
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 15px;
    flex-shrink: 0;
}

.search-container .search-input {
    flex: 1;
    height: 50px;
    border: none;
    outline: none;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    background: transparent;
}

.search-container .search-input::placeholder { color: var(--text-muted); font-weight: 600; }

.search-container .search-button {
    height: 50px;
    padding: 0 24px;
    background: var(--yellow);
    color: var(--blue);
    border: none;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    flex-shrink: 0;
}

.search-container .search-button:hover { background: var(--yellow-dark); }

/* ── FILTER / CATEGORY ROW ── */
.filter-row {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    box-shadow: var(--shadow);
    border: 1.5px solid rgba(255,214,0,0.25);
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-label {
    font-size: 13px;
    font-weight: 900;
    color: var(--text-mid);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label i { color: var(--yellow-dark); }

.category-pills-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-pills {
    display: flex;
    gap: 8px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.category-pill {
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    background: var(--off-white);
    border: 2px solid rgba(255,214,0,0.3);
    color: var(--text-dark);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-pill:hover {
    border-color: var(--yellow);
    background: var(--yellow-light);
    transform: translateY(-1px);
}

.category-pill.active {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--blue);
    box-shadow: 0 4px 14px rgba(255,214,0,0.4);
}

/* ── VIEW MORE BUTTON + DROPDOWN ── */
.view-more-wrap {
    position: relative;
    flex-shrink: 0;
}

.view-more-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: var(--blue-soft);
    border: 2px solid var(--blue-light);
    color: var(--blue);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.view-more-btn:hover,
.view-more-btn.open {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}

.view-more-btn .chevron {
    transition: transform 0.2s ease;
    font-size: 11px;
}

.view-more-btn.open .chevron { transform: rotate(180deg); }

.overflow-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    border: 2px solid rgba(255,214,0,0.3);
    box-shadow: 0 12px 36px rgba(0,0,0,0.13);
    padding: 10px;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
    z-index: 99;
}

.overflow-dropdown.open { display: flex; }

.overflow-dropdown .category-pill {
    width: 100%;
    text-align: left;
    border-radius: var(--radius-sm);
}

.sort-select {
    margin-left: auto;
    height: 38px;
    padding: 0 14px;
    border: 2px solid rgba(255,214,0,0.3);
    border-radius: var(--radius-pill);
    background: var(--off-white);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-dark);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    flex-shrink: 0;
}

.sort-select:hover, .sort-select:focus {
    border-color: var(--yellow);
    background: var(--yellow-light);
}

/* ── SECTION HEADER ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 19px;
    font-weight: 900;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    font-size: 15px;
    flex-shrink: 0;
}

.results-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--blue-soft);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
}

.results-count span {
    color: var(--blue);
    font-weight: 900;
}

/* ── PRODUCTS SECTION ── */
.products-section {
    background: #f3f4f8;
    border-radius: var(--radius-lg);
    padding: 28px 24px 32px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    border: none;
}

/* ── PRODUCT GRID ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

/* Clip-path SVG must not be a grid child (see catalog_card_clip_def include outside .product-grid) */
.catalog-card__clip-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ── CATALOG CARD (BidaBoss yellow theme) ── */
.product-grid .catalog-card {
    --accent: var(--yellow);
    --accent-text: var(--blue);
    --accent-soft: var(--yellow-light);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 6px 22px rgba(21, 101, 192, 0.08);
    border: 1px solid rgba(255, 214, 0, 0.35);
    transition: transform 0.32s ease, box-shadow 0.32s ease;
    min-width: 0;
}

.product-grid .catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(21, 101, 192, 0.12);
    border-color: var(--yellow);
}

.product-grid .catalog-card__top {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.product-grid .catalog-card__image-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-grid .catalog-card__body-link {
    display: block;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.product-grid .catalog-card__figure {
    /* Set per card by catalog_card_notch.js from discount tab size */
    --notch-w: 32%;
    --notch-h: 28%;
    position: relative;
    margin: 0 0 10px;
    padding: 0;
    background: #fff;
    isolation: isolate;
    border-radius: 18px;
}

.product-grid .catalog-card__media {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(165deg, #ececf0 0%, #d4d4dc 100%);
    box-shadow:
        0 6px 18px rgba(21, 101, 192, 0.12),
        inset 0 3px 14px rgba(255, 255, 255, 0.75),
        inset 0 -14px 28px rgba(0, 0, 0, 0.14),
        inset 0 0 22px rgba(0, 0, 0, 0.05);
}

/* Discount: image scoops around tab pocket in top-left */
.product-grid .catalog-card__figure--notched {
    overflow: visible;
}

.product-grid .catalog-card__figure--notched .catalog-card__media {
    border-radius: 0 18px 18px 18px;
    clip-path: url(#catalog-media-notch);
    -webkit-clip-path: url(#catalog-media-notch);
}

.product-grid .catalog-card__figure--notched .catalog-card__tab {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    width: max-content;
    max-width: 46%;
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    color: var(--white);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.03em;
    line-height: 1.1;
    padding: 4px 8px 5px 7px;
    border-radius: 10px 3px 16px 5px;
    box-shadow:
        0 3px 12px rgba(21, 101, 192, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    border: 1.5px solid var(--blue);
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
}

/* White rim on scoop curve (path set by catalog_card_notch.js) */
.product-grid .catalog-card__notch-rim {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    pointer-events: none;
    overflow: visible;
}

.product-grid .catalog-card__notch-rim path {
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.product-grid .catalog-card__media::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    box-shadow:
        inset 0 0 24px rgba(0, 0, 0, 0.08),
        inset 0 10px 18px rgba(0, 0, 0, 0.05);
}

.product-grid .catalog-card__img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #ececec;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    z-index: 1;
}

.product-grid .catalog-card:hover .catalog-card__img {
    transform: scale(1.04);
}

.product-grid .catalog-card__quick-view {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 12px;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-hover) 100%);
    color: var(--yellow);
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    border-top: 1px solid rgba(255, 214, 0, 0.25);
    box-shadow: 0 -6px 18px rgba(67, 97, 238, 0.35);
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.25s ease,
        box-shadow 0.25s ease;
}

.product-grid .catalog-card__quick-view i {
    font-size: 14px;
    color: var(--yellow);
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
}

.product-grid .catalog-card:hover .catalog-card__quick-view {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.product-grid .catalog-card__quick-view:hover {
    box-shadow: 0 -8px 22px rgba(67, 97, 238, 0.45);
    background: linear-gradient(135deg, var(--theme-primary-hover) 0%, #3530a8 100%);
}

.product-grid .catalog-card__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-top: 8px;
}

.product-grid .catalog-card__meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    margin: 4px 0 8px;
}

.product-grid .catalog-card__title {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    color: #2b2b2b;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.25em * 2);
}

.product-grid .catalog-card__prices {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    max-width: 46%;
}

.product-grid .catalog-card__price {
    background: var(--accent);
    color: var(--accent-text);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid var(--yellow-dark);
}

.product-grid .catalog-card__price-was {
    font-size: 10px;
    font-weight: 700;
    color: #9e9eb8;
    text-decoration: line-through;
    line-height: 1.2;
    white-space: nowrap;
}

.product-grid .catalog-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.product-grid .catalog-card__tag {
    font-size: 9px;
    font-weight: 800;
    color: var(--blue);
    background: var(--blue-soft);
    padding: 3px 8px;
    border-radius: 999px;
    line-height: 1.2;
    border: 1px solid var(--blue-light);
}

.product-grid .catalog-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    margin-top: auto;
    padding: 9px 10px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--accent-text);
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
    border: 1px solid var(--yellow-dark);
    transition: background 0.2s ease, transform 0.2s ease;
}

.product-grid .catalog-card__btn:hover {
    background: var(--yellow-dark);
    transform: translateY(-1px);
}

.product-grid .catalog-card__btn i {
    font-size: 11px;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
}

/* ── OUT OF STOCK ── */
.out-of-stock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.out-of-stock-badge {
    background: #fff;
    color: var(--text-dark);
    font-size: 12px;
    font-weight: 900;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.04em;
}

.out-of-stock-image { filter: grayscale(40%); }

/* Font Awesome on product listing */
.product-grid i[class*="fa-"],
.filter-row i[class*="fa-"],
.products-hero i[class*="fa-"],
.no-products i[class*="fa-"] {
    font-style: normal;
    line-height: 1;
    display: inline-block;
}

.product-grid i.fa-solid,
.product-grid i.fas,
.filter-row i.fa-solid,
.filter-row i.fas,
.products-hero i.fa-solid,
.no-products i.fa-solid {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
}

/* ── NO PRODUCTS ── */
.no-products {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.no-products-icon {
    width: 72px;
    height: 72px;
    background: var(--off-white);
    border: 2px solid var(--yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: var(--yellow-dark);
}

.no-products h3 {
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.no-products p {
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 20px;
}

.reset-filters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--yellow);
    color: var(--blue);
    border: none;
    border-radius: var(--radius-pill);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.reset-filters:hover { background: var(--yellow-dark); }

.products-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-mid);
    font-size: 14px;
    font-weight: 700;
    padding: 14px 0 4px;
}

.products-load-more .products-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--yellow-light);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: products-spin 0.8s linear infinite;
}

@keyframes products-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

@media (max-width: 768px) {
    .main-content { margin-left: 0; padding: 18px 14px 50px; }
    .hero-title { font-size: 1.8rem; }
    .products-hero { padding: 30px 20px; }
    .sort-select { margin-left: 0; }
    .filter-row { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .product-grid .catalog-card { padding: 10px; }
    .product-grid .catalog-card__title { font-size: 12px; }
    .product-grid .catalog-card__btn { font-size: 10px; padding: 8px; }
    .filter-row { gap: 10px; }
}
