/* ==========================================================================
   MELODY — checkout. Builds on styles.css tokens + product.css form controls.
   ========================================================================== */

.page-checkout { background: var(--cream); }

/* ---------- Minimal header ---------- */
.co-header { border-bottom: 1px solid var(--line); background: var(--cream); }
.co-header__inner { height: var(--header-h); display: flex; align-items: center; gap: var(--s-5); }
.co-header__secure { display: none; align-items: center; gap: var(--s-2); margin: 0 auto; font-size: 14px; color: var(--cocoa-2); }
/* WhatsApp green so it is recognised at a glance; dark green text keeps it readable (white on #25D366 is too faint) */
.co-header__help { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-4) 0 var(--s-4); border-radius: 999px; background: #25D366; color: #053B22; font-size: 14px; font-weight: 600; transition: background-color .2s, box-shadow .2s; }
.co-header__help:hover { background: #20BD5A; box-shadow: 0 6px 18px -6px rgba(37,211,102,.6); }
.co-header svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.co-header__secure svg { color: var(--gold); }
@media (min-width: 720px) { .co-header__secure { display: inline-flex; } .co-header__help { margin-left: 0; } }
@media (max-width: 420px) { .co-header__help span { display: none; } .co-header__help { width: 44px; padding: 0; justify-content: center; } }

/* ---------- Layout ---------- */
.co { padding: var(--s-5) 0 var(--s-9); min-height: 70vh; }
.co-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-7); align-items: start; }
@media (min-width: 960px) {
  .co-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); gap: var(--s-8); }
  .co-side { position: sticky; top: var(--s-5); margin-top: var(--s-4); } /* card top on the breadcrumb line */
  .co-peek { display: none; }
}
@media (max-width: 959px) { .co-side { display: none; } }
.co-title { margin: 0 0 var(--s-5); font-family: var(--serif); font-weight: 350; font-size: clamp(2rem, 1.6rem + 1.6vw, 2.8rem); letter-spacing: -0.02em; line-height: 1.05; font-variation-settings: "SOFT" 100, "opsz" 144; }

/* ---------- Form ---------- */
.co-step { border: 0; margin: 0; padding: var(--s-6) 0 var(--s-2); border-top: 1px solid var(--line); min-width: 0; }
.co-step:first-of-type { border-top: 0; padding-top: var(--s-3); }
.co-step__legend { float: left; width: 100%; display: flex; align-items: center; gap: var(--s-3); padding: 0; margin-bottom: var(--s-4); font-family: var(--serif); font-size: 1.4rem; font-variation-settings: "SOFT" 100, "opsz" 36; }
.co-step > *:not(.co-step__legend) { clear: both; }
.co-step .choices { margin-bottom: var(--s-5); }
/* Delivery: the chosen option opens into one card with its own details (pickup note, address, easybox search) */
.ship-opt { border-radius: var(--radius); border: 1.5px solid var(--line-strong); background: var(--paper); transition: border-color .2s, box-shadow .3s var(--ease-out), background-color .2s; }
.ship-opt:hover { border-color: var(--cocoa-3); }
.ship-opt:has(> .choice--soon):hover { border-color: var(--line-strong); }
.ship-opt:has(> .choice input:checked) { border-color: var(--cocoa); background: #fff; box-shadow: 0 0 0 4px rgba(205,174,132,.28); }
.ship-opt > .choice, .ship-opt > .choice:has(input:checked) { border: 0; background: none; box-shadow: none; }
.ship-panel { margin: 0 var(--s-4); padding: var(--s-4) 0 var(--s-4); border-top: 1px solid var(--line); }
.ship-panel[hidden] { display: none; }
.co-panel-title { margin: 0 0 var(--s-4); font-family: var(--serif); font-size: 1.15rem; line-height: 1.3; color: var(--cocoa); font-variation-settings: "SOFT" 100, "opsz" 36; }
.ship-panel > :last-child { margin-bottom: 0; }
/* Personal pickup: where and how, instead of the address fields */
.co-pickup { display: flex; gap: var(--s-3); align-items: flex-start; }
.co-pickup svg { width: 22px; height: 22px; flex: none; margin-top: 2px; fill: none; stroke: var(--ember-ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.co-pickup p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--cocoa-2); }
.co-pickup b { color: var(--cocoa); font-weight: 600; }
.co-step .choice__icon svg { width: 22px; height: 22px; }
.choice[hidden] { display: none; }
/* Card until PayU approves the shop, easybox until the Sameday API is set up: shown, not selectable */
.choice--soon { cursor: not-allowed; }
.choice--soon:hover { border-color: var(--line-strong); }
.choice--soon > :not(.choice__badge) { opacity: .5; }
.choice__badge[hidden] { display: none; }

/* Easybox: Sameday map button, search, results, the chosen locker */
.co-locker-map { display: flex; align-items: center; gap: var(--s-3); width: 100%; margin: 0 0 var(--s-3); padding: var(--s-3) var(--s-4); border-radius: 14px; border: 1.5px solid var(--cocoa); background: var(--cocoa); color: #fff; font: inherit; text-align: left; cursor: pointer; transition: box-shadow .2s, background-color .2s, transform .2s; }
.co-locker-map:hover { box-shadow: 0 0 0 4px rgba(205,174,132,.28); transform: translateY(-1px); }
.co-locker-map:active { transform: none; }
.co-locker-map:focus-visible { outline: 2px solid var(--ember-ink); outline-offset: 3px; }
.co-locker-map[aria-busy="true"] { opacity: .6; cursor: progress; }
.co-locker-map[hidden] { display: none; }
.co-locker-map svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.co-locker-map span { display: grid; gap: 2px; flex: 1; }
.co-locker-map b { font-weight: 600; font-size: 15px; }
.co-locker-map span span { font-size: 13.5px; color: rgba(255,255,255,.78); }
/* A trailing "Deschide harta ›" pill, so the box reads as a button and not as a plain info card */
.co-locker-map::after { content: "Deschide harta \203A"; flex: none; padding: 8px 14px; border-radius: 999px; background: #fff; color: var(--cocoa); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
@media (max-width: 520px) { .co-locker-map::after { content: "\203A"; padding: 4px 12px; font-size: 20px; line-height: 1.2; } }
.co-easybox .field { margin-bottom: var(--s-2); }
/* "— sau —" between the map button (main way) and the search (the other way) */
.co-or { display: flex; align-items: center; gap: var(--s-3); margin: 0 0 var(--s-3); color: var(--cocoa-3); font-size: 13px; }
.co-or::before, .co-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.co-locker-search { display: flex; gap: var(--s-2); }
.co-locker-search input { flex: 1; min-width: 0; }
.co-locker-near { flex: none; display: inline-flex; align-items: center; gap: var(--s-1); min-height: 48px; padding: 0 var(--s-4); border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; color: var(--cocoa); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color .2s; }
.co-locker-near:hover { border-color: var(--cocoa-3); }
.co-locker-near:focus-visible { outline: 2px solid var(--ember-ink); outline-offset: 3px; }
.co-locker-near[aria-busy="true"] { opacity: .6; cursor: progress; }
.co-locker-near svg, .co-locker-chosen svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 420px) { .co-locker-near span { display: none; } .co-locker-near { width: 48px; padding: 0; justify-content: center; } }
.co-lockers__status { margin: 0 0 var(--s-2); font-size: 14px; color: var(--cocoa-2); }
.co-lockers__status:empty { display: none; }
.co-lockers { display: grid; gap: var(--s-1); max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.co-lockers:empty { display: none; }
.co-locker { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s-3); width: 100%; padding: var(--s-3) var(--s-4); border-radius: 14px; border: 1px solid var(--line); background: var(--paper); color: var(--cocoa); font: inherit; text-align: left; cursor: pointer; transition: border-color .2s, background-color .2s; }
.co-locker:hover { border-color: var(--cocoa-3); background: #fff; }
.co-locker:focus-visible { outline: 2px solid var(--ember-ink); outline-offset: 2px; }
.co-locker__name { font-weight: 600; font-size: 15px; }
.co-locker__addr { grid-column: 1; font-size: 13.5px; color: var(--cocoa-2); }
.co-locker__note { grid-column: 1; font-size: 13px; font-weight: 600; color: var(--ember-ink); }
.co-locker__km { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 13.5px; color: var(--cocoa-2); white-space: nowrap; }
.co-locker-chosen { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-4) var(--s-4) var(--s-4) var(--s-4); border-radius: 16px; background: #fff; border: 1.5px solid var(--cocoa); box-shadow: 0 0 0 4px rgba(205,174,132,.28); }
.co-easybox [hidden] { display: none; }
.co-locker-chosen svg { width: 22px; height: 22px; color: var(--ember-ink); }
.co-locker-chosen p { flex: 1; min-width: 0; margin: 0; display: grid; gap: 2px; font-size: 14px; line-height: 1.45; color: var(--cocoa-2); }
.co-locker-chosen b { color: var(--cocoa); font-size: 15px; font-weight: 600; }
.co-locker-change { flex: none; padding: var(--s-2) var(--s-1); border: 0; background: none; color: var(--cocoa); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.co-row { display: grid; gap: 0 var(--s-4); }
@media (min-width: 600px) { .co-row--2 { grid-template-columns: 1fr 1fr; } }
/* Street + number; block / staircase / floor / flat (2 per row on phones) */
.co-row--street { grid-template-columns: 1fr 104px; }
@media (min-width: 600px) { .co-row--street { grid-template-columns: 1fr 140px; } }
.co-row--4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 600px) { .co-row--4 { grid-template-columns: repeat(4, 1fr); } }
.field { display: grid; align-content: start; gap: var(--s-2); margin-bottom: var(--s-4); min-width: 0; }
.field label { font-size: 14px; font-weight: 600; color: var(--cocoa); }
.field__opt { font-weight: 400; color: var(--cocoa-3); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: var(--s-3) var(--s-4); border-radius: 12px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--cocoa);
  font: inherit; font-size: 16px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 64px; }
.field select { appearance: none; padding-right: 40px; /* room for the arrow */ background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A4A40' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center / 16px no-repeat; }
.field select:disabled { background-color: var(--paper); color: var(--cocoa-3); cursor: not-allowed; }
.field input::placeholder,.field textarea::placeholder { color: var(--cocoa-3); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--cocoa); box-shadow: 0 0 0 3px rgba(205,174,132,.35); }
.field [aria-invalid="true"] { border-color: #B3261E; box-shadow: 0 0 0 3px rgba(179,38,30,.1); }
.field__hint { margin: 0; font-size: 13px; color: var(--cocoa-3); }
.field__err { margin: 0; font-size: 13px; color: #B3261E; }

/* Company toggle */
.toggle { display: flex; align-items: flex-start; gap: var(--s-3); cursor: pointer; padding: var(--s-1) 0 var(--s-4); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__ui { flex: none; position: relative; width: 44px; height: 26px; margin-top: 1px; border-radius: 999px; background: var(--sand); transition: background-color .25s; }
.toggle__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .3s var(--ease-out); }
.toggle input:checked + .toggle__ui { background: var(--cocoa); }
.toggle input:checked + .toggle__ui::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle__ui { outline: 2px solid var(--ember-ink); outline-offset: 3px; }
.toggle__text { display: grid; gap: 2px; font-size: 14px; color: var(--cocoa-2); }
.toggle__text b { color: var(--cocoa); font-weight: 600; font-size: 15px; }
.co-company { padding: var(--card-pad) var(--card-pad) var(--s-2); border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); margin-bottom: var(--s-4); }


/* Payment badge (lighter than the product page badge) */
.choice__badge--soft { background: var(--cream); color: var(--ember-ink); border: 1px solid rgba(164,75,29,.3); }

/* Terms + submit */
.co-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.co-final { padding-top: var(--s-6); border-top: 1px solid var(--line); }
.co-terms { display: flex; align-items: flex-start; gap: var(--s-3); font-size: 14.5px; color: var(--cocoa-2); cursor: pointer; }
.co-terms input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--cocoa); cursor: pointer; }
.co-terms a { color: var(--cocoa); text-decoration: underline; text-underline-offset: 3px; }
.co-final .field__err { margin-top: var(--s-2); }
.co-final__note { margin: var(--s-3) 0 0; text-align: center; font-size: 13.5px; color: var(--cocoa-2); }

/* Error summary */
.co-errors { margin-bottom: var(--s-5); padding: var(--s-4) var(--s-4); border-radius: var(--radius); background: #FBEDEA; color: #8C1D18; outline: none; }
.co-errors p { margin: 0 0 var(--s-2); }
.co-errors ul { margin: 0; padding-left: var(--s-5); display: grid; gap: 2px; font-size: 14.5px; }
.co-errors a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Summary ---------- */
.co-summary { padding: var(--card-pad); border-radius: var(--radius-lg); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.co-summary__title { margin: 0 0 var(--s-3); font-family: var(--serif); font-weight: 400; font-size: 1.5rem; font-variation-settings: "SOFT" 100, "opsz" 36; }
.co-item { display: flex; gap: var(--s-3); padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.co-item:first-child { padding-top: var(--s-2); }
.co-item__thumb { position: relative; flex: none; }
.co-item__thumb img { width: 56px; height: 56px; border-radius: 50%; clip-path: circle(47%); animation: spin 5.4s linear infinite; }
.co-item__qty { position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--cocoa); color: var(--paper); font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.co-item__info { flex: 1; min-width: 0; }
.co-item__head { display: flex; justify-content: space-between; gap: var(--s-2); align-items: baseline; }
.co-item__head h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.co-item__head strong { font-family: var(--serif); font-weight: 400; font-size: 1.1rem; white-space: nowrap; }
.co-item ul { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; gap: 3px; }
.co-item li { display: flex; justify-content: space-between; gap: var(--s-2); font-size: 13.5px; color: var(--cocoa-2); }
.co-item li.co-item__unit { margin-top: var(--s-1); font-weight: 600; color: var(--cocoa); }
.co-totals { margin: var(--s-4) 0 0; display: grid; gap: var(--s-2); }
.co-totals div { display: flex; justify-content: space-between; gap: var(--s-3); font-size: 15px; }
.co-totals dt { color: var(--cocoa-2); }
.co-totals dt span { color: var(--cocoa-3); font-size: 13.5px; }
.co-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.co-totals__total { margin-top: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--line); align-items: baseline; }
.co-totals__total dt { color: var(--cocoa); font-weight: 600; }
.co-totals__total dd { font-family: var(--serif); font-size: 1.7rem; font-variation-settings: "SOFT" 100, "opsz" 48; }
.co-summary__vat { margin: var(--s-1) 0 0; text-align: right; font-size: 12.5px; color: var(--cocoa-3); }
.co-assure { list-style: none; margin: var(--s-5) 0 0; padding: var(--s-5) 0 0; border-top: 1px solid var(--line); display: grid; gap: var(--s-2); font-size: 13.5px; color: var(--cocoa-2); }
.co-assure li { display: flex; gap: var(--s-2); align-items: flex-start; }
.co-assure svg { width: 18px; height: 18px; flex: none; color: var(--gold); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Mobile collapsible summary */
.co-peek { margin-bottom: var(--s-5); border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.co-peek summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-4); min-height: 52px; cursor: pointer; font-size: 15px; font-weight: 500; }
.co-peek summary::-webkit-details-marker { display: none; }
.co-peek summary span { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--ember-ink); }
.co-peek summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.co-peek summary strong { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; }
.co-peek__body { padding: 0 var(--s-4) var(--s-4); }

/* ---------- Empty + confirmation ---------- */
.co-empty, .co-done { display: grid; justify-items: center; text-align: center; padding: var(--s-9) 0; }
.co-empty img { width: 120px; height: 120px; border-radius: 50%; clip-path: circle(47%); margin-bottom: var(--s-5); }
.co-empty p { color: var(--cocoa-2); margin: var(--s-3) 0 var(--s-6); }
.co-done { outline: none; max-width: var(--wrap-text); margin: 0 auto; }
.co-done__disc { width: 140px; margin-bottom: var(--s-6); filter: drop-shadow(0 18px 30px rgba(60,35,20,.35)); }
.co-done__disc img { width: 140px; height: 140px; border-radius: 50%; clip-path: circle(47%); }
.co-done__lead { max-width: 34em; margin: var(--s-5) 0 0; color: var(--cocoa-2); font-size: 1.05rem; }
.co-done__steps { list-style: none; margin: var(--s-7) 0 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); position: relative; }
.co-done__steps::before { content: ""; position: absolute; top: 26px; left: 16.66%; right: 16.66%; height: 2px; background: linear-gradient(90deg, var(--cocoa) 0 50%, var(--line-strong) 50%); }
.co-done__steps li { position: relative; display: grid; justify-items: center; gap: 2px; padding: 0 var(--s-1); }
.co-done__steps li:last-child .track__dot { background: var(--paper); color: var(--cocoa); border: 2px solid var(--cocoa); }
.co-done__steps b { font-family: var(--serif); font-weight: 400; font-size: 1.02rem; }
.co-done__steps li > span:last-child { font-size: 13px; color: var(--cocoa-2); }
.co-done__box { width: 100%; margin-top: var(--s-7); padding: var(--card-pad); text-align: left; border-radius: var(--radius-lg); background: var(--paper); border: 1px solid var(--line); }
.co-done__box h2 { margin: 0 0 var(--s-2); font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.co-done__box p { margin: var(--s-2) 0 0; font-size: 14.5px; color: var(--cocoa-2); }
.co-done__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); margin-top: var(--s-7); }

/* ---------- Footer ---------- */
.co-footer { border-top: 1px solid var(--line); padding: var(--s-5) 0; font-size: 13px; color: var(--cocoa-3); }
.co-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); }
.co-footer .co-footer__badges { justify-content: flex-start; align-items: center; gap: var(--s-5); margin-bottom: var(--s-4); }
.co-footer a:hover { color: var(--cocoa); }
.co-footer .co-footer__company { margin-top: var(--s-3); margin-bottom: 0; font-size: 12.5px; line-height: 1.6; }
