/* ==========================================================================
   Therilla Studio: header cart, notices and store pages.
   Loaded after styles.css on every page.
   ========================================================================== */

/* ---------- Header cart link ---------- */
.site-header .container { gap: 1rem; }
.header-actions { display: flex; align-items: center; gap: 0.6rem; order: 3; }
.nav { order: 2; margin-left: auto; }
.cart-link {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%; color: var(--navy); text-decoration: none; font-size: 1.1rem;
  box-shadow: inset 0 0 0 2px var(--line-strong); transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.cart-link:hover { background: var(--orange); color: var(--ink); box-shadow: none; }
.cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--orange); color: var(--ink); font-size: 0.7rem; font-weight: 800; line-height: 20px; text-align: center;
}
.cart-count.is-empty { display: none; }
html:not(.menu-open) .has-video-hero .site-header:not(.is-scrolled) .cart-link { color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45); }
html:not(.menu-open) .has-video-hero .site-header:not(.is-scrolled) .cart-link:hover { background: var(--orange); color: var(--ink); box-shadow: none; }
.nav-list a { padding-inline: 0.7rem; }
@media (max-width: 1240px) and (min-width: 1025px) {
  .nav { gap: 1rem; }
  .nav-list a { padding-inline: 0.45rem; font-size: 0.85rem; }
  .nav .btn { padding-inline: 1rem; }
  .brand img { width: 128px; }
}

/* ---------- Notices, empty states, small buttons ---------- */
.notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem 1rem;
  padding: 1rem 1.25rem; border-radius: var(--radius-sm); font-weight: 500;
}
.notice > i { font-size: 1.15rem; margin-top: 0.15rem; align-self: flex-start; }
.notice > div { flex: 1 1 240px; display: flex; flex-direction: column; gap: 0.25rem; }
.notice--success { background: #E7F6EC; color: #14532D; }
.notice--success > i { color: #15803D; }
.notice--error { background: #FDECEA; color: #7F1D1D; }
.notice--error > i { color: #B42318; }
.notice a { color: inherit; font-weight: 700; }

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1rem; padding-block: clamp(3rem, 2rem + 4vw, 6rem); }
.empty-state > i { font-size: 2.5rem; color: var(--orange-text); }
.empty-state .lead { margin-inline: auto; }

.btn--sm { min-height: 40px; padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn--block { width: 100%; }
.btn[aria-busy="true"] { opacity: 0.7; pointer-events: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.text-button {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0; border: 0; background: none;
  color: var(--muted); font: 600 0.875rem var(--font); cursor: pointer;
}
.text-button:hover { color: var(--orange-text); }
.js .js-hide { display: none; }

/* Spam trap: hidden from people, visible to bots */
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Store ---------- */
.store-hero { padding-top: clamp(3rem, 2rem + 4vw, 5.5rem); padding-bottom: clamp(1rem, 0.5rem + 2vw, 2rem); }
.store-page { padding-top: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.store-page h1 { font-size: var(--fs-h2); }
.store-page .container { gap: 1.75rem; }

.product-card .media { background: var(--surface); }
.product-card h3 { font-size: 1.125rem; }
.price { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.price--lg { font-size: 1.5rem; font-weight: 800; }
.stock-badge {
  position: absolute; right: 1rem; top: 1rem; padding: 0.3rem 0.7rem; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 0.75rem; font-weight: 700;
}
.store-perks .feature { flex-basis: 240px; }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: var(--fs-small); color: var(--muted); }
.breadcrumbs a { color: var(--navy); font-weight: 600; text-decoration: none; }
.breadcrumbs a:hover { color: var(--orange-text); }
.breadcrumbs i { font-size: 0.65rem; }

.product-detail { align-items: flex-start; }
.product-detail > .media { box-shadow: none; background: var(--surface); }

.size-picker { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; }
.size-picker legend { font-weight: 700; font-size: var(--fs-small); color: var(--navy); padding: 0; margin-bottom: 0.6rem; }
.size-options { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.size-option { position: relative; }
.size-option input { position: absolute; opacity: 0; pointer-events: none; }
.size-option span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 56px; height: 48px; padding: 0 1rem;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); font-weight: 700; cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.size-option span:hover { border-color: var(--navy); }
.size-option input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.size-option input:focus-visible + span { outline: 2px solid var(--orange-text); outline-offset: 2px; }
.size-option.is-out span { color: #8D90A8; text-decoration: line-through; cursor: not-allowed; background: var(--surface); }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; align-self: flex-start; }
.qty input {
  width: 3.25rem; min-height: 48px; border: 0; text-align: center; font: 700 1rem var(--font); color: var(--ink); background: transparent;
  -moz-appearance: textfield; appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: none; background: var(--surface); }
.qty-btn { width: 44px; height: 48px; border: 0; background: none; color: var(--navy); cursor: pointer; }
.qty-btn:hover { background: var(--surface); color: var(--orange-text); }
.qty--sm input { min-height: 38px; width: 2.75rem; font-size: 0.9rem; }
.qty--sm .qty-btn { height: 38px; width: 36px; font-size: 0.8rem; }
.form > .qty-field { flex: 0 0 auto; }

.cart-layout { align-items: flex-start; }
.cart-layout > aside { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 1rem; }
.cart-lines { list-style: none; margin: 0 0 1rem; padding: 0; border-top: 1px solid var(--line); }
.cart-line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem 1.25rem; padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
.cart-thumb { flex: 0 0 96px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.cart-thumb img { width: 96px; height: 96px; object-fit: cover; }
.cart-info { flex: 1 1 220px; display: flex; flex-direction: column; gap: 0.3rem; }
.cart-name { font-weight: 700; color: var(--navy); text-decoration: none; }
.cart-name:hover { color: var(--orange-text); }
.cart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-top: 0.4rem; }
.cart-qty-form { display: flex; align-items: center; gap: 0.75rem; }
.cart-line-total { font-variant-numeric: tabular-nums; color: var(--navy); }

.order-summary { padding: 1.5rem; border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 1rem; }
.summary-items { list-style: none; margin: 0; padding: 0 0 1rem; display: flex; flex-direction: column; gap: 0.6rem; border-bottom: 1px solid var(--line); font-size: var(--fs-small); }
.summary-items li, .summary-totals > div { display: flex; justify-content: space-between; gap: 1rem; }
.summary-totals { margin: 0; display: flex; flex-direction: column; gap: 0.6rem; font-variant-numeric: tabular-nums; }
.summary-totals dt { color: var(--muted); }
.summary-totals dd { margin: 0; font-weight: 600; }
.summary-total { padding-top: 0.75rem; border-top: 1px solid var(--line); font-size: 1.125rem; }
.summary-total dt, .summary-total dd { color: var(--navy); font-weight: 800; }

.pay-options { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.pay-option { display: flex; gap: 0.9rem; align-items: flex-start; padding: 1.1rem 1.25rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.pay-option:hover { border-color: var(--navy); }
.pay-option:has(input:checked) { border-color: var(--navy); background: rgba(2, 23, 127, 0.04); box-shadow: inset 0 0 0 1px var(--navy); }
.pay-option input { margin-top: 0.3rem; accent-color: var(--navy); width: 18px; height: 18px; flex: 0 0 auto; }
.pay-option-body { display: flex; flex-direction: column; gap: 0.3rem; }
.pay-option-body strong { color: var(--navy); }
.pay-option-body i { color: var(--orange-text); margin-right: 0.3rem; }
.form h2.title-sm { margin-top: 1rem; }

.order-head { display: flex; flex-direction: column; gap: 0.75rem; }
.order-details p { margin-top: 0.4rem; }
.status-pill {
  display: inline-flex; align-items: center; align-self: flex-start; padding: 0.3rem 0.8rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; background: var(--surface-2); color: var(--navy); text-decoration: none; white-space: nowrap;
}
.status-paid, .status-completed, .status-shipped { background: #E7F6EC; color: #14532D; }
.status-pending, .status-processing { background: #FFE8DE; color: #B23A0E; }
.status-awaiting_payment { background: #FFF4D6; color: #7A4B00; }
.status-cancelled, .status-failed { background: #FDECEA; color: #7F1D1D; }

@media (max-width: 1024px) {
  .cart-layout > aside { position: static; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 767px) {
  .cart-line-total { margin-left: calc(96px + 1.25rem); }
  .cart-link { width: 42px; height: 42px; }
}
