/* DG-MOBILE-CARD-PERMANENT-30 (Mark, 30 Nov): the chosen layout of the LIST cards (product and pack: home shop, Order again, Popular, search,
   catalogue list). Everything of that choice is in this one file. To switch it off delete only its one load line in layouts/v3-main.php: the
   cards are then back on the shared component styles. Grid, compact, detail, modal and cart are not in scope. !important stands only where the older,
   stronger list rules would otherwise win; error, still to choose, focus, open and disabled keep their own look. */

/* ---- 1 every width: small control details ---- */
body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow :is(.fs-btn, .fs-opt) :is(.fs-btn-txt, .fs-name, b),
body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow .d-variant-select .c-select,
body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow .qstep :is(.qs-n, input) {
  font-weight: 400;
}
body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow .d-variant:not([data-flavour-invalid="1"]) .flavour-select:not(.open) > .fs-btn:not(.is-placeholder):not(:focus-visible):not(:disabled),
body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow .d-variant-select:not(.is-missing) > .c-select:valid:not(:focus-visible):not(:disabled),
body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow .qstep {
  border: 1.5px solid;
  border-color: var(--line, #e4e7dd) !important;
  border-radius: 12px;
}
body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow .d-pcard-cat.d-rolepill {
  border-radius: 8px;
}

/* ---- 2 phones: photo | pill, name, description; then flavour, quantity | price, actions ---- */
@media (max-width: 720px) {
  body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow {
    grid-template-columns: 64px minmax(0, 1fr) !important;
    column-gap: 10px !important;
  }
  /* the photo against the card's left side, no tile, its own proportions */
  body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow > .d-prow-media {
    align-self: start;
    width: 68px !important;
    height: 68px !important;
    margin: 4px 0 0 -9px !important;
    padding: 0 !important;
    background-color: transparent !important;
  }
  /* the description directly under the name, in the place of the variant line (kept for assistive technology). Order again shows no
     description (existing), so its cards keep the variant line */
  body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow:has(> .d-prow-desc):not(.d-order-again *) {
    grid-template-rows: auto 1fr;
  }
  body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow:has(> .d-prow-desc):not(.d-order-again *) > .d-prow-media {
    grid-row: 1 / span 2 !important;
  }
  body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow > .d-prow-desc {
    grid-column: 2 !important;
    grid-row: 2 !important;
    margin: -6px 0 0 !important;
  }
  body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow:has(.d-prow-desc):not(.d-order-again *) .d-pcard-variant,
  body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow .d-variant-select > .c-choice__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  /* the flavour field over the full card width; its label stays, visually hidden */
  body.v3-storefront[data-storefront="unified"] .d-catalog[data-density="list"] > .d-prow .d-variant-select {
    position: relative;
    max-width: none;
  }
}
