/* =========================================================================
   MOBILVERSION — MIN SHOP (produkter.html), telefon (≤ 809.98px)

   Page-specific phone layer on top of the shared css/mobil.css. Linked only
   from produkter.html, after shop.css and mobil.css. Everything sits inside
   the phone media block (plus the guard at the very end), so laptop and
   monitor are untouched by construction. Behaviour: js/mobil-produkter.js.

   Sections, top to bottom:
     1. Hero      — title, then the lead as body text (Montserrat 16px)
     2. Shop head — eyebrow + 34px title + lead
     3. Filters   — category chips and the three filter pills as two swipe
                    rows; each filter opens as a bottom sheet
     4. Grid      — two columns, same 4:5 cards as desktop, title + price on
                    the photo (no hover on a phone, so no roll-up)
     5. Pop-ups   — product / course pop-up as a full-screen sheet; the photo
                    scrolls away with the text
     6. "Usikker, hvor du starter?" — section-size title, phone spacing
   ========================================================================= */

@media (max-width: 809.98px) {

  /* 1. HERO — shared by the four sub-pages, see css/mobil.css "SUB-PAGE HERO" */

  /* ---------------------------------------------------------------------
     2. SHOP HEAD
     --------------------------------------------------------------------- */
  body.cm-page-produkter .cm-shop {
    padding: 72px var(--cm-m-gutter, 20px) 0 !important;
    margin: 0 !important;
  }
  body.cm-page-produkter .cm-shop-head {
    max-width: none;
    margin: 0 0 32px !important;
  }
  body.cm-page-produkter .cm-shop-eyebrow {
    font-size: 11px !important;
    margin: 0 0 14px !important;
  }
  body.cm-page-produkter .cm-shop-title {
    font-size: 34px !important;
    line-height: 1.1 !important;
    margin: 0 0 16px !important;
    text-wrap: balance;
  }
  body.cm-page-produkter .cm-shop-lead {
    font-size: 16px !important;
    line-height: 1.65 !important;
  }

  /* ---------------------------------------------------------------------
     3. FILTERS — two swipe rows that run to the screen edges: categories
     (filled pill = chosen), then sort / price / format. The count and
     "Nulstil filtre" sit on one small line under them.
     --------------------------------------------------------------------- */
  body.cm-page-produkter .cm-shop-chiprow,
  body.cm-page-produkter .cm-shop-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    margin: 0 calc(-1 * var(--cm-m-gutter, 20px)) !important;
    padding: 0 var(--cm-m-gutter, 20px) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-padding: 0 var(--cm-m-gutter, 20px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  body.cm-page-produkter :is(.cm-shop-chiprow, .cm-shop-bar)::-webkit-scrollbar { display: none; }
  /* the last pill keeps the gutter after it when scrolled to the end */
  body.cm-page-produkter :is(.cm-shop-chiprow, .cm-shop-bar)::after {
    content: "";
    flex: 0 0 calc(var(--cm-m-gutter, 20px) - 8px);
  }
  body.cm-page-produkter .cm-shop-chip {
    height: 44px !important;
    padding: 0 18px !important;
    font-size: 15px !important;
    -webkit-tap-highlight-color: transparent;
  }
  body.cm-page-produkter .cm-shop-controls {
    display: block !important;
    margin: 10px 0 20px !important;
    padding: 0 !important;
    border: 0 !important;
  }
  body.cm-page-produkter .cm-shop-drop {
    flex: none;
    position: static !important;
  }
  body.cm-page-produkter .cm-shop-pill {
    height: 44px !important;
    padding: 0 16px 0 18px !important;
    font-size: 14px !important;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }
  body.cm-page-produkter .cm-shop-meta {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-top: 14px !important;
    padding-top: 14px !important;
    border-top: 1px solid var(--cm-shop-line, rgba(74, 55, 48, 0.14));
  }
  body.cm-page-produkter .cm-shop-count { font-size: 14px !important; }
  body.cm-page-produkter .cm-shop-reset {
    font-size: 12px !important;
    letter-spacing: 0.11em !important;
    padding: 12px 0 2px !important;    /* taller tap area, same look */
    margin: -12px 0 0 !important;
  }

  /* The open filter becomes a bottom sheet over a dimmed page (the dim layer
     is .cm-mp-scrim from js/mobil-produkter.js; tapping it closes). */
  body.cm-page-produkter .cm-shop-panel {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147482600 !important;
    min-width: 0 !important;
    max-height: 82vh;
    max-height: 82svh;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0 !important;
    padding: 6px 12px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    border: 0 !important;
    border-radius: 22px 22px 0 0 !important;
    background-color: var(--cm-bg, #f4f1ea) !important;
    box-shadow: 0 -16px 44px rgba(23, 18, 16, 0.16) !important;
  }
  body.cm-page-produkter .cm-shop-panel.is-open {
    animation: cm-mp-sheet-in 0.42s cubic-bezier(0.2, 0, 0.2, 1);
  }
  @keyframes cm-mp-sheet-in {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: none; opacity: 1; }
  }
  body.cm-page-produkter .cm-shop-panel::before {   /* the sheet's heading */
    display: block;
    padding: 18px 12px 12px;
    font-family: var(--cm-font-body, "DM Sans", sans-serif);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cm-accent, #c08276);
  }
  body.cm-page-produkter [data-drop="sort"] .cm-shop-panel::before   { content: "Sortér efter"; }
  body.cm-page-produkter [data-drop="price"] .cm-shop-panel::before  { content: "Pris"; }
  body.cm-page-produkter [data-drop="format"] .cm-shop-panel::before { content: "Format"; }
  body.cm-page-produkter .cm-shop-opt {
    min-height: 52px;
    padding: 0 12px !important;
    font-size: 16px !important;
    gap: 14px !important;
    -webkit-tap-highlight-color: transparent;
  }
  body.cm-page-produkter .cm-shop-opt + .cm-shop-opt {
    border-top: 1px solid var(--cm-shop-line, rgba(74, 55, 48, 0.14));
    border-radius: 0;
  }
  body.cm-page-produkter .cm-shop-opt-mark { width: 18px; height: 18px; }
  body.cm-page-produkter .cm-shop-opt[aria-checked="true"] .cm-shop-opt-mark::after { inset: 3.5px; }

  .cm-mp-scrim {
    position: fixed;
    inset: 0;
    z-index: 2147482500;
    background: rgba(74, 55, 48, 0.42);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    -webkit-tap-highlight-color: transparent;
  }
  html.cm-mp-sheet .cm-mp-scrim {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
  }
  html.cm-mp-sheet { overflow: hidden !important; }
  html.cm-mp-sheet .cm-mbtn {
    opacity: 0;
    pointer-events: none;
  }

  /* ---------------------------------------------------------------------
     4. GRID — two across, same 4:5 cards and the same "title at the bottom"
     look as desktop. On the phone the card holds category, title and price;
     the teaser and the format line live in the pop-up one tap away.
     --------------------------------------------------------------------- */
  body.cm-page-produkter .cm-shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 12px !important;
    row-gap: 12px !important;
    padding: 0 !important;
  }
  @media (min-width: 600px) {       /* big phones sideways / small tablets */
    body.cm-page-produkter .cm-shop-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
  }
  body.cm-page-produkter .cm-shop-mediawrap {
    --cm-fr-round: 22px;
    margin: 0 !important;
  }
  body.cm-page-produkter .cm-shop-overlay {
    padding: 14px 12px 13px !important;
  }
  body.cm-page-produkter .cm-shop-cat-tag {
    font-size: 9.5px !important;
    letter-spacing: 0.14em !important;
    margin: 0 0 5px !important;
  }
  body.cm-page-produkter .cm-shop-name {
    font-size: 17px !important;
    line-height: 1.2 !important;
    text-wrap: balance;
  }
  body.cm-page-produkter .cm-shop-teaser,
  body.cm-page-produkter .cm-shop-format {
    display: none !important;
  }
  body.cm-page-produkter .cm-shop-foot {
    padding-top: 8px !important;
    gap: 0 !important;
  }
  body.cm-page-produkter .cm-shop-price {
    font-size: 13px !important;
  }
  body.cm-page-produkter .cm-shop-badge {
    top: 10px !important;
    right: 10px !important;
    padding: 4px 9px !important;
    font-size: 9.5px !important;
  }
  /* No hover on a phone: details always shown at the bottom, title never
     rolls up. Also cancels the "sticky hover" a tap leaves behind on iOS
     (zoomed, blurred photo still showing when the pop-up closes). */
  body.cm-page-produkter .cm-shop-card .cm-shop-overlay::before { flex-grow: 1 !important; }
  body.cm-page-produkter .cm-shop-card .cm-shop-reveal {
    flex: 0 0 auto !important;
    overflow: visible !important;
    margin-top: 8px !important;
    opacity: 1 !important;
    transform: none !important;
  }
  body.cm-page-produkter .cm-shop-card:hover .cm-shop-mediawrap,
  body.cm-page-produkter .cm-shop-card:hover .cm-shop-media img {
    transform: none !important;
  }
  body.cm-page-produkter .cm-shop-card:hover .cm-shop-media img:is([src*="/cammilla-bw/"], [src*="/cammilla-farve/"], [src*="/cammilla/"], [src*="/lydkurser-plakater/"]) {
    filter: none !important;
  }
  body.cm-page-produkter .cm-shop-card:hover .cm-shop-scrim::after { opacity: 0 !important; }
  body.cm-page-produkter .cm-shop-card:hover .cm-shop-media::after { box-shadow: none !important; }
  /* tap feedback instead */
  body.cm-page-produkter .cm-shop-card { -webkit-tap-highlight-color: transparent; }
  body.cm-page-produkter .cm-shop-card .cm-shop-mediawrap {
    transition: transform 0.25s ease !important;
  }
  body.cm-page-produkter .cm-shop-card:active .cm-shop-mediawrap {
    transform: scale(0.97) !important;
  }

  body.cm-page-produkter .cm-shop-empty {
    padding: 32px 0 !important;
    font-size: 16px !important;
  }
  body.cm-page-produkter .cm-shop-more { margin-top: 32px !important; }

  /* ---------------------------------------------------------------------
     5. POP-UPS (product + course) — a full-screen sheet. The photo is moved
     into the text column by js/mobil-produkter.js, so it scrolls away with
     the text instead of holding a third of the screen; the close button stays
     put top-right. Also used for the front page's product pop-ups (same
     sheet as here, Oliver 2026-11-26) — index.html loads this file too. The site's Menu button sits above every layer, so it
     steps aside while a pop-up is open (it covered the close button).
     --------------------------------------------------------------------- */
  body:is(.cm-page-produkter, .cm-home):has(> .cm-prod-overlay.cm-prod-open) .cm-mbtn,
  body:is(.cm-page-produkter, .cm-home):has(> .cm-course-overlay.cm-course-open) .cm-mbtn,
  html.cm-mp-modal .cm-mbtn {
    opacity: 0;
    pointer-events: none;
  }
  body:is(.cm-page-produkter, .cm-home) :is(.cm-prod-overlay, .cm-course-overlay) {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  body:is(.cm-page-produkter, .cm-home) :is(.cm-prod-modal, .cm-course-modal) {
    flex-direction: column !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: translateY(28px) !important;
  }
  body:is(.cm-page-produkter, .cm-home) .cm-prod-overlay.cm-prod-open .cm-prod-modal,
  body:is(.cm-page-produkter, .cm-home) .cm-course-overlay.cm-course-open .cm-course-modal {
    transform: none !important;
  }
  body:is(.cm-page-produkter, .cm-home) :is(.cm-prod-content, .cm-course-content) {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 24px calc(48px + env(safe-area-inset-bottom, 0px)) !important;
  }
  /* the photo, now the first thing in the text column: full bleed, the
     cards' own 4:5 shape, capped so the title shows on the first screen */
  body:is(.cm-page-produkter, .cm-home) :is(.cm-prod-content > .cm-prod-img, .cm-course-content > .cm-course-img) {
    flex: none !important;
    display: block !important;
    width: calc(100% + 48px) !important;
    height: min(125vw, 58vh) !important;
    height: min(125vw, 58svh) !important;
    min-height: 0 !important;
    margin: 0 -24px 32px !important;
  }
  body:is(.cm-page-produkter, .cm-home) .cm-prod-content > .cm-prod-img .cm-prod-img-el:is([src*="/cammilla-bw/"], [src*="/cammilla-farve/"], [src*="/cammilla/"]) {
    object-position: 50% 18% !important;     /* keep her face in the wider frame */
  }
  body:is(.cm-page-produkter, .cm-home) .cm-course-content > .cm-course-img {
    background-size: cover !important;
    background-position: 50% 18% !important;
  }
  body:is(.cm-page-produkter, .cm-home) :is(.cm-prod-close, .cm-course-close) {
    top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    right: 14px !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 26px !important;
    background: rgba(251, 249, 247, 0.92) !important;
    box-shadow: 0 4px 16px rgba(23, 18, 16, 0.14);
    z-index: 5 !important;
  }
  body:is(.cm-page-produkter, .cm-home) :is(.cm-prod-title, .cm-course-title) {
    text-wrap: balance;
  }
  body:is(.cm-page-produkter, .cm-home) .cm-course-buyrow { gap: 20px !important; }

  /* ---------------------------------------------------------------------
     6. "USIKKER, HVOR DU STARTER?" — the shared closing CTA (custom.js puts
     its sizes inline; these beat them). Title at the section size.
     --------------------------------------------------------------------- */
  body.cm-page-produkter #cm-custom-product-cta {
    padding: 72px var(--cm-m-gutter, 20px) 64px !important;
  }
  body.cm-page-produkter #cm-custom-product-cta > p:first-child {
    font-size: 11px !important;
    margin-bottom: 14px !important;
  }
  body.cm-page-produkter #cm-custom-product-cta > h2 {
    font-size: 34px !important;
    line-height: 1.1 !important;
    margin-bottom: 18px !important;
    text-wrap: balance;
  }
  body.cm-page-produkter #cm-custom-product-cta > h2 + p {
    font-size: 16px !important;
    line-height: 1.65 !important;
    margin: 0 0 32px !important;
  }
  body.cm-page-produkter #cm-custom-product-cta > div:last-child {
    gap: 28px !important;
  }
}

/* Guard: the phone-only pieces never show above the phone width. */
@media (min-width: 810px) {
  .cm-mp-scrim { display: none !important; }
}
