/* Favourites (Connector C12, approved docs/roadmap/design/C12): the heart on cards and the product page, the header
   heart with its count, the Favourites page, the share and sign in sheets, the toast. Only inside .dsec-ui roots, plus
   the one rule that lets a WooCommerce card hold the heart in its corner. Hearts are red when filled (#B4232A, 5.9:1 on
   white), the only red on the shop besides errors. C17a (approved docs/roadmap/design/C17a): the card looks (circle,
   heart only, Save pill), the button looks (outline, filled, heart icon, text link) and the product page row that wraps
   instead of running past the edge. */

/* small inline roots: not a size container (they would collapse to nothing) */
.dsec-ui.dsec-fav-loop, .dsec-ui.dsec-fav-pdp, .dsec-ui.dsec-fav-head, .dsec-ui.dsec-fav-offer-price { container-type: normal; }

/* the heart on a card: top right of the photo, a white circle, 44 px to tap */
.woocommerce ul.products li.product:has(> .dsec-fav-loop), li.product:has(> .dsec-fav-loop), .dsec-fav-best, .dsec-fav-host { position: relative; }
/* WooCommerce's Sale badge moves to the other corner, so it never covers the heart */
.woocommerce ul.products li.product:has(.dsec-fav-loop) .onsale, li.product:has(.dsec-fav-loop) .onsale { right: auto; left: 6px; margin: 0; }
.dsec-ui.dsec-fav-loop { position: absolute; top: 6px; right: 6px; z-index: 3; width: 44px; height: 44px; display: block; }
.dsec-ui.dsec-fav-loop--pill { width: auto; }
.dsec-ui.dsec-fav-loop--static { position: relative; top: 0; right: 0; }
.dsec-ui .dsec-fav-form { margin: 0; padding: 0; }
.dsec-ui .dsec-heart {
  -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0;
  border: 0; border-radius: 50%; background: #fff; color: var(--dsec-ink); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .14); line-height: 1; font: inherit;
}
.dsec-ui .dsec-heart .dsec-ic { width: 22px; height: 22px; }
.dsec-ui .dsec-heart:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.dsec-ui .dsec-heart:focus-visible { outline: 2px solid var(--dsec-ink); outline-offset: 2px; }
.dsec-ui .dsec-heart.is-on { color: #B4232A; }
.dsec-ui .dsec-heart.is-on svg path { fill: currentColor; }
.dsec-ui .dsec-heart.is-pop { animation: dsec-heart-pop .32s ease-out; }

/* card look "Heart only": no circle, a thin white halo so it shows on white and dark photos */
.dsec-ui .dsec-heart--bare, .dsec-ui .dsec-heart--bare:hover { background: transparent; box-shadow: none; }
.dsec-ui .dsec-heart--bare .dsec-ic { width: 24px; height: 24px; filter: drop-shadow(0 0 1.2px #fff) drop-shadow(0 0 1.2px #fff) drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
/* card look "Save pill": the tap area stays 44 px high, the pill inside it 32 px */
.dsec-ui .dsec-heart--pill, .dsec-ui .dsec-heart--pill:hover { width: auto; background: transparent; box-shadow: none; border-radius: 999px; }
.dsec-ui .dsec-heart__pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px; background: #fff;
  color: var(--dsec-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); font: 600 13px/1 var(--dsec-font); white-space: nowrap;
}
.dsec-ui .dsec-heart--pill:hover .dsec-heart__pill { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.dsec-ui .dsec-heart--pill .dsec-ic { width: 16px; height: 16px; }
.dsec-ui .dsec-heart--pill.is-on { color: var(--dsec-ink); }
.dsec-ui .dsec-heart--pill.is-on .dsec-ic { color: #B4232A; }
@keyframes dsec-heart-pop { 0% { transform: scale(1); } 40% { transform: scale(1.22); box-shadow: 0 0 0 6px rgba(180, 35, 42, .16); } 100% { transform: scale(1); } }

/* "Add to favourites" on the product page (C17a): beside Add to basket when there is room, else on its own line. Page
   builders put the basket form's buttons in a row that never wraps (Elementor Pro: flex-wrap: nowrap), so the row
   holding our button may wrap; favourites.js marks a button that wrapped (is-stacked) so it takes the full width. */
form.cart:has(> .dsec-fav-pdp), .woocommerce-variation-add-to-cart:has(> .dsec-fav-pdp), .dsec-fav-row { flex-wrap: wrap !important; }
.dsec-fav-row { row-gap: 10px; }
.dsec-ui.dsec-fav-pdp { display: inline-flex; vertical-align: middle; margin: 0 0 0 10px; max-width: 100%; }
.dsec-ui.dsec-fav-pdp[hidden] { display: none; }
.dsec-ui.dsec-fav-pdp .dsec-heart { margin: 0 !important; }
.dsec-ui .dsec-heart--big {
  width: auto; min-width: 48px; height: 48px; padding: 0 16px; gap: 8px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--dsec-ink); border-radius: var(--dsec-r-control); box-shadow: none; font: 600 14px/1 var(--dsec-font); white-space: nowrap;
}
.dsec-ui .dsec-heart--big:hover { box-shadow: none; background: var(--dsec-bg); }
.dsec-ui .dsec-heart--filled, .dsec-ui .dsec-heart--filled:hover { background: var(--dsec-ink); color: #fff; }
.dsec-ui .dsec-heart--filled:hover { opacity: .9; }
.dsec-ui .dsec-heart--filled.is-on { color: #fff; }
.dsec-ui .dsec-heart--filled:focus-visible { outline-color: var(--dsec-ink); }
.dsec-ui .dsec-heart--icon { width: 48px; padding: 0; }
.dsec-ui .dsec-heart--link, .dsec-ui .dsec-heart--link:hover {
  width: auto; height: auto; min-height: 44px; padding: 0; gap: 6px; display: inline-flex; align-items: center; background: none; border: 0;
  border-radius: 0; box-shadow: none; color: var(--dsec-ink); font: 600 14px/1 var(--dsec-font); text-decoration: underline; text-underline-offset: 3px;
}
.dsec-ui .dsec-heart--link .dsec-ic { width: 18px; height: 18px; }
.dsec-ui .dsec-heart--link.is-on { color: var(--dsec-ink); }
.dsec-ui .dsec-heart--link.is-on .dsec-ic { color: #B4232A; }
.dsec-fav-pdp__words { white-space: nowrap; }
/* its own line: the text link always (under Add to basket), the others once wrapped, and on phones */
.dsec-ui.dsec-fav-pdp--link, .dsec-ui.dsec-fav-pdp.is-stacked { display: flex; flex: 0 0 100%; width: 100%; margin: 10px 0 0; }
.dsec-ui.dsec-fav-pdp.is-stacked .dsec-heart--big:not(.dsec-heart--icon) { width: 100%; }
.dsec-fav-row > .dsec-ui.dsec-fav-pdp--link, .dsec-fav-row > .dsec-ui.dsec-fav-pdp.is-stacked { margin-top: 0; }
/* the widget "Add to favourites" (outside the basket form) */
.dsec-ui.dsec-fav-pdp--alone { display: flex; margin: 0; }
.dsec-ui.dsec-fav-pdp--alone .dsec-fav-form { display: flex; width: 100%; }
@media (max-width: 759px) {
  .dsec-ui.dsec-fav-pdp:not(.dsec-fav-pdp--icon):not(.dsec-fav-pdp--alone) { display: flex; flex: 0 0 100%; width: 100%; margin: 10px 0 0; }
  .dsec-fav-row > .dsec-ui.dsec-fav-pdp:not(.dsec-fav-pdp--icon) { margin-top: 0; }
  .dsec-ui.dsec-fav-pdp:not(.dsec-fav-pdp--icon) .dsec-heart--big, .dsec-ui.dsec-fav-pdp--alone .dsec-heart--big:not(.dsec-heart--icon) { width: 100%; }
}
.dsec-ui.dsec-fav-pdp-line { margin: 8px 0 0; }
.dsec-ui.dsec-fav-pdp-line p { margin: 0; }

/* the header heart with the count */
.dsec-ui.dsec-fav-head { display: inline-flex; align-items: center; }
.dsec-ui .dsec-fav-head__link { position: relative; display: inline-flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; justify-content: center; color: inherit; text-decoration: none; font: 500 14px/1 var(--dsec-font); }
.dsec-ui .dsec-fav-head__link .dsec-ic { width: 22px; height: 22px; }
.dsec-ui .dsec-fav-head__n {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #B4232A; color: #fff;
  font: 700 11px/18px var(--dsec-font); text-align: center; box-sizing: border-box;
}
.dsec-ui .dsec-fav-head__n[hidden] { display: none; }
.dsec-fav-menu-item { list-style: none; display: flex; align-items: center; }

/* the page */
.dsec-ui.dsec-fav-frame { max-width: 1100px; margin: 24px auto 48px; padding: 0 16px; width: 100%; box-sizing: border-box; }
.dsec-favourites-main { padding: 8px 0 32px; }
.dsec-ui .dsec-fav-grid { display: grid; gap: 16px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container dsec (min-width: 760px) { .dsec-ui .dsec-fav-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 20px; } }
.dsec-ui .dsec-fav-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; min-width: 0; }
.dsec-ui .dsec-fav-card__img { display: block; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: var(--dsec-bg); }
.dsec-ui .dsec-fav-card__img img, .dsec-ui .dsec-fav-best img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 1 / 1; border-radius: 8px; }
.dsec-ui .dsec-fav-card__x { position: absolute; top: 20px; right: 20px; margin: 0; z-index: 2; }
.dsec-ui .dsec-heart--x .dsec-ic { width: 18px; height: 18px; }
.dsec-ui .dsec-fav-card__name { font: 500 14px/1.35 var(--dsec-font); color: var(--dsec-ink); text-decoration: none; }
.dsec-ui .dsec-fav-card__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.dsec-ui .dsec-fav-card__price { gap: 8px; flex-wrap: wrap; align-items: baseline; }
.dsec-ui .dsec-fav-was { color: var(--dsec-muted); font-size: 13px; }
.dsec-ui .dsec-fav-card__chip { align-self: flex-start; }
.dsec-ui .dsec-fav-card__buy { margin-top: auto; }
.dsec-ui .dsec-fav-select { position: relative; display: block; }
.dsec-ui .dsec-fav-select select.dsec-input { -webkit-appearance: none; appearance: none; width: 100%; min-height: 40px; padding: 6px 32px 6px 10px; font-size: 14px; background: #fff; }
.dsec-ui .dsec-fav-select .dsec-ic { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.dsec-ui .dsec-fav-best { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dsec-ui .dsec-fav-best > a { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.dsec-ui .dsec-fav-best .dsec-fav-loop { top: 6px; right: 6px; }

/* the personal offer */
.dsec-ui .dsec-fav-offer { display: flex; flex-direction: column; gap: 12px; }
.dsec-ui .dsec-fav-offer__code { gap: 8px; flex-wrap: wrap; align-items: center; }
.dsec-ui .dsec-fav-code { padding: 6px 10px; border: 1px dashed var(--dsec-gold); border-radius: 6px; background: #fff; color: var(--dsec-ink); font-weight: 700; }
.dsec-ui .dsec-alert--gold { background: #FBF6E4; border: 1px solid #E8D58A; color: var(--dsec-ink); }
.dsec-ui .dsec-alert--gold .dsec-ic { color: var(--dsec-gold-text, #8A6D12); }
.dsec-ui.dsec-fav-offer-notice { margin: 0 0 16px; }
.dsec-ui.dsec-fav-offer-price { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dsec-ui.dsec-fav-offer-price ins { text-decoration: none; font-size: 20px; }

/* switches as checkboxes (alerts, sharing) */
.dsec-ui .dsec-fav-switch-row { gap: 16px; cursor: pointer; }
.dsec-ui .dsec-fav-check {
  -webkit-appearance: none; appearance: none; flex: 0 0 44px; width: 44px; height: 26px; border-radius: 13px; background: #d1d5db; position: relative; cursor: pointer; margin: 0;
}
.dsec-ui .dsec-fav-check::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: left .15s; }
.dsec-ui .dsec-fav-check:checked { background: var(--dsec-ink); }
.dsec-ui .dsec-fav-check:checked::after { left: 21px; }
.dsec-ui .dsec-fav-check:focus-visible { outline: 2px solid var(--dsec-ink); outline-offset: 3px; }

/* sheets: the sign in prompt is a bottom sheet everywhere; the code field is big */
.dsec-fav-prompt { font-family: var(--dsec-font); }
@media (min-width: 760px) { .dsec-sheet.dsec-fav-prompt { inset: 0; margin: auto; width: 440px; height: fit-content; max-height: 90vh; border-radius: var(--dsec-r-sheet); } }
.dsec-fav-prompt__badge { width: 48px; height: 48px; border-radius: 50%; background: #FBF6E4; color: #B4232A; display: grid; place-items: center; }
.dsec-fav-prompt__badge--ok { background: #ECFDF5; color: #047857; }
.dsec-fav-prompt__title { font: 500 24px/1.2 var(--dsec-serif); color: var(--dsec-ink); }
.dsec-ui .dsec-fav-prompt__code { font-size: 26px; letter-spacing: .4em; text-align: center; min-height: 56px; }
.dsec-ui .dsec-center { text-align: center; align-self: center; }
.dsec-ui .dsec-err-msg { color: var(--dsec-danger, #DC2626); font-size: 14px; margin: 0; }
.dsec-ui .dsec-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dsec-ui .dsec-inline-form { display: inline; margin: 0; }
.dsec-ui .dsec-inline-form .dsec-btn--link { min-height: 0; padding: 0; vertical-align: baseline; }

/* the toast "Saved to Favourites · View · Undo" (5 seconds) */
.dsec-ui.dsec-fav-toast-wrap { position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 100000; display: flex; justify-content: center; pointer-events: none; container-type: normal; }
@media (min-width: 760px) { .dsec-ui.dsec-fav-toast-wrap { left: auto; right: 24px; bottom: 24px; } }
.dsec-ui .dsec-fav-toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: min(320px, 100%); max-width: 480px; padding: 12px 16px;
  background: var(--dsec-ink); color: #fff; border-radius: var(--dsec-r-card); font: 14px/1.4 var(--dsec-font); box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.dsec-ui .dsec-fav-toast .dsec-ic { color: #fff; }
.dsec-ui .dsec-fav-toast span { flex: 1 1 auto; }
.dsec-ui .dsec-fav-toast a, .dsec-ui .dsec-fav-toast button { color: #fff; font: 600 14px/1 var(--dsec-font); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; min-height: 24px; cursor: pointer; }
.dsec-ui.dsec-fav-toast-wrap.is-gone { opacity: 0; transition: opacity .3s; }

@media (prefers-reduced-motion: reduce) {
  .dsec-ui .dsec-heart.is-pop { animation: none; }
  .dsec-ui .dsec-fav-check::after, .dsec-ui.dsec-fav-toast-wrap { transition: none; }
}
