/* My List — enquiry basket rows, toast, form (High Street heritage skin). */

.mylist-page { max-width: 980px; } /* single column; widened at the 2-col breakpoint below */
/* superwide: a touch more room so the page reads deliberate, not lost */
@media (min-width: 1800px) {
  .mylist-page { max-width: 1080px; }
}

.mylist-head { margin-bottom: clamp(24px, 4vw, 40px); }
.mylist-head .kicker { margin: 0 0 8px 0; }

/* --- empty state --- */
.mylist-empty {
  background: var(--paper);
  border: 2px solid var(--green);
  border-radius: 12px;
  padding: clamp(32px, 6vw, 56px) clamp(20px, 4vw, 48px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.mylist-empty__big { font-size: clamp(24px, 4vw, 36px); }
.mylist-empty__sub { margin: 0; font-size: 17px; font-weight: 600; color: var(--ink-soft); }

/* --- rows --- */
.mylist-rows {
  list-style: none;
  margin: 0 0 clamp(24px, 4vw, 36px) 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* Mobile-first: stacked card with qty rail under the info. */
.mylist-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  grid-template-areas:
    "thumb info remove"
    "thumb qty qty";
  align-items: center;
  row-gap: 10px;
  column-gap: clamp(12px, 2vw, 16px);
  background: var(--paper);
  border: 2px solid var(--green);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(20, 68, 43, 0.16);
  padding: 12px clamp(12px, 2vw, 16px) 12px 12px;
}
.mylist-row__thumb {
  grid-area: thumb;
  align-self: start;
  display: block;
  width: 72px;
  height: 72px;
  border: 2px solid var(--green);
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream);
}
.mylist-row__info { grid-area: info; }
.mylist-row__qty { grid-area: qty; justify-self: start; }
.mylist-remove { grid-area: remove; align-self: start; }

@media (min-width: 640px) {
  .mylist-row {
    grid-template-columns: 96px minmax(0, 1fr) auto auto;
    grid-template-areas: "thumb info qty remove";
  }
  .mylist-row__thumb { width: 96px; height: 96px; align-self: center; }
  .mylist-row__qty { justify-self: end; }
  .mylist-remove { align-self: center; }
}
.mylist-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.mylist-row__noimg {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(-45deg, var(--cream) 0 10px, var(--paper) 10px 20px);
}
.mylist-row__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mylist-row__name {
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.mylist-row__name:hover { color: var(--red); }
.mylist-row__option { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.mylist-row__price { font-size: 13px; font-weight: 800; color: var(--green); text-transform: uppercase; letter-spacing: 0.04em; }

.mylist-row__qty { display: flex; align-items: center; gap: 8px; }
.mylist-row__qtynum {
  min-width: 30px;
  text-align: center;
  font-family: var(--body);
  font-weight: 800;
  font-size: 17px;
}
.mylist-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--green);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.mylist-step:hover:not(:disabled) { background: var(--green); color: var(--cream); }
.mylist-step:disabled { opacity: 0.35; cursor: default; }

.mylist-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--green);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.mylist-remove:hover { background: var(--red); border-color: var(--red); color: var(--cream); }

/* --- what happens next --- */
.mylist-next {
  background: var(--paper);
  border: 2px solid var(--green);
  border-radius: 12px;
  padding: clamp(20px, 3vw, 30px) clamp(20px, 3.4vw, 34px);
  margin-bottom: clamp(32px, 5vw, 52px);
}
.mylist-next__title { font-size: clamp(18px, 2vw, 22px); margin-bottom: 10px; }
.mylist-next p { margin: 0; font-size: 15.5px; font-weight: 500; }

/* --- enquiry form --- */
.mylist-enquiry h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 10px; }
.mylist-enquiry__intro { margin: 0 0 22px 0; font-size: 16px; font-weight: 500; }

.mylist-form {
  background: var(--paper);
  border: 2px solid var(--green);
  border-radius: 12px;
  padding: clamp(22px, 3.6vw, 40px);
}
/* Mobile-first: single column; two columns from 640px up. */
.mylist-form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px 22px;
}
@media (min-width: 640px) {
  .mylist-form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mylist-field { margin: 0; display: flex; flex-direction: column; gap: 7px; }
.mylist-field--full { grid-column: 1 / -1; }
.mylist-hint { font-size: 13px; line-height: 1.4; color: rgba(34, 48, 31, 0.72); }
.mylist-field label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mylist-req { color: var(--red); }
.mylist-field input,
.mylist-field select,
.mylist-field textarea {
  font-family: var(--body);
  font-size: 16px;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--green);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 48px;
  width: 100%;
}
.mylist-field textarea { resize: vertical; min-height: 120px; }
.mylist-field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 49%, var(--green) 50%), linear-gradient(-45deg, transparent 49%, var(--green) 50%); background-position: calc(100% - 22px) 55%, calc(100% - 14px) 55%; background-size: 8px 8px; background-repeat: no-repeat; padding-right: 44px; }

/* Honeypot: visually gone, still in the DOM for bots. */
.mylist-hp { position: absolute; left: -9999px; top: -9999px; height: 1px; width: 1px; overflow: hidden; }

.mylist-submit { margin-top: 22px; min-height: 52px; }

.mylist-error {
  margin-top: 20px;
  background: var(--red);
  color: var(--cream);
  font-weight: 700;
  font-size: 15px;
  border-radius: 10px;
  padding: 14px 18px;
}
.mylist-error a { color: var(--cream); text-decoration: underline; }

/* --- success panel --- */
/* The hidden attribute must beat our own display rules: any author display
   (e.g. the flex below) overrides the UA's [hidden]{display:none} regardless
   of specificity, which made the success panel show on first load. Guard all
   three JS-toggled panels so a future display rule can't regress this. */
.mylist-success[hidden],
.mylist-enquiry[hidden],
.mylist-error[hidden] { display: none !important; }

.mylist-success {
  background: var(--green);
  color: var(--cream);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(20, 68, 43, 0.16);
  padding: clamp(30px, 5vw, 52px) clamp(22px, 4vw, 44px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.mylist-success__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--gold);
  color: var(--green);
  border: 0;
  border-radius: 50%;
}
.mylist-success h2 { font-size: clamp(26px, 3.4vw, 36px); }
.mylist-success p { margin: 0; font-size: 16px; font-weight: 600; max-width: 520px; }
.mylist-success p a { color: var(--gold); } /* gold links only in body copy on the green panel — never on the red .btn */
.mylist-success .btn { margin-top: 8px; color: var(--cream); }

/* --- toast --- */
.cph-toast {
  position: fixed;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--green);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(20, 68, 43, 0.16);
  font-family: var(--body);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 12px 18px;
  max-width: calc(100vw - 20px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.cph-toast.is-in { opacity: 1; transform: translateY(0); }
.cph-toast__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--green);
  color: var(--cream);
  border: 0;
  border-radius: 50%;
  flex: none;
}
@media (prefers-reduced-motion: reduce) {
  .cph-toast { transition: none; transform: none; }
  .cph-toast.is-in { transform: none; }
}

/* ---------- quote drawer (slides in on add, running total) ----------
   Transitions (not keyframes) so rapid adds retarget cleanly; drawer curve is the
   iOS-like cubic-bezier(0.32,0.72,0,1); exits the way it entered; reduced motion fades. */
.cph-drawer[hidden] { display: none !important; }
.cph-drawer { position: fixed; inset: 0; z-index: 220; }
.cph-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(34, 48, 31, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.cph-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(430px, 94vw);
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border-left: 2px solid var(--green);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  outline: none;
}
.cph-drawer.is-open .cph-drawer__overlay { opacity: 1; }
.cph-drawer.is-open .cph-drawer__panel { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  .cph-drawer__overlay { transition: opacity 0.2s ease; }
  .cph-drawer__panel { transform: none; opacity: 0; transition: opacity 0.2s ease; }
  .cph-drawer.is-open .cph-drawer__panel { opacity: 1; }
}
.cph-drawer-lock { overflow: hidden; }

.cph-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 2px solid var(--green);
  background: var(--paper);
}
.cph-drawer__title { font-size: 17px; }
.cph-drawer__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 2px solid var(--green);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.cph-drawer__x:hover { background: var(--red); border-color: var(--red); color: var(--cream); }

.cph-drawer__body { flex: 1; overflow-y: auto; padding: 14px 20px; }
.cph-drawer__items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cph-drawer__row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: var(--paper);
  border: 2px solid var(--green);
  border-radius: 10px;
  padding: 10px;
}
.cph-drawer__thumb { display: block; width: 56px; height: 56px; border: 2px solid var(--green); border-radius: 8px; overflow: hidden; }
.cph-drawer__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cph-drawer__noimg { display: block; width: 100%; height: 100%; background: repeating-linear-gradient(-45deg, var(--cream) 0 8px, var(--paper) 8px 16px); }
.cph-drawer__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cph-drawer__name { font-weight: 800; font-size: 14px; color: var(--ink); line-height: 1.2; overflow-wrap: anywhere; }
.cph-drawer__name:hover { color: var(--red); }
.cph-drawer__option { font-size: 12px; color: var(--ink-soft); }
.cph-drawer__qtyrow { display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; }
.cph-drawer__step {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: none;
  border: 2px solid var(--green);
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.cph-drawer__step:hover:not(:disabled) { background: var(--green); color: var(--cream); }
.cph-drawer__step:disabled { opacity: 0.35; cursor: default; }
/* 44px touch-target rule: the compact 34px visuals get an invisible hit-area
   ring (pseudo-elements hit-test as their button), matching /my-list/'s 44px.
   inset is from the PADDING box, so -8px = 2px border + 6px beyond the border
   box on each side → 34px visual, 46px effective target (≥44px). */
.cph-drawer__step::before,
.cph-drawer__remove::before {
  content: "";
  position: absolute;
  inset: -8px;
}
.cph-drawer__qty { min-width: 20px; text-align: center; font-weight: 800; }
.cph-drawer__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cph-drawer__lineprice { font-weight: 800; font-size: 13.5px; white-space: nowrap; }
.cph-drawer__remove {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: none;
  border: 2px solid var(--green);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.cph-drawer__remove:hover { background: var(--red); border-color: var(--red); color: var(--cream); }

.cph-drawer__empty { display: flex; flex-direction: column; gap: 6px; padding: 26px 4px; text-align: center; }

.cph-drawer__foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 18px 20px;
  border-top: 2px solid var(--green);
  background: var(--paper);
}
.cph-drawer__totals { display: flex; flex-direction: column; gap: 4px; }
.cph-drawer__totalrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.cph-drawer__totalval { font-family: var(--display); font-size: 22px; letter-spacing: 0; text-transform: none; }
.cph-drawer__poarow { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.cph-drawer__note { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.cph-drawer__send { text-align: center; }
.cph-drawer__browse,
.cph-drawer__browse-link {
  background: none;
  border: 0;
  padding: 10px;
  min-height: 44px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
}
.cph-drawer__browse-link:hover { color: var(--red); }

/* --- desktop: list beside the form, list scrolls in its own column --- */
@media (min-width: 1000px) {
  .mylist-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: clamp(28px, 3vw, 52px);
    align-items: start;
  }
  .mylist-layout__list {
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    padding-right: 12px;
    /* room for the scrollbar without clipping the row frames */
    scrollbar-width: thin;
    scrollbar-color: var(--green) rgba(20, 68, 43, 0.12);
    overscroll-behavior: contain;
  }
  .mylist-layout__list::-webkit-scrollbar { width: 10px; }
  .mylist-layout__list::-webkit-scrollbar-track { background: rgba(20, 68, 43, 0.1); border-radius: 999px; }
  .mylist-layout__list::-webkit-scrollbar-thumb { background: var(--green); border-radius: 999px; }
  .mylist-layout__form { position: sticky; top: 20px; }
  /* empty list → the form is hidden, so drop back to a single column */
  .mylist-layout__form:has(#cph-enquiry[hidden]) { display: none; }
  .mylist-layout:has(#cph-enquiry[hidden]) { grid-template-columns: minmax(0, 1fr); }
}

/* In the two-column layout the list column is ~440px wide, so the ≥640px viewport
   row (thumb | info | qty | remove on one line) squeezes the name to a few
   characters. Inside that column, go back to the stacked row. */
@media (min-width: 1000px) {
  .mylist-layout__list .mylist-row {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb info remove"
      "thumb qty qty";
  }
  .mylist-layout__list .mylist-row__thumb { width: 72px; height: 72px; }
  .mylist-layout__list .mylist-row__qty { justify-self: start; }
}
@media (min-width: 1400px) {
  .mylist-layout { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .mylist-layout__list .mylist-row {
    grid-template-columns: 88px minmax(0, 1fr) auto auto;
    grid-template-areas: "thumb info qty remove";
  }
  .mylist-layout__list .mylist-row__thumb { width: 88px; height: 88px; }
  .mylist-layout__list .mylist-row__qty { justify-self: end; }
}

/* Two columns need the real estate back — the narrow cap above is for the
   single-column (empty list / small screen) case only. */
@media (min-width: 1000px) {
  .mylist-page { max-width: 1500px; }
}
@media (min-width: 1600px) {
  .mylist-page { max-width: 1660px; }
  .mylist-layout__list { max-height: calc(100vh - 210px); }
}
