/* ============================================================
   THÈME "MATSURI" — Palette du logo Noodeals
   Rose chaud · Violet profond · Jaune-or · Marine sombre
   Ambiance : enseigne néon de ramen · nuit japonaise · festif
   ============================================================ */

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

:root {
    --pink:        #e8336a;   /* rose logo (boîte ramen) */
    --pink-dk:     #c41e52;
    --pink-lt:     rgba(232, 51, 106, 0.12);
    --purple:      #6b2d8b;   /* violet logo (bas boîte) */
    --purple-dk:   #4e1f68;
    --gold:        #f5c518;   /* jaune-or (nouilles + DEALS) */
    --gold-bg:     rgba(245, 197, 24, 0.13);
    --orange:      #f47920;   /* orange "DEALS" du logo */
    --orange-dk:   #d4640a;

    --primary:     var(--pink);
    --primary-dk:  var(--pink-dk);
    --drop:        var(--gold);
    --drop-bg:     var(--gold-bg);

    --bg:          #f9f9f9;   /* blanc neutre */
    --surface:     #ffffff;
    --surface-2:   #f4f2f7;   /* gris très légèrement violacé */
    --border:      #e4ddf0;   /* bordure gris-violet discret */
    --text:        #1e1040;   /* texte marine sombre */
    --text-strong: #1e1040;
    --muted:       #7c6a9b;   /* violet neutre */
    --radius:      12px;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 17px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

/* Scrollbar colorée */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #d4bef8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--pink); }

a { color: inherit; text-decoration: none; }

/* ---- Header ---- */
header {
    background: linear-gradient(120deg, #1e1040 0%, #3d1a7a 45%, #6b2d8b 100%);
    border-bottom: 1px solid rgba(232,51,106,0.25);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(244,121,32,0.35);
    overflow: visible;
    transition: box-shadow 0.3s ease;
}
header.header--compact {
    box-shadow: 0 4px 20px rgba(30,16,64,0.55);
}
.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 28px;
    height: 84px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: height 0.3s ease;
}
header.header--compact .header-inner {
    height: 52px;
}

/* Logo texte (fallback) */
.logo {
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
}
.logo span { color: var(--gold); }

/* Logo image */
.logo-img {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.logo-img img,
.logo-img__src {
    height: 76px;
    width: auto;
    display: block;
    transition: height 0.3s ease;
}
header.header--compact .logo-img img,
header.header--compact .logo-img__src {
    height: 42px;
}

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    transition: all 0.15s;
    font-weight: 500;
}
.nav a:hover {
    background: rgba(232,51,106,0.18);
    color: #fff;
}
.nav a.active {
    background: #fff;
    color: var(--pink);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ---- Search ---- */
.search-wrap {
    position: relative;
    flex: 1;
    max-width: 340px;
    margin-left: auto;
}
.search-wrap form {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 999px;
    overflow: hidden;
    transition: background 0.15s, border-color 0.15s;
}
.search-wrap form:focus-within {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.5);
}
.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 8px 14px;
    font-size: 13px;
    color: #fff;
    min-width: 0;
}
.search-input::placeholder { color: rgba(255,255,255,0.55); }
.search-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.search-btn:hover { color: #fff; }

.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(30,16,64,0.18);
    z-index: 200;
    overflow: hidden;
}
.search-dropdown.open { display: block; }

.sr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.sr-item:last-of-type { border-bottom: none; }
.sr-item:hover, .sr-item.hover { background: var(--surface-2); }
.sr-img-wrap {
    width: 40px;  min-width: 40px;  max-width: 40px;
    height: 40px; min-height: 40px; max-height: 40px;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sr-img-wrap img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
.sr-no-img {
    font-size: 18px; color: var(--muted);
}
.sr-info { flex: 1; min-width: 0; }
.sr-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sr-title mark {
    background: rgba(232,51,106,0.15);
    color: var(--pink);
    border-radius: 2px;
    padding: 0 2px;
}
.sr-badge {
    font-size: 11px;
    font-weight: 800;
    background: var(--pink);
    color: #fff;
    border-radius: 4px;
    padding: 1px 5px;
    flex-shrink: 0;
}
.sr-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sr-all {
    display: block;
    text-align: center;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--pink);
    background: var(--surface-2);
    text-decoration: none;
    border-top: 1px solid var(--border);
}
.sr-all:hover { background: var(--pink-lt); }

.country-selector { position: relative; }
.cs-trigger {
    display: flex; align-items: center; gap: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    color: #fff;
    background: rgba(255,255,255,0.15);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.cs-trigger:hover { background: rgba(255,255,255,0.25); }
.cs-trigger .cs-arrow { font-size: 9px; opacity: .7; margin-left: 2px; }
.cs-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #1e1e2e;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    overflow: hidden;
    min-width: 160px;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.cs-dropdown.open { display: block; }
.cs-option {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: #f1f1f1;
    cursor: pointer;
    text-decoration: none;
}
.cs-option:hover { background: rgba(255,255,255,0.1); }
.cs-option.active { background: rgba(255,255,255,0.15); font-weight: 600; }
.cs-flag { font-size: 18px; line-height: 1; }

/* ---- Grid density selector ---- */
.grid-density { position: relative; flex-shrink: 0; }
.gd-trigger {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border: 1px solid rgba(255,255,255,0.3); border-radius: 6px;
    background: rgba(255,255,255,0.15); color: #fff; cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.gd-trigger:hover, .gd-trigger.active { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); color: #fff; }
.gd-popup {
    display: none; position: absolute; right: 0; top: calc(100% + 6px);
    background: #1e1e2e; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35); padding: 10px 14px;
    z-index: 200; white-space: nowrap;
}
.gd-popup.open { display: block; }
.gd-label { font-size: 11px; color: rgba(255,255,255,0.5); display: block; margin-bottom: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.gd-options { display: flex; gap: 4px; }
.gd-options button {
    width: 32px; height: 32px; border: 1px solid rgba(255,255,255,0.2); border-radius: 6px;
    background: transparent; color: #f1f1f1; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .12s; display: flex; align-items: center; justify-content: center;
}
.gd-options button:hover { border-color: var(--pink); color: var(--pink); background: rgba(255,255,255,0.08); }
.gd-options button.active { background: var(--pink); color: #fff; border-color: var(--pink); }

/* ---- Layout ---- */
.container { max-width: 1600px; margin: 0 auto; padding: 0 28px; }
.page-body {
    padding: 32px 0 60px;
    background: linear-gradient(180deg,
        rgba(244, 121, 32, 0.04) 0px,
        rgba(249, 249, 249, 0)   24px);
}

.page-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-strong);
}
.page-sub { color: var(--muted); font-size: 16px; margin-bottom: 28px; }

/* ---- Filters bar ---- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; position: relative; z-index: 10; }
.filters select, .filters input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
}
.filters .btn-filter {
    padding: 8px 18px;
    background: var(--pink);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(232,51,106,0.35);
}

/* ---- Merchant tabs ---- */
.merchant-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.merchant-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
}
.merchant-tab:hover { border-color: var(--pink); color: var(--pink); }
.merchant-tab.active {
    background: var(--pink);
    color: #fff;
    border-color: var(--pink);
    box-shadow: 0 2px 10px rgba(232,51,106,0.35);
}
.merchant-tab .count { background: rgba(255,255,255,0.15); border-radius: 999px; padding: 1px 6px; font-size: 12px; }

/* ---- Product grid ---- */
.products-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.products-grid--compact { grid-template-columns: repeat(6, 1fr); gap: 12px; }
.products-grid--compact .product-card .card-body   { padding: 8px 10px; }
.products-grid--compact .product-card .merchant-name { font-size: 11px; }
.products-grid--compact .product-card .product-title { font-size: 13px; -webkit-line-clamp: 2; margin-bottom: 6px; }
.products-grid--compact .product-card .price-new   { font-size: 16px; }
.products-grid--compact .product-card .price-old   { font-size: 12px; }
.products-grid--compact .product-card .drop-badge  { font-size: 10px; padding: 2px 5px; }
.products-grid--compact .product-card .card-footer { padding: 7px 10px; }
.products-grid--compact .product-card .btn-deal    { font-size: 13px; padding: 7px; }
.products-grid--compact .product-card .btn-history { font-size: 12px; padding: 6px 8px; }

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
    box-shadow: 0 2px 8px rgba(107,45,139,0.06);
}
.product-card:hover {
    box-shadow: 0 8px 28px rgba(232,51,106,0.18), 0 2px 8px rgba(107,45,139,0.1);
    border-color: var(--pink);
    transform: translateY(-3px);
}
.product-card .img-wrap {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--surface-2);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.product-card .img-wrap .no-img { font-size: 40px; color: #d4bef8; }

.product-card .card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; }
.product-card .merchant-name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--pink);
    margin-bottom: 4px;
}
.product-card .product-title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 8px;
    flex: 1;
    color: var(--text-strong);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card .prices { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.product-card .price-new {
    font-size: 20px;
    font-weight: 800;
    color: var(--purple);
    white-space: nowrap;
}
.product-card .price-old { font-size: 13px; color: var(--muted); text-decoration: line-through; }

.product-card .drop-badge {
    display: inline-block;
    background: var(--drop-bg);
    color: #b8860b;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 0;
    flex-shrink: 0;
    letter-spacing: 0.3px;
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
}
.product-card .prices-sub {
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.5;
}
.product-card .prices-sub > span + span::before {
    content: ' · ';
}

.product-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    gap: 4px;
}
.product-card .btn-deal {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: linear-gradient(135deg, var(--pink-dk), var(--pink));
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(232,51,106,0.35);
}
.product-card .btn-deal:hover { background: linear-gradient(135deg, #9a1040, var(--pink-dk)); }
.product-card .btn-history {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--muted);
    background: transparent;
}
.product-card .btn-history:hover { border-color: var(--gold); color: var(--gold); }

/* ---- Product detail ---- */
.product-detail { display: grid; grid-template-columns: 280px 1fr 1fr; gap: 24px; align-items: stretch; }
.product-detail > div:first-child { align-self: start; }
@media (max-width: 960px) { .product-detail { grid-template-columns: 260px 1fr; } .product-detail .pd-right { grid-column: 1 / -1; } }
@media (max-width: 680px) { .product-detail { grid-template-columns: 1fr; } .product-detail .pd-right { grid-column: auto; } }
.product-detail .main-img {
    width: 100%; aspect-ratio: auto; object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface); padding: 12px;
}
.product-detail .pd-right { display: flex; flex-direction: column; }
.product-detail .pd-right > .section-card { flex: 1; display: flex; flex-direction: column; margin-top: 0; }
.product-detail .pd-right .chart-wrap { flex: 1; min-height: 120px; }
.product-detail .info-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 4px 20px rgba(107,45,139,0.2);
}
.product-detail h1 { font-size: 20px; margin-bottom: 12px; font-weight: 700; color: var(--text-strong); }
.product-detail .current-price { font-size: 28px; font-weight: 900; color: var(--purple); }
.product-detail .old-price { font-size: 16px; color: var(--muted); text-decoration: line-through; margin-left: 8px; }
.product-detail .meta { margin: 16px 0; display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--muted); }
.product-detail .meta span { display: flex; align-items: center; gap: 4px; }
.product-detail .btn-main {
    display: block;
    text-align: center;
    padding: 13px;
    background: linear-gradient(135deg, var(--pink-dk), var(--pink));
    color: #fff;
    border-radius: var(--radius);
    font-weight: 700;
    margin-top: 16px;
    box-shadow: 0 4px 18px rgba(232,51,106,0.4);
    font-size: 16px;
}
.product-detail .btn-main:hover { background: linear-gradient(135deg, #9a1040, var(--pink-dk)); }

/* ---- Section card ---- */
.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 24px;
}
.section-card h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--text-strong); }

/* Rich HTML description authored in admin */
.ean-desc-custom img   { max-width: 100%; height: auto; border-radius: 6px; margin: 12px 0; display: block; }
.ean-desc-custom h1,
.ean-desc-custom h2,
.ean-desc-custom h3    { font-weight: 600; margin: 16px 0 8px; color: var(--text-strong); }
.ean-desc-custom ul,
.ean-desc-custom ol    { padding-left: 20px; margin: 8px 0; }
.ean-desc-custom li    { margin: 4px 0; }
.ean-desc-custom a     { color: var(--primary); text-decoration: underline; }
.ean-desc-custom table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.ean-desc-custom th,
.ean-desc-custom td    { padding: 8px 12px; border: 1px solid var(--border); }
.ean-desc-custom th    { background: var(--surface-2); font-weight: 600; }
.ean-desc-custom blockquote { border-left: 3px solid var(--border); padding-left: 12px; color: var(--muted); margin: 8px 0; }

/* ---- Compare table ---- */
.compare-table table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.compare-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); background: var(--surface-2); }
.compare-table .best-price { color: var(--purple); font-weight: 700; }
.in-stock      { color: #16a34a; font-size: 13px; }
.out-stock     { color: #dc2626; font-size: 13px; }
.limited-stock { color: #f59e0b; font-size: 13px; }

/* ---- Chart ---- */
.chart-wrap { position: relative; height: 240px; }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 6px; margin-top: 24px; justify-content: center; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
}
.pagination a:hover { background: var(--surface-2); border-color: var(--pink); }
.pagination .current {
    background: linear-gradient(135deg, var(--pink-dk), var(--pink));
    color: #fff;
    border-color: var(--pink);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(232,51,106,0.35);
}

/* ---- Marketplace badge ---- */
.badge-marketplace {
    display: inline-block;
    vertical-align: middle;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    margin-left: 5px;
    white-space: nowrap;
    line-height: 1.4;
}

/* ---- Infinite scroll sentinel ---- */
.scroll-sentinel {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
}
.scroll-sentinel.is-loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--pink);
    border-radius: 50%;
    animation: sentinel-spin 0.7s linear infinite;
}
@keyframes sentinel-spin {
    to { transform: rotate(360deg); }
}

/* ---- Bouton "Charger plus" ---- */
.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 16px 8px;
}
.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.btn-load-more:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--pink-lt);
    color: var(--primary);
}
.btn-load-more:disabled {
    cursor: default;
    opacity: .7;
}
.btn-load-more.is-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--pink);
    border-radius: 50%;
    animation: sentinel-spin 0.7s linear infinite;
}

/* ---- Infinite scroll page divider ---- */
.hp-page-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 20px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    user-select: none;
    /* span all columns when inside a CSS grid */
    grid-column: 1 / -1;
}
.hp-page-divider::before,
.hp-page-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---- Empty state ---- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .icon { font-size: 48px; margin-bottom: 12px; }
.empty p { font-size: 15px; }

/* Density overrides */
html[data-density="4"] .products-grid { grid-template-columns: repeat(4, 1fr); }
html[data-density="4"] .products-grid--compact { grid-template-columns: repeat(5, 1fr); }
html[data-density="5"] .products-grid { grid-template-columns: repeat(5, 1fr); }
html[data-density="5"] .products-grid--compact { grid-template-columns: repeat(6, 1fr); }
html[data-density="6"] .products-grid { grid-template-columns: repeat(6, 1fr); }
html[data-density="6"] .products-grid--compact { grid-template-columns: repeat(7, 1fr); }
html[data-density="7"] .products-grid { grid-template-columns: repeat(7, 1fr); }
html[data-density="7"] .products-grid--compact { grid-template-columns: repeat(8, 1fr); }
html[data-density="8"] .products-grid { grid-template-columns: repeat(8, 1fr); }
html[data-density="8"] .products-grid--compact { grid-template-columns: repeat(9, 1fr); }

@media (max-width: 900px) {
    .products-grid, html[data-density] .products-grid,
    .products-grid--compact, html[data-density] .products-grid--compact { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
@media (max-width: 600px) {
    .products-grid, html[data-density] .products-grid,
    .products-grid--compact, html[data-density] .products-grid--compact { grid-template-columns: 1fr 1fr; gap: 12px; }
    .page-title { font-size: 18px; }
    .grid-density { display: none; }
}
@media (max-width: 400px) {
    .products-grid, html[data-density] .products-grid { grid-template-columns: 1fr; }
}

/* ---- Feed sections ---- */
.feed-section {
    margin-bottom: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.feed-section:hover {
    border-color: rgba(232,51,106,0.4);
    box-shadow: 0 6px 24px rgba(107,45,139,0.2);
}

.feed-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    flex-wrap: wrap;
    overflow: hidden;
}
/* Forme orange principale */
.feed-header::before {
    content: '';
    position: absolute;
    inset: 0;
    width: 160px;
    background: var(--orange);
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
    pointer-events: none;
    z-index: 0;
}
/* Écho décalé à droite, semi-transparent */
.feed-header::after {
    content: '';
    position: absolute;
    inset: 0;
    left: 14px;
    width: 170px;
    background: rgba(244, 121, 32, 0.5);
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
    pointer-events: none;
    z-index: 0;
}
.feed-header > * { position: relative; z-index: 1; }
.feed-header .merchant-logo {
    height: 28px; width: auto; max-width: 80px; object-fit: contain; flex-shrink: 0;
    /* Pastille blanche : les logos (souvent des favicons à fond opaque) restent
       en couleur et lisibles sur le bandeau. L'ancien filtre
       brightness(0) invert(1) transformait les fonds opaques en carré blanc. */
    background: #fff;
    border-radius: 6px;
    padding: 3px;
    box-sizing: border-box;
}
.feed-header .feed-merchant-name { font-size: 15px; font-weight: 700; color: #fff; text-decoration: none; }
.feed-header .feed-merchant-name:hover { color: rgba(255,255,255,0.75); }
.feed-header .feed-meta { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.feed-header .feed-date { font-size: 12px; color: var(--muted); font-weight: 700; }
.feed-header .feed-drop-count {
    display: inline-block;
    background: linear-gradient(135deg, var(--pink-dk), var(--pink));
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(232,51,106,0.35);
}
.feed-header .feed-see-all {
    font-size: 12px;
    color: #fff;
    padding: 4px 14px;
    border: none;
    border-radius: 999px;
    white-space: nowrap;
    transition: all 0.15s;
    font-weight: 700;
    background: var(--pink);
    box-shadow: 0 2px 8px rgba(232,51,106,0.35);
}
.feed-header .feed-see-all:hover {
    background: var(--pink-dk);
    color: #fff;
}

/* ---- Carousel ---- */
.carousel-outer { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 12px; }
.carousel-btn {
    flex-shrink: 0;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    color: var(--muted);
    transition: all 0.15s;
    user-select: none;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(107,45,139,0.1);
}
.carousel-btn:hover { border-color: var(--pink); color: var(--pink); background: var(--pink-lt); }
.carousel-btn:disabled { opacity: 0.2; cursor: default; pointer-events: none; }
.carousel-wrap { overflow-x: auto; overflow-y: visible; flex: 1; scroll-behavior: smooth; scrollbar-width: none; padding: 6px 4px 8px 4px; }
.carousel-wrap::-webkit-scrollbar { display: none; }
.carousel { display: flex; gap: 14px; width: max-content; }

/* Thumbnail card */
.thumb-card {
    width: var(--thumb-w, 160px);
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}
.thumb-card:hover {
    box-shadow: 0 0 0 1px var(--pink), 0 4px 14px rgba(232,51,106,0.25);
    border-color: var(--pink);
    transform: translateY(-2px);
}
.thumb-card .thumb-img { width: 100%; height: 120px; object-fit: contain; background: var(--surface-2); padding: 8px; display: block; }
.thumb-card .thumb-no-img { width: 100%; height: 120px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 32px; color: #d4bef8; }
.thumb-card .thumb-body { padding: 8px 10px 10px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.thumb-card .thumb-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--pink-dk), var(--pink));
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    align-self: flex-start;
}
.thumb-card .thumb-price-new {
    font-size: 15px;
    font-weight: 800;
    color: var(--purple);
}
.thumb-card .thumb-price-old { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.thumb-card .thumb-title { font-size: 13px; line-height: 1.35; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Wraps image inside thumb-card — provides the positioned ancestor for .badge-occ */
.thumb-img-wrap {
    position: relative;
}

/* Occasion badge — overlays the image area on carousels, product grids and drop lists */
.badge-occ {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
    letter-spacing: .3px;
    z-index: 2;
    line-height: 1.4;
}

/* ---- feed_drops page ---- */
.feed-drops-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.feed-drops-header .back-link {
    font-size: 13px;
    color: var(--gold);
    border: 1px solid rgba(245,197,24,0.4);
    border-radius: 999px;
    padding: 4px 12px;
    transition: all 0.15s;
    font-weight: 600;
    background: rgba(245,197,24,0.08);
}
.feed-drops-header .back-link:hover {
    background: var(--gold);
    color: #1e1040;
    border-color: var(--gold);
}

/* ---- Back to top button ---- */
#back-to-top {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--pink);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(232,51,106,0.4);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    z-index: 999;
}
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#back-to-top:hover {
    background: var(--pink-dk);
    box-shadow: 0 6px 20px rgba(232,51,106,0.55);
}
