/* BELREUS Mobile Experience 2028 / Responsive Deal Cards 4.0. Laadt globaal na deal-cards-2.css.
   - Aanbiedingsgrids: 4 kolommen vanaf 1440 px, 3 vanaf 1200 px, 2 vanaf 768 px; daaronder een carrousel (assets/js/app.js, .sw-track).
   - Mobiele onderbalk (.bnav), filterlade (/deals/), grotere aanraakvlakken en twee overflowfixes.
   Lange lijsten (catalogus, accessoirecatalogus, zoeken, tabellen) houden hun eigen grid of lijst. */

/* ---------- Grids voor aanbiedingskaarten (tablet en desktop) ---------- */
@media (min-width: 768px) {
    .pd-grid, .dd-grid, .deal-grid.deal-grid-wrap.pf-deals, .deal-grid.deal-grid-wrap.pf-deals.pf-deals--sim { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
    .pd-grid, .dd-grid, .deal-grid.deal-grid-wrap.pf-deals, .deal-grid.deal-grid-wrap.pf-deals.pf-deals--sim { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1440px) {
    .pd-grid, .dd-grid, .deal-grid.deal-grid-wrap.pf-deals, .deal-grid.deal-grid-wrap.pf-deals.pf-deals--sim { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Carrousel (telefoon) ---------- */
@media (max-width: 767px) {
    /* Van rand tot rand: de rij loopt tot de schermrand, zodat de volgende kaart zichtbaar is; de eerste kaart lijnt uit met de pagina. */
    .sw-track {
        display: flex !important; flex-wrap: nowrap !important; align-items: stretch; gap: 8px !important;
        grid-template-columns: none !important; grid-auto-flow: initial !important;
        width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important;
        padding: 4px 10px 12px !important; overflow-x: auto !important; overflow-y: hidden !important; overscroll-behavior-x: contain; height: auto !important;
        scroll-snap-type: x proximity; scroll-padding-inline: 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
        -webkit-mask-image: none !important; mask-image: none !important; container-type: normal;
    }
    .sw-track::-webkit-scrollbar { display: none; }
    /* Grote kaart: 305 px op 360, 330 op 390, 364 op 430; met 10 px rand en 8 px tussenruimte blijft 12-13 procent van de volgende kaart zichtbaar. */
    .sw-track > * { flex: 0 0 calc(100vw * .847) !important; width: auto !important; max-width: none !important; min-width: 0; scroll-snap-align: start; }
    .sw-track > [hidden] { display: none !important; }
    .sw-track > .card:hover { transform: none; }
    /* Bedieningsrij onder de kaarten: vorige, voortgang, teller, volgende. */
    .sw-ctrl { display: none; align-items: center; justify-content: center; gap: 12px; margin: 4px 0 6px; }
    .sw-ctrl.is-on { display: flex; }
    .sw-btn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid #cfdcef; border-radius: 50%; background: #fff; color: var(--navy, #0b1f3a);
        box-shadow: 0 3px 10px rgba(11, 31, 66, .1); cursor: pointer; transition: opacity .2s ease, border-color .2s ease; }
    .sw-btn:hover { border-color: var(--blue, #1a62f2); color: var(--blue, #1a62f2); }
    .sw-btn:focus-visible { outline: 3px solid #8cc8ff; outline-offset: 2px; }
    .sw-btn:disabled { opacity: .35; cursor: default; box-shadow: none; }
    .sw-prog { display: flex; align-items: center; gap: 6px; min-width: 60px; }
    .sw-dot { width: 7px; height: 7px; border-radius: 50%; background: #c9d6e8; transition: width .2s ease, background-color .2s ease; }
    .sw-dot.is-active { width: 20px; border-radius: 4px; background: var(--navy, #0b1f3a); }
    .sw-bar { position: relative; display: block; width: 96px; height: 4px; overflow: hidden; border-radius: 2px; background: #dbe5f2; }
    .sw-bar-thumb { position: absolute; top: 0; height: 100%; border-radius: 2px; background: var(--navy, #0b1f3a); }
    .sw-count { min-width: 44px; color: #4f6787; font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
    .sw-prog--dots + .sw-count { display: none; }
    /* Homepage-accessoires: in de carrousel alle kaarten (de grid toonde er op mobiel maar acht). */
    .ac-home .sw-track > :not([hidden]) { display: flex !important; }
}
@media (min-width: 768px) { .sw-ctrl { display: none !important; } }

/* ---------- Mobiele onderbalk ---------- */
.bnav { display: none; }
@media (max-width: 767px) {
    .bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 75; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
        padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid #dfe7f3; background: rgba(255, 255, 255, .97);
        box-shadow: 0 -6px 18px rgba(11, 31, 66, .08); -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px); }
    .bnav-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; padding: 4px 2px;
        border-radius: 12px; color: #4f6787; font-size: .6875rem; font-weight: 700; text-decoration: none; }
    .bnav-item:hover { color: var(--navy, #0b1f3a); text-decoration: none; }
    .bnav-item:focus-visible { outline: 3px solid #8cc8ff; outline-offset: -2px; }
    .bnav-item.is-active { color: var(--blue, #1a62f2); }
    .bnav-item.is-active::before { content: ""; position: absolute; top: -4px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue, #1a62f2); }
    .bnav-ico { position: relative; display: inline-flex; }
    .bnav .fav-count, .bnav .cmp-count { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #d91f26; color: #fff;
        font-size: .625rem; font-weight: 800; line-height: 18px; text-align: center; }
    .bnav .cmp-count { background: var(--blue, #1a62f2); }
    body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
    /* Vergelijkbalk boven de onderbalk; de cookiemelding blijft bovenop. */
    .compare-tray { bottom: calc(60px + env(safe-area-inset-bottom)); }
    /* Geen dubbele navigatie: deze pictogrammen staan nu in de onderbalk. */
    .site-header .header-actions { display: none; }
    .site-header .nav-toggle { margin-left: auto; }
    /* Compactere kop: de topbalk met USP's verdwijnt op telefoons (de USP's staan ook op de homepage). */
    .top-bar { display: none; }
}

/* ---------- Filterlade (/deals/) ---------- */
.dd-sheet-open, .dd-sheet-head, .dd-sheet-reset, .dd-filter-mob { display: none; }
@media (max-width: 767px) {
    .dd-sheet-open { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 12px; padding: 0 16px; border: 1px solid #cfdcef; border-radius: 999px;
        background: #fff; color: var(--navy, #0b1f3a); font-weight: 700; cursor: pointer; }
    .dd-sheet-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--blue, #1a62f2); color: #fff; font-size: .75rem; }
    .dd-filters { position: fixed !important; left: 0; right: 0; bottom: 0; z-index: 90; display: grid !important; gap: 10px !important; max-height: 82vh; margin: 0 !important; overflow-y: auto;
        padding: 0 16px calc(16px + env(safe-area-inset-bottom)) !important; border-radius: 20px 20px 0 0; background: #fff; box-shadow: 0 -12px 40px rgba(11, 31, 66, .25);
        transform: translateY(105%); visibility: hidden; transition: transform .25s ease, visibility .25s; }
    .dd-filters.is-open { transform: none; visibility: visible; }
    .dd-sheet-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 0 8px; background: #fff; color: var(--navy, #0b1f3a); font-size: 1.0625rem; }
    .dd-sheet-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f1f5fb; color: var(--navy, #0b1f3a); font-size: 1.5rem; line-height: 1; cursor: pointer; }
    .dd-filters .dd-field { flex: none !important; width: 100%; }
    .dd-filters .dd-field select { width: 100%; min-height: 48px; }
    .dd-filters .dd-filter-btn { width: 100%; min-height: 50px; justify-content: center; }
    .dd-filter-desk { display: none; }
    .dd-filter-mob { display: inline; }
    .dd-sheet-reset { display: block; padding: 8px 0 0; text-align: center; font-weight: 700; }
    .sheet-shade { position: fixed; inset: 0; z-index: 85; background: rgba(5, 15, 35, .45); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s; }
    .sheet-shade.is-open { opacity: 1; visibility: visible; }
    body.sheet-open { overflow: hidden; }
}

/* ---------- Aanraakvlakken en kleine fixes ---------- */
@media (max-width: 767px) {
    .bc-actions .btn-fav, .bc-actions .btn-share, .bc .bc-actions .btn-fav { width: 40px; height: 40px; }
    .sh-btn { width: 40px; height: 40px; margin-top: -20px; }
}
/* Productpagina: DealScore-opbouw paste niet op 360 px. */
@media (max-width: 420px) {
    .ds-wrap .score-parts li { grid-template-columns: minmax(0, 1fr) auto; }
    .ds-wrap .score-parts .bar { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    .sw-btn, .sw-dot, .dd-filters, .sheet-shade { transition: none; }
}

/* /deals/: de vier categoriekaarten op telefoons compact in 2 x 2 (zelfde opbouw als de homepage). */
@media (max-width: 560px) {
    .dd-cats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
    .dd-cat { flex-direction: column; align-items: flex-start; gap: 6px; min-height: 0 !important; padding: 12px 12px 14px !important; }
    .dd-cat-img { width: 64px; height: 56px; place-items: center start; }
    .dd-cat-img img, .dd-cat-img .product-visual, .dd-cat-img .media-frame { max-width: 64px; max-height: 56px; }
    .dd-cat-img--combo .dd-cat-sim { width: 28px; height: 28px; right: 0; }
    .dd-cat-text strong { padding-right: 30px; font-size: 1rem; }
    .dd-cat-go { top: 12px; bottom: auto; width: 28px; height: 28px; }
}

/* ---------- Rijen van ongeveer vier kaarten (lange lijsten, app.js split) ---------- */
/* Tablet en desktop: de rij bestaat niet voor de opmaak; de kaarten staan zoals altijd in de grid. */
.sw-row { display: contents; }
@media (max-width: 767px) {
    .sw-rows { display: block !important; width: auto !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
    .sw-rows > .sw-row { margin-bottom: 2px; }
    .sw-rows > .sw-ctrl { margin: 0 0 14px; }

    /* Kaarten in de rijen: compacte opmaak (ca. 305-365 px breed). */
    .sw-track .sim3-head { align-items: flex-start; min-height: 56px; padding: 8px 88px 8px 12px; justify-content: flex-start; }
    .sw-track .sim3-head > .bc-actions { top: 8px; transform: none; }
    .sw-track .sim3-logo img, .sw-track .sim3-logo .pv-logo { max-width: 92px; max-height: 24px; }
    .sw-track .sim3-head > .bc-actions .btn-fav, .sw-track .sim3-head > .bc-actions .btn-share { width: 36px; height: 36px; }
    .sw-track .sim3-tags { top: auto; bottom: -11px; left: 12px; max-width: none; transform: none; }
    .sw-track .sim3-tags .tag { white-space: nowrap !important; }
    .sw-track .sim3-body { padding: 16px 12px 12px; }
    .sw-track .sim3-data { font-size: 1.375rem; }
    .sw-track .sim3-specs { margin-bottom: 8px; font-size: .75rem; }
    .sw-track .sim3-price strong { font-size: 1.75rem; }
    .sw-track .sim3-price span { font-size: .8125rem; }
    .sw-track .sim3-note { margin-bottom: 8px; font-size: .6875rem; }
    .sw-track .sim3-costs { gap: 3px; padding: 8px 10px; }
    .sw-track .sim3-costs dt { min-width: 0; font-size: .75rem; }
    .sw-track .sim3-costs dd { font-size: .8125rem; }
    .sw-track .sim3-feat { gap: 3px; margin-bottom: 10px; font-size: .75rem; }
    .sw-track .sim3-cta { min-height: 42px; font-size: .875rem; }
    .sw-track .score { transform: scale(.92); transform-origin: right center; }

    .sw-track .dd-card-title { font-size: 1.0625rem; }
    .sw-track .dd-card-price strong { font-size: 1.5rem; }
    .sw-track .dd-card-cta { min-height: 42px; font-size: .9375rem; }

    /* Toestellen op providerpagina's: lager beeldvlak. */
    .sw-track .pp-deal-media { height: 170px; }
    .sw-track .pp-deal-media > a img, .sw-track .pp-deal-media > a img.product-photo, .sw-track .pp-deal-media > a svg { height: 140px; }
    .sw-track .pp-deal-body { padding: 12px; }

    /* Providerkaarten (homepage) en accessoires: wat minder binnenruimte. */
    .sw-track .pd-card-body { padding-left: 14px; padding-right: 14px; }
}

/* ---------- Vaste knop naar de aanbieder op detailpagina's (mobiel), boven de onderbalk ---------- */
.pp-sticky { display: none; }
@media (max-width: 767px) {
    .pp-sticky { position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 74; display: flex; align-items: center; gap: 12px;
        padding: 8px 16px; border-top: 1px solid #dfe7f3; background: #fff; box-shadow: 0 -6px 18px rgba(11, 31, 66, .1); }
    .pp-sticky-price { display: flex; flex-direction: column; line-height: 1.1; }
    .pp-sticky-price strong { color: var(--navy, #0b1f3a); font-family: var(--font-heading); font-size: 1.25rem; white-space: nowrap; }
    .pp-sticky-price small { color: #4f6787; font-size: .6875rem; }
    .pp-sticky .btn-deal { flex: 1; justify-content: center; min-height: 46px; }
    body:has(.pp-sticky) { padding-bottom: calc(126px + env(safe-area-inset-bottom)); }
    /* Accessoirepagina: de bestaande vaste knop stond achter de onderbalk. */
    .ad-sticky { bottom: calc(60px + env(safe-area-inset-bottom)) !important; z-index: 74 !important; padding-bottom: 10px !important; }
    body:has(.ad-sticky) { padding-bottom: calc(126px + env(safe-area-inset-bottom)); }
}
