/* ============================================================
   Bilad — storefront components (cart, product, checkout,
   account, forms, policy pages). Loads after styles.css on
   every page; uses its tokens.
   ============================================================ */

/* ---- Nav: cart button, current page, mobile menu ---- */
.nav__menu .is-current { color: var(--saffron); }

.nav__cart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 36px;
  font-size: 14px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border: 1px solid currentColor;
  transition: background 200ms ease, color 200ms ease;
}

.nav__cart:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.nav__cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--saffron);
  color: var(--paper);
  font-size: 12px;
  border-radius: 999px;
}

.nav__toggle {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  padding: 8px 4px;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.nav__toggle span,
.nav__toggle span::before {
  display: block;
  width: 16px;
  height: 1px;
  background: currentColor;
  position: relative;
}

.nav__toggle span::before { content: ''; position: absolute; top: 5px; }
.nav__toggle span { margin-bottom: 5px; }

@media (max-width: 800px) {
  .nav__cart { margin-left: auto; }
  .nav__toggle { display: inline-flex; }
  .nav.is-open { background: var(--paper); color: var(--ink); box-shadow: 0 1px 0 var(--hairline); }
  .nav.is-open .nav__menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    gap: 18px;
    padding: 20px var(--gutter) 28px;
    background: var(--paper);
    color: var(--ink);
    font-size: 16px;
    box-shadow: 0 1px 0 var(--hairline);
  }
}

/* ---- Category filters ---- */
.filters { display: flex; gap: 4px; flex-wrap: wrap; }

.filter {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--stone);
  border: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}

.filter:hover { color: var(--ink); }
.filter.is-active { color: var(--ink); border-color: var(--hairline); background: var(--paper); }

/* ---- Shared page scaffolding ---- */
.page-head {
  padding: 128px 0 40px 0;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 48px;
}

.page-head__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 12px 0;
}

.page-head__sub { font-size: 16px; color: var(--stone); margin: 0; max-width: 56ch; }

.breadcrumb {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--stone);
  margin: 0 0 24px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.breadcrumb a:hover { color: var(--ink); }

.page-body { padding-bottom: 120px; }

.prose { max-width: 70ch; font-size: 16px; line-height: 1.7; }
.prose h2 { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.2; margin: 48px 0 16px 0; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 16px; font-weight: 500; margin: 32px 0 8px 0; }
.prose ul { padding-left: 20px; margin: 0 0 1em 0; }
.prose li { margin-bottom: 8px; }
.prose a { border-bottom: 1px solid var(--hairline); }
.prose a:hover { color: var(--saffron); border-color: var(--saffron); }

.data-table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 24px 0; }
.data-table th, .data-table td { text-align: left; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.data-table thead th { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stone); font-weight: 500; }

.notice {
  border: 1px solid var(--hairline);
  background: #efe9dd;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.notice--error { border-color: #c9a39a; background: #f4e4df; }

.muted { color: var(--stone); }

/* ---- Buttons ---- */
.btn-primary[disabled], .btn-primary.is-busy { opacity: 0.55; pointer-events: none; }
.btn-primary--block { width: 100%; justify-content: center; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  border: 1px solid var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 200ms ease, color 200ms ease;
}

.btn-outline:hover { background: var(--ink); color: var(--paper); }

.link-button { font-size: 13px; color: var(--stone); text-decoration: underline; padding: 0; }
.link-button:hover { color: var(--ink); }

/* ---- Forms ---- */
fieldset.form { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.form[disabled] { opacity: 0.6; }
.form { display: flex; flex-direction: column; gap: 20px; }
.form__section { display: flex; flex-direction: column; gap: 16px; }
.form__section + .form__section { border-top: 1px solid var(--hairline); padding-top: 28px; }
.form__title { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field__label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--stone); }

.field input, .field select, .field textarea {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: #fbf9f5;
  border: 1px solid var(--hairline);
  padding: 13px 14px;
  border-radius: 0;
  width: 100%;
}

.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.field__hint { font-size: 13px; color: var(--stone); margin: 0; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row--3 { grid-template-columns: 2fr 1fr 1fr; }

@media (max-width: 600px) {
  .field-row, .field-row--3 { grid-template-columns: 1fr; }
}

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--ink); flex: none; }

.form-error { color: #9a3b2a; font-size: 14px; margin: 0; }
.form-error:empty { display: none; }

/* ---- Option cards (payment plan) ---- */
.options { display: flex; flex-direction: column; gap: 10px; }

.option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  cursor: pointer;
  background: #fbf9f5;
}

.option:has(input:checked) { border-color: var(--ink); background: var(--paper); }
.option input { margin-top: 4px; accent-color: var(--ink); width: 18px; height: 18px; }
.option__title { font-weight: 500; font-size: 15px; display: block; }
.option__desc { font-size: 13px; color: var(--stone); display: block; margin-top: 2px; }
.option__amount { font-size: 15px; font-weight: 500; white-space: nowrap; }

/* ---- Media placeholder (no product photo yet) ---- */
.media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--stone);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background:
    repeating-linear-gradient(45deg,
      rgba(138,130,120,0.07) 0px,
      rgba(138,130,120,0.07) 1px,
      transparent 1px,
      transparent 8px),
    var(--linen);
}

/* ---- Delivery + stock badges ---- */
.delivery {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.delivery::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--stone);
  flex: none;
}

.delivery--in-stock::before { background: #5f7a4a; }
.low-stock { font-size: 13px; color: var(--saffron); margin: 0; }

/* ---- Product page ---- */
.pdp {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 72px;
  padding-top: 112px;
  padding-bottom: 120px;
  align-items: start;
}

.pdp__gallery { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 100px; }
.pdp__main { aspect-ratio: 4 / 5; background: var(--linen); overflow: hidden; }
.pdp__main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp__thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.pdp__thumb { width: 72px; height: 72px; padding: 0; border: 1px solid transparent; overflow: hidden; }
.pdp__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp__thumb.is-active { border-color: var(--ink); }

.pdp__info { display: flex; flex-direction: column; gap: 24px; }
.pdp__title { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 3.6vw, 46px); line-height: 1.08; margin: 0; letter-spacing: -0.01em; }

.price-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price-line__amount { font-size: 26px; font-weight: 500; }
.price-line__was { font-size: 16px; color: var(--stone); text-decoration: line-through; }
.price-line__unit { font-size: 14px; color: var(--stone); }
.price-line__tag { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--saffron); }

.pdp__facts { display: flex; flex-direction: column; gap: 10px; padding: 20px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.pdp__freight { font-size: 13px; color: var(--stone); margin: 0; line-height: 1.55; }

.pdp__buy { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.pdp__desc { font-size: 16px; line-height: 1.7; margin: 0; }
.pdp__section-title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stone); margin: 0 0 10px 0; }
.pdp__maker { font-size: 15px; line-height: 1.65; margin: 0 0 12px 0; }
.pdp__help { font-size: 14px; color: var(--stone); margin: 0; }
.pdp__help a { color: var(--ink); border-bottom: 1px solid var(--hairline); }

@media (max-width: 900px) {
  .pdp { grid-template-columns: 1fr; gap: 32px; padding-top: 96px; }
  .pdp__gallery { position: static; }
  .pdp__main { aspect-ratio: 1 / 1; }
}

/* ---- Quantity stepper ---- */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--hairline); background: #fbf9f5; }
.qty__btn { width: 40px; height: 52px; font-size: 18px; }
.qty__btn:hover { background: var(--linen); }
.qty__input {
  width: 64px;
  height: 52px;
  border: 0;
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  text-align: center;
  font-family: var(--sans);
  font-size: 16px;
  background: transparent;
  -moz-appearance: textfield;
}
.qty__input::-webkit-inner-spin-button, .qty__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty__unit { padding: 0 12px; font-size: 13px; color: var(--stone); }
.qty--small .qty__btn { width: 28px; height: 30px; font-size: 15px; }
.qty--small .qty__input { width: 40px; height: 30px; font-size: 14px; }

/* ---- Order drawer ---- */
.drawer { position: fixed; inset: 0; z-index: 200; }
.drawer[hidden] { display: none; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(26,23,21,0.55); }

.drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(460px, 100vw);
  background: var(--paper);
  padding: 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer__head { display: flex; justify-content: space-between; align-items: center; }
.drawer__title { font-family: var(--display); font-weight: 400; font-size: 28px; margin: 0; }
.drawer__note { margin: 0; }
.drawer__items { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.drawer__empty { color: var(--stone); font-size: 14px; padding: 32px 0; text-align: center; }

.icon-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  font-size: 20px;
  line-height: 1;
}

.line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}

.line__media { width: 64px; height: 64px; overflow: hidden; background: var(--linen); }
.line__media img { width: 100%; height: 100%; object-fit: cover; }
.line__media .media-placeholder { font-size: 8px; padding: 4px; }
.line__name { font-size: 14px; font-weight: 500; margin: 0; line-height: 1.35; }
.line__meta { font-size: 12px; color: var(--stone); margin: 3px 0 8px 0; }
.line__controls { display: flex; gap: 14px; align-items: center; }
.line__price { font-size: 14px; font-weight: 500; text-align: right; white-space: nowrap; }

.totals { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.totals .row { display: flex; justify-content: space-between; gap: 16px; }
.totals .row--total { font-weight: 500; font-size: 17px; border-top: 1px solid var(--hairline); padding-top: 10px; }
.totals .row--strong { font-weight: 500; }

/* ---- Checkout ---- */
.checkout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 72px;
  align-items: start;
  padding-bottom: 120px;
}

.summary {
  position: sticky;
  top: 100px;
  background: #efe9dd;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.summary__title { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 0; }
.summary .line { border-bottom-color: #ddd3c2; }

#payment-element { min-height: 40px; }

@media (max-width: 900px) {
  .checkout { grid-template-columns: 1fr; gap: 40px; }
  .summary { position: static; order: -1; }
}

/* ---- Account / trade ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 40px; } }

.panel { border: 1px solid var(--hairline); padding: 28px; display: flex; flex-direction: column; gap: 16px; }

.status-pill {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid var(--hairline);
}

.status-pill--approved { border-color: #5f7a4a; color: #3f5530; }
.status-pill--pending { border-color: var(--saffron); color: #8a531c; }

.order-list { display: flex; flex-direction: column; }
.order-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 16px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; }

/* ---- Footer contact line ---- */
.footer__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-size: 14px;
  margin: -40px 0 32px 0;
}

.footer__contact a:hover { color: var(--saffron); }
.footer__bottom a:hover { color: var(--ink); }

/* ---- Audience landing pages (/for-homes, /for-designers) ---- */
.lp-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding-top: 128px;
  padding-bottom: 96px;
}

.lp-hero__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 24px 0;
}

.lp-hero__lede { font-size: 18px; line-height: 1.6; max-width: 44ch; margin: 0 0 32px 0; }
.lp-hero__ctas { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.lp-hero__figure { margin: 0; }
.lp-hero__figure img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.lp-hero__figure figcaption { font-size: 12px; color: var(--stone); margin-top: 8px; }

.lp-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hairline);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 96px;
}

.lp-point { background: var(--paper); padding: 40px 36px 40px 0; }
.lp-point + .lp-point { padding-left: 36px; }
.lp-point__title { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 0 0 10px 0; }
.lp-point__body { font-size: 15px; line-height: 1.65; margin: 0; }

.lp-section { padding: 0 0 96px 0; }
.lp-section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.lp-section__title { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 3.5vw, 40px); margin: 0; }

@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; gap: 32px; padding-top: 104px; padding-bottom: 56px; }
  .lp-hero__figure { order: -1; }
  .lp-hero__figure img { aspect-ratio: 3 / 2; }
  .lp-points { grid-template-columns: 1fr; }
  .lp-point, .lp-point + .lp-point { padding: 28px 0; }
}
