/* ===========================================================================
   HOMESARA THEME — page-product-mattress.css
   Layers on top of page-product-normal.css (see inc/enqueue.php) — like
   page-product-fabric.css, this is NOT a copy of legacy/product-mattress.css
   (behavior-spec mockup only, plan §5). This is the real delta: the
   Select Size / Thickness row and the WhatsApp CTA box, rebuilt as proper
   classes from the exact inline-style values the mockup specified.

   The Select Size / Thickness buttons themselves reuse .btn.btn-outline
   from the root style.css — only the wrapping row and the CTA box are new.
   =========================================================================== */

.hcb-size-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.hcb-size-selected {
  font-size: 13px;
  font-weight: 700;
  color: var(--brown-800);
  margin-bottom: 18px;
}

/* ===========================================================================
   Choose Size — combined size + thickness picker in ONE control, per the
   reference screenshots: one trigger, one modal with bed-type tabs
   (Single/Queen/King/Custom, derived from width - see
   homesara_bedtype_for_width()), a dimension grid, a thickness row, and
   Confirm/Cancel. Uses the site's own brown/gold tokens (not a separate
   colour scheme) since the reference design itself uses them.
   =========================================================================== */
.hcb-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 4px;
}
.hcb-field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.hcb-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border: 1.5px solid var(--line);
  border-radius:5px;
  background: var(--white);
  cursor: pointer;
  min-width: 260px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gold-dark);
  text-align: left;
}
.hcb-trigger:hover { border-color: var(--gold-dark); }
.hcb-trigger-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcb-edit-icon { flex-shrink: 0; color: var(--gold-dark); }

.hcb-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,14,8,.6);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.hcb-modal.hcb-is-open { display: flex; }
.hcb-modal-panel {
  background: var(--white);
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  border-radius:5px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.hcb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.hcb-modal-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.hcb-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  padding: 0 4px;
}
.hcb-close:hover { color: var(--ink); }
.hcb-modal-body { padding: 20px 22px 22px; overflow-y: auto; flex: 1; min-height: 120px; }

.hcb-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.hcb-section-label:not(:first-child) { margin-top: 22px; }

.hcb-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
@media (max-width: 460px) { .hcb-grid { grid-template-columns: repeat(3,1fr); } }
.hcb-dim-btn {
  padding: 12px 6px;
  border: 1.5px solid var(--line);
  border-radius:5px;
  background: var(--white);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.hcb-dim-btn:hover { border-color: var(--gold-dark); }
.hcb-dim-btn.hcb-active { background: var(--brown-900); border-color: var(--brown-900); }
.hcb-dim-btn.hcb-active .hcb-dim-main { color: var(--white); }
.hcb-dim-main { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.2; }

.hcb-thick-row { display: flex; gap: 8px; flex-wrap: wrap; }
.hcb-thick-btn {
  flex: 1;
  min-width: 110px;
  padding: 12px 10px;
  border: 1.5px solid var(--line);
  border-radius:5px;
  background: var(--white);
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  font-family: inherit;
}
.hcb-thick-btn:hover { border-color: var(--gold-dark); }
.hcb-thick-btn.hcb-active { background: var(--brown-900); border-color: var(--brown-900); }
.hcb-thick-btn.hcb-active .hcb-thick-main { color: var(--white); }
.hcb-thick-main { font-size: 13px; font-weight: 600; color: var(--ink); }

.hcb-modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.hcb-modal-actions .btn { flex: 1; }

.hcb-wa-box {
  background: var(--cream-2);
  border-radius:5px;
  padding: 20px;
}
.hcb-wa-box > div:first-child {
  font-weight: 700;
  margin-bottom: 10px;
}
.hcb-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25d366; /* exact WhatsApp-brand value from the product-mattress.html mockup */
  color: #fff;
  padding: 12px 20px;
  border-radius:5px;
  font-size: 13.5px;
  font-weight: 600;
}
