/* Waldart main stylesheet — base / components / sections / pages.
   All values come from tokens.css; no raw colors below this line. */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
.np a:hover { color: var(--brand); }
.np :is(h1, h2, h3, p) { margin: 0 0 var(--space-3); }
.np { line-height: 1.55; }
.h-2xl { font-size: var(--h-2xl); line-height: 1.1; font-weight: 700; }
.h-xl { font-size: var(--h-xl); line-height: 1.15; font-weight: 700; }
.h-lg { font-size: var(--h-lg); line-height: 1.2; font-weight: 700; }
.h-md { font-size: var(--h-md); font-weight: 700; }
.h-sm { font-size: var(--h-sm); font-weight: 700; }
.h-xs { font-size: var(--h-xs); font-weight: 700; }
.text-lg { font-size: var(--t-lg); } .text-sm { font-size: var(--t-sm); }
.text-xs { font-size: var(--t-xs); }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-4); }
.narrow { max-width: 760px; }
.section { padding: var(--space-6) 0; }
.section--tint { background: var(--surface-tint); }
.section--dark { background: var(--gray-900); color: var(--gray-100); }
.section--dark .h-lg { color: #fff; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; }

/* ---------- components ---------- */
.btn {
  display: inline-block; border: 1.5px solid transparent; cursor: pointer;
  border-radius: var(--radius-pill); padding: .8rem 1.8rem;
  font: 700 var(--t-sm)/1 var(--font); letter-spacing: .06em;
  text-transform: uppercase; transition: background .15s, color .15s;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--green-600); color: #fff; }
.btn--dark { background: var(--gray-900); color: #fff; }
.btn--outline { border-color: var(--border); background: var(--surface); }
.btn--sm { padding: .55rem 1.2rem; font-size: var(--t-xs); }
.btn--block { display: block; width: 100%; text-align: center; }
.btn[disabled] { background: var(--gray-200); color: var(--gray-400); cursor: not-allowed; }

.input {
  width: 100%; padding: .7rem .9rem; font: var(--t-md) var(--font);
  border: 1px solid var(--gray-300); border-radius: 8px; background: var(--surface);
  color: var(--text-primary);
}
.input:focus { outline: 2px solid var(--green-300); border-color: var(--brand); }
.field { margin-bottom: var(--space-3); }
.field label { display: block; font-size: var(--t-sm); margin-bottom: var(--space-1); }
.field-row { display: grid; grid-template-columns: 1fr 2fr; gap: var(--space-3); }
.error { color: var(--red-700); background: var(--red-50); border-radius: 8px; padding: .6rem .9rem; }
.success { color: var(--green-700); background: var(--green-50); border-radius: 8px; padding: .6rem .9rem; }

.chips { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); padding: .45rem 1rem; cursor: pointer;
  font: var(--t-sm) var(--font);
}
.chip[aria-pressed="true"] { border-color: var(--brand); outline: 2px solid var(--green-200); }
.chip--swatch { padding: 4px; border-radius: 50%; line-height: 0; }
.chip--swatch img { border-radius: 50%; object-fit: cover; width: 34px; height: 34px; }

.iconbtn { background: none; border: 0; font-size: 1.6rem; cursor: pointer; line-height: 1; color: var(--text-primary); }

.placeholder--moss {
  background:
    radial-gradient(ellipse 60% 50% at 30% 40%, var(--green-300), transparent),
    radial-gradient(ellipse 50% 60% at 70% 60%, var(--green-600), transparent),
    var(--green-800);
}

/* ---------- sections ---------- */

.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: var(--space-4); border-bottom: 1px solid var(--border); }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--space-4); }
.drawer__foot { padding: var(--space-4); border-top: 1px solid var(--border); }
.drawer__total { display: flex; justify-content: space-between; margin-bottom: var(--space-3); }
.cartline { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.cartline__thumb { width: 56px; height: 56px; border-radius: 8px; }
.cartline__qty { display: inline-flex; align-items: center; gap: var(--space-2); }
.cartline__qty button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.cart__actions { max-width: 420px; margin-top: var(--space-4); }

/* ---------- PDP ---------- */
.pdp { padding-top: var(--space-4); }
.breadcrumb { margin-bottom: var(--space-4); }
.pdp__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--space-6); }
.pdp__main { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; }
.pdp__main img, .card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp__price { color: var(--text-primary); }
.pdp__usps { list-style: none; padding: 0; color: var(--text-muted); }
.pdp__usps li::before { content: "✓ "; color: var(--brand); font-weight: 700; }
.pdp__option { margin: var(--space-3) 0; }

/* ---------- checkout ---------- */
.checkout__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-6); align-items: start; }
.checkout__summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4); position: sticky; top: var(--space-4); box-shadow: var(--shadow); }
.co-summary__title { margin: 0 0 var(--space-3); }
.checkout__form .field { margin-bottom: var(--space-3); }
.paymethods { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-3); }
.paymethod { border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; cursor: pointer; transition: border-color .15s, background .15s; }
.paymethod:has(input:checked) { border-color: var(--brand); background: var(--green-25); }
.stripe-box { margin: var(--space-3) 0; }
.co-legal { margin-top: var(--space-2); }

/* order summary — item rows with thumbnails */
.co-items { margin-bottom: var(--space-3); }
.co-item { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; }
.co-item + .co-item { border-top: 1px solid var(--border); }
.co-item__thumb { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-tint); }
.co-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.co-item__qty { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--gray-900); color: #fff; font-size: var(--t-xs); font-weight: 600; display: flex; align-items: center; justify-content: center; line-height: 1; }
.co-item__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.co-item__name { font-weight: 500; color: var(--text-primary); font-size: var(--t-sm); line-height: 1.3; }
.co-item__meta { color: var(--text-muted); font-size: var(--t-xs); }
.co-item__price { font-weight: 500; color: var(--text-primary); font-size: var(--t-sm); white-space: nowrap; }

/* totals block */
.co-totals { border-top: 1px solid var(--border); margin-top: var(--space-3); padding-top: var(--space-2); }
.sumline { display: flex; justify-content: space-between; padding: var(--space-2) 0; font-size: var(--t-sm); color: var(--text-primary); }
.sumline--muted { color: var(--text-muted); font-size: var(--t-xs); }
.sumline--total { margin-top: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border); font-size: var(--t-lg); align-items: baseline; }
.sumline--total strong { font-weight: 600; }
.co-credit { color: var(--brand); }

/* collapsible discount / gift-card */
.co-collapse { border-top: 1px solid var(--border); }
.co-collapse > summary { cursor: pointer; list-style: none; padding: var(--space-3) 0; font-size: var(--t-sm); color: var(--brand); font-weight: 500; display: flex; align-items: center; justify-content: space-between; }
.co-collapse > summary::-webkit-details-marker { display: none; }
.co-collapse > summary::after { content: "+"; font-size: var(--t-lg); color: var(--text-muted); line-height: 1; }
.co-collapse[open] > summary::after { content: "\2013"; }
.co-collapse[open] > summary { padding-bottom: var(--space-2); }
.coupon-row { display: flex; gap: 8px; padding-bottom: var(--space-2); }
.coupon-row .input { flex: 1; text-transform: uppercase; }
.coupon-row .btn { white-space: nowrap; }
.coupon-msg { margin: 0 0 var(--space-2); }
.coupon-msg.is-ok { color: var(--green-600); }
.coupon-msg.is-err { color: var(--red-700); }
.price-was { color: var(--gray-400); font-weight: 400; margin-right: 6px; text-decoration-thickness: 1px; }
.price-now { color: var(--green-600); }

/* trust row */
.co-trust { list-style: none; padding: var(--space-3) 0 0; margin: var(--space-2) 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.co-trust li { font-size: var(--t-xs); color: var(--text-muted); padding-left: 20px; position: relative; }
.co-trust li::before { content: "\2713"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }

/* business / VAT-ID disclosure */
.biz-details { margin: var(--space-2) 0 var(--space-3); border: 1px solid var(--border); border-radius: 10px; padding: .7rem .9rem; }
.biz-details > summary { cursor: pointer; color: var(--text-muted); font-size: var(--t-sm); }
.biz-details[open] > summary { margin-bottom: var(--space-2); }

/* billing-same — proper toggle switch */
.co-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-2) 0 var(--space-3); padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 10px; }
.co-switch__text { display: flex; flex-direction: column; gap: 2px; }
.co-switch__title { font-size: var(--t-sm); font-weight: 500; color: var(--text-primary); }
.co-switch__hint { font-size: var(--t-xs); color: var(--text-muted); }
.co-toggle { position: relative; flex: none; cursor: pointer; }
.co-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.co-toggle__track { display: block; width: 44px; height: 24px; border-radius: 999px; background: var(--gray-300); transition: background .18s; }
.co-toggle__thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(10,13,18,.2); transition: transform .18s; }
.co-toggle input:checked + .co-toggle__track { background: var(--brand); }
.co-toggle input:checked + .co-toggle__track .co-toggle__thumb { transform: translateX(20px); }
.co-toggle input:focus-visible + .co-toggle__track { outline: 2px solid var(--green-300); outline-offset: 2px; }


/* hidden summary lines must actually hide (class display beats [hidden]) */
.sumline[hidden] { display: none !important; }

/* header cart badge — count floating on the cart icon */
.header__cart { position: relative; display: inline-flex; }
.header__cart .header__badge {
  position: absolute; top: -6px; right: -8px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 9999px; background: var(--brand); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; font-weight: 600;
}


/* cart icon count badge (desktop + mobile) */
.open-cart-modal { position: relative; }
.cart-badge {
  position: absolute; top: -4px; right: -6px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 9999px; background: var(--brand); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; font-weight: 600;
  pointer-events: none;
}
.cart-badge[hidden] { display: none; }

/* ---------- text pages ---------- */
.textpage__lede { max-width: 620px; margin: 0 auto var(--space-5); }
.textpage__body { max-width: 720px; margin: 0 auto; }
.textpage__body h2 { font-size: var(--h-xs); margin-top: var(--space-4); }
.empty { padding: var(--space-6) 0; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .grid--cards, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .pdp__grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .grid--cards, .grid--4 { grid-template-columns: 1fr; }
  /* one column on phones — form first, order summary below */
  .checkout__grid { grid-template-columns: 1fr; }
  .checkout__summary { position: static; top: auto; }
  .field-row { grid-template-columns: 1fr; }
  .cartline { grid-template-columns: 48px 1fr auto; }
}
  