/* =====================================================================
   THE CHRISTIAN KING — Store
   Storefront components. Inherits tokens, chrome (.site-header/.site-footer),
   buttons and typography from styles.css; this file adds only the store UI.
   ===================================================================== */

.store-main { min-height: 60vh; padding: 56px 0 96px; }

/* --- Page heading ---------------------------------------------------- */
.store-hero { text-align: center; margin: 8px auto 48px; max-width: 720px; }
.store-hero .label { color: var(--gold-warm); }
.store-hero h1 {
  font-family: var(--display-caps); font-weight: 600; letter-spacing: 0.04em;
  font-size: clamp(30px, 5vw, 46px); margin: 10px 0 14px; color: var(--text);
}
.store-hero p { font-family: var(--display); font-size: 19px; color: var(--text-2); font-style: italic; margin: 0; }

.store-note {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold-warm); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 6px 14px;
}

/* Test-mode banner */
.store-testbar {
  background: repeating-linear-gradient(45deg, #1a1508, #1a1508 12px, #201907 12px, #201907 24px);
  border-bottom: 1px solid var(--line-2); color: var(--gold-pale);
  text-align: center; font-size: 13px; letter-spacing: 0.04em; padding: 8px 16px;
}
.store-testbar strong { color: var(--gold-bright); margin-right: 6px; }
.store-main > .store-testbar { margin: 20px 0 32px; }
.store-testbar--alert {
  background: repeating-linear-gradient(45deg, #3a0d0d, #3a0d0d 12px, #4a1212 12px, #4a1212 24px);
  color: #ffe1dc; font-size: 14px; padding: 10px 16px;
}
.store-testbar--alert strong { color: #fff; }
.store-closed { margin: 40px auto 90px; }
.store-closed__cta { margin-top: 30px !important; font-style: normal !important; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- Product grid ---------------------------------------------------- */
.product-grid {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.product-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); overflow: hidden;
  text-align: left; color: inherit;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.product-card:hover {
  transform: translateY(-4px); border-color: var(--gold-deep);
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
}
.product-card__media {
  aspect-ratio: 1 / 1; background: #0c0c11 center/cover no-repeat;
  position: relative; overflow: hidden;
}
.product-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.product-card:hover .product-card__media img { transform: scale(1.05); }
.product-card__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card__name { font-family: var(--display); font-size: 21px; font-weight: 600; color: var(--text); line-height: 1.25; }
.product-card__price { margin-top: auto; color: var(--gold-warm); font-weight: 600; font-size: 15px; letter-spacing: 0.02em; }
.product-card__price span { color: var(--text-3); font-weight: 400; font-size: 13px; }

/* --- Skeleton loading ------------------------------------------------ */
.sk { position: relative; overflow: hidden; background: var(--surface-2); }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  transform: translateX(-100%); animation: sk 1.4s infinite;
}
@keyframes sk { 100% { transform: translateX(100%); } }
.sk-card { height: 320px; border-radius: var(--radius-md); }

/* --- Product detail -------------------------------------------------- */
.product { display: grid; grid-template-columns: 1.05fr 1fr; gap: 52px; align-items: start; }
.product__gallery { position: sticky; top: 92px; }
.product__main-img {
  aspect-ratio: 1 / 1; width: 100%; background: #0c0c11 center/cover no-repeat;
  border: 1px solid var(--line); border-radius: var(--radius-md); object-fit: cover;
}
.product__thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.product__thumb {
  width: 66px; height: 66px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); padding: 0; background: #0c0c11; cursor: pointer;
  opacity: 0.7; transition: opacity .2s, border-color .2s;
}
.product__thumb img { width: 100%; height: 100%; object-fit: cover; }
.product__thumb.is-active, .product__thumb:hover { opacity: 1; border-color: var(--gold); }

.product__info h1 {
  font-family: var(--display-caps); font-weight: 600; letter-spacing: 0.02em;
  font-size: clamp(26px, 3.4vw, 38px); margin: 0 0 10px; line-height: 1.15;
}
.product__price { font-size: 26px; color: var(--gold-warm); font-weight: 600; margin: 0 0 24px; }
.product__row { margin: 22px 0; }
.product__row > .label { display: block; margin-bottom: 10px; color: var(--text-2); }
.product__row .label b { color: var(--text); font-weight: 600; }

.opt-set { display: flex; flex-wrap: wrap; gap: 9px; }
.opt {
  min-width: 46px; padding: 9px 14px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-size: 14px; cursor: pointer; transition: all .18s var(--ease);
}
.opt:hover { border-color: var(--gold-deep); }
.opt.is-active { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-pale); }
.opt:disabled { opacity: 0.32; cursor: not-allowed; text-decoration: line-through; }

.swatch { width: 34px; height: 34px; min-width: 0; padding: 0; border-radius: 50%; position: relative; }
.swatch.is-active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); border-color: transparent; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.qty button { width: 40px; height: 44px; background: var(--surface); color: var(--text); border: 0; font-size: 20px; }
.qty button:hover { background: var(--surface-2); color: var(--gold-warm); }
.qty input { width: 52px; height: 44px; text-align: center; background: var(--bg-2); color: var(--text); border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); font-size: 15px; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

.product__actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn--block { width: 100%; }

/* --- Cart ------------------------------------------------------------ */
.cart { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.cart__items { display: flex; flex-direction: column; gap: 0; }
.cart-line {
  display: grid; grid-template-columns: 88px 1fr auto; gap: 18px; align-items: center;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.cart-line:first-child { border-top: 1px solid var(--line); }
.cart-line__img { width: 88px; height: 88px; border-radius: var(--radius); object-fit: cover; background: #0c0c11; border: 1px solid var(--line); }
.cart-line__name { font-family: var(--display); font-size: 20px; font-weight: 600; }
.cart-line__variant { color: var(--text-3); font-size: 13.5px; margin-top: 2px; }
.cart-line__price { color: var(--gold-warm); font-weight: 600; margin-top: 6px; }
.cart-line__side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.cart-line__remove { background: none; border: 0; color: var(--text-3); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.cart-line__remove:hover { color: var(--crimson); }

.cart-empty { text-align: center; padding: 80px 20px; color: var(--text-2); }
.cart-empty svg { width: 54px; height: 54px; color: var(--line-2); margin-bottom: 18px; }

/* Summary / checkout panel */
.summary {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 28px; position: sticky; top: 92px;
}
.summary h2 { font-family: var(--display-caps); font-weight: 600; font-size: 20px; letter-spacing: 0.04em; margin: 0 0 20px; }
.summary__row { display: flex; justify-content: space-between; padding: 9px 0; color: var(--text-2); font-size: 15px; }
.summary__row--total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; color: var(--text); font-size: 20px; font-weight: 600; }
.summary__row--total b { color: var(--gold-warm); }
.summary__muted { color: var(--text-3); font-size: 12.5px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text);
  border-radius: var(--radius); padding: 12px 13px; font-family: var(--body); font-size: 15px;
  transition: border-color .2s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); }
.field--half { display: inline-block; width: calc(50% - 6px); }
.field--half + .field--half { margin-left: 10px; }

.form-grid { margin: 8px 0 20px; }
.form-section-title { font-family: var(--display-caps); font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-warm); margin: 26px 0 14px; }

.pay-buttons { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.btn--paypal { background: #ffc439; color: #0a0a0a; border: 0; }
.btn--paypal:hover { background: #ffcf56; }
.btn--stripe { background: var(--gold); color: #100c02; border: 0; }
.btn--stripe:hover { background: var(--gold-warm); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.ship-opt { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; }
.ship-opt.is-active { border-color: var(--gold); background: var(--gold-soft); }
.ship-opt input { accent-color: var(--gold); }
.ship-opt__name { flex: 1; font-size: 14px; }
.ship-opt__rate { color: var(--gold-warm); font-weight: 600; }

/* --- Toast / cart badge --------------------------------------------- */
.cart-badge {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; color: var(--text);
}
.cart-badge svg { width: 21px; height: 21px; }
.cart-badge__count {
  position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--gold); color: #100c02; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
}
.cart-badge__count.show { display: flex; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); border: 1px solid var(--gold-deep); color: var(--text);
  padding: 13px 22px; border-radius: var(--radius); font-size: 14.5px; z-index: 300;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Success page ---------------------------------------------------- */
.success { max-width: 640px; margin: 0 auto; text-align: center; }
.success__check { width: 76px; height: 76px; margin: 0 auto 26px; color: var(--gold); }
.success h1 { font-family: var(--display-caps); font-weight: 600; font-size: 34px; letter-spacing: 0.03em; margin: 0 0 10px; }
.success__sub { font-family: var(--display); font-style: italic; font-size: 19px; color: var(--text-2); margin: 0 0 30px; }
.success__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 26px; text-align: left; margin: 0 auto 28px; }

.store-msg { text-align: center; padding: 60px 20px; color: var(--text-2); }
.store-msg a { color: var(--gold-warm); border-bottom: 1px solid var(--gold-deep); }

/* --- Sold out / stock ------------------------------------------------ */
.soldout-flag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: rgba(6,6,10,0.82); color: var(--text); border: 1px solid var(--line-2);
  font-family: var(--display-caps); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 3px;
}
.product-card__media { position: relative; }
.stock-note { margin: 4px 0 0; font-size: 13.5px; color: var(--gold-warm); font-weight: 600; }
.stock-note--out { color: #e88; }
.product__desc { color: var(--text-2); font-size: 15.5px; line-height: 1.6; margin: 0 0 22px; }

/* --- Coupon box ------------------------------------------------------ */
.coupon-box { margin: 18px 0 6px; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text);
  border-radius: var(--radius); padding: 11px 13px; font-family: var(--body); font-size: 14px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.coupon-row input:focus { outline: none; border-color: var(--gold); }
.coupon-msg { margin: 8px 0 0; font-size: 13px; min-height: 1px; }
.coupon-msg.is-ok { color: #7fd6a3; }
.coupon-msg.is-err { color: #e88; }
.summary__row--total b { color: var(--gold-warm); }

/* --- Responsive ------------------------------------------------------ */
@media (max-width: 900px) {
  .product { grid-template-columns: 1fr; gap: 34px; }
  .product__gallery { position: static; }
  .cart { grid-template-columns: 1fr; gap: 34px; }
  .summary { position: static; }
}
@media (max-width: 560px) {
  .cart-line { grid-template-columns: 68px 1fr; }
  .cart-line__img { width: 68px; height: 68px; }
  .cart-line__side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .field--half { width: 100%; margin-left: 0 !important; display: block; }
}
