/* -----------------------------------------------------------------
   Modern generic product card + auto-apply filters + mobile drawer
   Feb 2026 white-label dropshipping refresh (replaces sauce-specific
   .m-pick heat pictos).
   ----------------------------------------------------------------- */

.pc-card {
    --pc-accent: #1F1B16;
    position: relative;
    background: var(--paper, #F7F1E7);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform .18s ease, box-shadow .18s ease;
    display: flex;
    flex-direction: column;
}
.pc-card:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(0, 0, 0, 0.09); }

.pc-card-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pc-card-media {
    position: relative;
    aspect-ratio: var(--design-img-ratio, 3 / 4);
    background: var(--pc-accent);
    overflow: hidden;
}
.pc-card-media .img-bg-fill {
    width: 100%; height: 100%;
}
.pc-card-media .img-bg-fill__main {
    width: 100%; height: 100%; object-fit: contain; /* no crop — respect img-bg-fill engine */
}

.pc-card-badges {
    position: absolute;
    top: 10px; left: 10px;
    display: flex; flex-direction: column; gap: 6px;
    z-index: 2;
    pointer-events: none;
}
.pc-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    letter-spacing: 0.04em;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background: rgba(0, 0, 0, 0.72);
    border-radius: 999px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}
.pc-badge--featured { background: var(--magenta, #EE00AA); }
.pc-badge--bundle   { background: rgba(255, 255, 255, 0.92); color: #1F1B16; }

.pc-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.pc-card-name {
    font-size: 15px;
    line-height: 1.25;
    font-weight: 600;
    margin: 0;
    color: var(--ink, #1F1B16);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}
.pc-card-sub {
    margin: 0;
    font-size: 12px;
    color: var(--ink-muted, rgba(31, 27, 22, 0.6));
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pc-card-priceline {
    margin-top: 6px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}
.pc-card-price {
    font-size: 17px;
    color: var(--ink, #1F1B16);
    font-weight: 700;
    letter-spacing: -0.01em;
}
.pc-card-price-from {
    font-size: 11px;
    color: var(--ink-muted, rgba(31, 27, 22, 0.6));
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.pc-card-soon {
    display: inline-block;
    margin-top: 4px;
    padding: 3px 8px;
    font-size: 10px;
    letter-spacing: 0.08em;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    color: var(--ink-muted, rgba(31, 27, 22, 0.6));
    text-transform: uppercase;
}

/* Dense catalog grid — Lot B density target: 3 (mobile) / 4 (tablet) /
   6 (desktop) / 8 (large). Explicit columns so a phone shows 3 and a wide
   desktop uses the full width. */
.pc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.pc-grid > * { min-width: 0; }
.pc-card-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (min-width: 640px)  { .pc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1024px) { .pc-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1440px) { .pc-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }

/* -----------------------------------------------------------------
   Storefront search bar (header + prominent catalog)
   ----------------------------------------------------------------- */
.cat-search {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    padding: 5px 8px 5px 12px;
    min-width: 200px;
    max-width: 320px;
    flex: 0 1 260px;
}
.cat-search input[type="search"] {
    flex: 1;
    border: 0; background: transparent; outline: none;
    font-size: 14px; color: var(--ink, #1F1B16);
    min-width: 0;
}
.cat-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.cat-search__clear {
    border: 0; background: transparent; cursor: pointer;
    width: 28px; height: 28px; border-radius: 50%;
    color: var(--ink-muted, rgba(31, 27, 22, 0.5));
    font-size: 16px; line-height: 1;
}
.cat-search__clear:hover { background: rgba(0, 0, 0, 0.06); }
.cat-search__submit {
    border: 0; background: var(--magenta, #EE00AA);
    color: #fff; cursor: pointer;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
/* Mobile: the search bar stays visible in the top bar (permanent access).
   The header wraps to 2 rows via .cat-top { flex-wrap: wrap } and the
   search bar takes the full row width. Placed AFTER the desktop rule
   above so this wins the cascade on ≤720px viewports. */
@media (max-width: 720px) {
    .cat-search {
        display: flex !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 0 100% !important;
        order: 3;
    }
}

/* Bigger prominent search shown on top of /products */
.cat-search--hero {
    max-width: 640px; width: 100%;
    padding: 10px 14px 10px 18px;
    background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
    display: flex !important;
    margin: 8px 0 20px;
}
.cat-search--hero input[type="search"] { font-size: 15px; }
.cat-search--hero .cat-search__submit { width: 36px; height: 36px; font-size: 16px; }

/* -----------------------------------------------------------------
   Active filter chips
   ----------------------------------------------------------------- */
.cat-chips {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin: 0 0 16px;
}
.cat-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px 5px 12px;
    background: var(--paper, #F7F1E7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    font-size: 12px;
    color: var(--ink, #1F1B16);
    text-decoration: none;
    line-height: 1.4;
}
.cat-chip__x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: rgba(0, 0, 0, 0.14);
    color: #fff; font-size: 11px; line-height: 1;
}
.cat-chip:hover .cat-chip__x { background: var(--magenta, #EE00AA); }
.cat-chips__reset {
    font-size: 11px; color: var(--magenta, #EE00AA);
    text-decoration: underline; cursor: pointer;
    background: transparent; border: 0; padding: 4px 6px;
}

/* -----------------------------------------------------------------
   Auto-apply filter sidebar (Apply button hidden — checked by JS)
   ----------------------------------------------------------------- */
.cat-adv__form[data-auto-apply] .cat-adv__actions { display: none; }
.cat-adv__form .cat-adv__actions .btn-primary[hidden] { display: none; }

.cat-adv__loading {
    display: none;
    align-items: center; gap: 8px;
    font-size: 12px; color: var(--ink-muted, rgba(31, 27, 22, 0.6));
    padding: 4px 0;
}
.cat-adv__loading.is-loading { display: inline-flex; }
.cat-adv__loading::before {
    content: '';
    width: 12px; height: 12px; border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--magenta, #EE00AA);
    animation: pc-spin .8s linear infinite;
}
@keyframes pc-spin { to { transform: rotate(360deg); } }

/* -----------------------------------------------------------------
   Mobile drawer for filters (< 900 px)
   ----------------------------------------------------------------- */
.cat-adv__filter-toggle {
    display: none;
    margin-bottom: 12px;
    padding: 10px 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px; font-weight: 600;
    color: var(--ink, #1F1B16);
}
/* Mobile-only drawer chrome. On desktop these elements are hidden so the
   two-column grid (260px sidebar + 1fr main) stays intact. */
.cat-adv__filter-close,
.cat-adv__filter-overlay,
.cat-adv__mobile-footer { display: none; }
@media (max-width: 900px) {
    .cat-adv { grid-template-columns: 1fr !important; }
    .cat-adv__filters {
        position: fixed;
        top: 0; right: 0; bottom: 0; width: min(88vw, 360px);
        background: var(--paper, #F7F1E7);
        transform: translateX(100%);
        transition: transform .22s ease;
        z-index: 90;
        overflow-y: auto;
        padding: 60px 20px 24px;
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.14);
    }
    .cat-adv__filters.is-open { transform: translateX(0); }
    .cat-adv__filter-toggle { display: inline-flex; align-items: center; gap: 8px; }
    .cat-adv__filter-close {
        display: block;
        position: absolute; top: 14px; right: 14px;
        border: 0; background: rgba(0, 0, 0, 0.06); border-radius: 50%;
        width: 32px; height: 32px; font-size: 16px; cursor: pointer;
    }
    .cat-adv__filter-overlay {
        display: block;
        position: fixed; inset: 0; background: rgba(0, 0, 0, 0.44);
        z-index: 89; opacity: 0; pointer-events: none;
        transition: opacity .22s ease;
    }
    .cat-adv__filter-overlay.is-visible { opacity: 1; pointer-events: auto; }
    .cat-adv__mobile-footer { display: block; margin-top: 12px; }
}

/* Article-card (dropshipping 1↔1) — short combination label + sale strike. */
.pc-card-article {
    display: inline-block;
    margin-top: 2px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pc-accent, #1F1B16);
    opacity: .92;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.pc-card-was {
    margin-right: 6px;
    font-size: 13px;
    text-decoration: line-through;
    opacity: .55;
}


/* ====================================================================== *
 * UX pass — premium product cards + storefront rhythm/density            *
 * ====================================================================== */

/* Cleaner, more premium product card. */
.pc-card {
    background: #FFFFFF;
    border: 1px solid rgba(23, 18, 15, 0.07);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(23, 18, 15, .04);
    transition: transform .22s cubic-bezier(.2,.7,.2,1), box-shadow .22s ease, border-color .22s ease;
}
.pc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 1px 2px rgba(23,18,15,.05), 0 18px 40px -22px rgba(23,18,15,.45);
    border-color: rgba(23, 18, 15, 0.12);
}
.pc-card-media {
    aspect-ratio: var(--design-img-ratio, 3 / 4);
    background: #F3ECE1;
}
/* Neutralise le placeholder magenta (--bg-accent) des produits sans image :
   halo/placeholder crème premium (les vraies images restent intactes). */
.pc-card .img-bg-fill,
.pc-cat .img-bg-fill { background: #EFE7DB; }
.pc-card .img-bg-fill__placeholder { background: #EFE7DB; color: rgba(23,18,15,.38); }
@media (min-width: 640px) { .pc-card-media { aspect-ratio: var(--design-img-ratio, 3 / 4); } }
.pc-card:hover .pc-card-media .img-bg-fill__main,
.pc-card:hover .pc-card-media img { transform: scale(1.04); }
.pc-card-media .img-bg-fill__main,
.pc-card-media img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }

.pc-card-body { padding: 7px 8px 9px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
@media (min-width: 1024px) { .pc-card-body { padding: 9px 11px 12px; gap: 4px; } }
.pc-card-name {
    font-size: 11.5px; line-height: 1.28; font-weight: 500; margin: 0;
    color: var(--ink, #17120f);
}
@media (min-width: 1024px) { .pc-card-name { font-size: 13.5px; } }
.pc-card-priceline { margin-top: 1px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pc-card-price { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink, #17120f); }
@media (min-width: 1024px) { .pc-card-price { font-size: 15px; } }
.pc-card-was { font-size: 11px; }
.pc-card-pricefrom, .pc-card-soon { font-size: 10px; opacity: .7; }

/* Whole-card format — independent from the illustration ratio. */
body[data-card-format="square"] .pc-card {
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
body[data-card-format="square"] .pc-card-link {
    flex: 1 1 auto;
    min-height: 0;
}
body[data-card-format="square"] .pc-card-media {
    flex: 0 0 58%;
    height: 58%;
    width: auto;
    max-width: 100%;
    align-self: center;
}
body[data-card-format="square"] .pc-card-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 6px 7px 7px;
}
body[data-card-format="square"] .pc-card-name {
    -webkit-line-clamp: 2;
    min-height: 0;
}
body[data-card-format="polaroid"] .pc-card {
    background: #fff;
    padding: 8px 8px 14px;
    border: 1px solid rgba(23,18,15,.10);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
body[data-card-format="polaroid"] .pc-card-media {
    border-radius: 2px;
    box-shadow: none;
}
body[data-card-format="polaroid"] .pc-card-body {
    padding: 9px 2px 2px;
}

/* Category page — clear breathing room between sub-cats, count and grid. */
[data-testid="category-children"] { margin-bottom: clamp(20px, 3vw, 32px) !important; }
.cat-adv__resulthead, .cat-adv__count, [data-testid="category-count"] {
    margin: clamp(8px, 1.5vw, 16px) 0 clamp(12px, 2vw, 20px);
}

/* Homepage — tighten vertical rhythm, keep sections distinct. */
.m-cats, .m-newprods, .m-showcase, .m-editorial { margin-block: clamp(28px, 4vw, 56px); }
@media (max-width: 600px) {
    .m-cats, .m-newprods, .m-showcase, .m-editorial { margin-block: 22px; }
    .m-section-head { margin-bottom: 12px; }
    .m-section-title { font-size: clamp(20px, 5.6vw, 26px); }
}
