/* ============================================================
   Generic CMS — Storefront styles (loaded only when commerce is on)
   Uses the page's own theme variables (--bg, --text, --accent,
   --font-display, --font-body) so the store always matches the site.
   ============================================================ */

.st-btn {
  display: inline-block; border: 0; cursor: pointer; text-align: center; text-decoration: none;
  background: var(--accent); color: #fff; font-family: var(--font-body);
  font-size: 13px; font-weight: 700; letter-spacing: .4px; padding: 11px 20px; border-radius: 6px;
}
.st-btn:hover { opacity: .9; }
.st-btn-ghost { background: transparent; color: var(--accent); border: 2px solid var(--accent); padding: 9px 18px; }
.st-btn-disabled { background: rgba(0,0,0,.12); color: rgba(0,0,0,.5); cursor: not-allowed; }
.st-btn-big { width: 100%; padding: 14px; font-size: 15px; }
.st-btn.is-added { background: #1f9d55; }

.st-badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; background: rgba(0,0,0,.07); color: var(--text);
}
.st-badge-in_stock { background: rgba(31,157,85,.14); color: #17803f; }
.st-badge-preorder { background: rgba(184,134,11,.16); color: #8a6508; }
.st-badge-sold_out { background: rgba(214,69,69,.14); color: #b73232; }

.st-price-now { font-weight: 700; color: var(--text); }
.st-price-was { opacity: .5; font-size: .9em; margin-left: 4px; }
.st-price-from { font-size: 12px; opacity: .6; text-transform: uppercase; letter-spacing: .5px; }

/* ── CART BUTTON IN HEADER ── */
.st-cart-btn {
  position: relative; background: none; border: 0; cursor: pointer; color: var(--text);
  padding: 6px; line-height: 0; margin-left: 4px;
}
.st-cart-btn:hover { color: var(--accent); }
.st-cart-count {
  position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  line-height: 18px; text-align: center; font-family: var(--font-body);
}
.st-cart-count[hidden] { display: none; }

/* ── PRODUCT GRID ── */
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 24px; }
.st-card {
  display: flex; flex-direction: column; border: 1px solid rgba(0,0,0,.09); border-radius: 10px;
  overflow: hidden; background: var(--bg); transition: box-shadow .15s, transform .15s;
}
.st-card:hover { box-shadow: 0 6px 22px rgba(0,0,0,.09); transform: translateY(-2px); }
.st-card.is-soldout .st-card-img img { opacity: .55; }
.st-card-link { color: inherit; text-decoration: none; display: block; flex: 1; }
.st-card-img { position: relative; aspect-ratio: 1 / 1; background: #eceef1; overflow: hidden; }
.st-card-img img { width: 100%; height: 100%; object-fit: cover; }
.st-card-img .st-badge { position: absolute; top: 10px; left: 10px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.st-card-body { padding: 14px 16px 6px; }
.st-card-title { font-family: var(--font-display); font-size: 17px; line-height: 1.3; margin-bottom: 4px; }
.st-card-tag { font-size: 13px; opacity: .65; line-height: 1.4; margin-bottom: 8px; }
.st-card-price { font-size: 15px; }
.st-card-actions { padding: 10px 16px 16px; }
.st-card-actions .st-btn { width: 100%; }

/* ── PRODUCT PAGE ── */
.st-product-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.st-gallery-main { background: #eceef1; border-radius: 10px; overflow: hidden; aspect-ratio: 1 / 1; }
.st-gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.st-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.st-thumb { border: 2px solid transparent; border-radius: 6px; padding: 0; background: #eceef1; cursor: pointer; width: 70px; height: 70px; overflow: hidden; }
.st-thumb.is-active, .st-thumb:hover { border-color: var(--accent); }
.st-thumb img { width: 100%; height: 100%; object-fit: cover; }

.st-title { font-family: var(--font-display); font-size: 32px; line-height: 1.2; margin-bottom: 6px; }
.st-tagline { opacity: .7; margin-bottom: 14px; }
.st-priceline { font-size: 24px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-priceline .st-price-was { font-size: 16px; }
.st-note { font-size: 13px; opacity: .7; margin-bottom: 6px; }
.st-lowstock { font-size: 12px; font-weight: 700; color: #c0522f; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }

.st-variants { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.st-variant {
  border: 2px solid rgba(0,0,0,.15); background: var(--bg); color: var(--text); border-radius: 6px;
  padding: 9px 16px; font-family: var(--font-body); font-size: 14px; font-weight: 600; cursor: pointer;
}
.st-variant:hover { border-color: var(--accent); }
.st-variant.is-active { border-color: var(--accent); background: var(--accent); color: #fff; }
.st-variant.is-out { opacity: .5; text-decoration: line-through; }

.st-qtyrow { display: flex; align-items: center; gap: 12px; margin: 16px 0 14px; }
.st-qtyrow label { font-size: 13px; font-weight: 600; }
.st-qtyrow input { width: 76px; padding: 9px 10px; border: 1px solid rgba(0,0,0,.2); border-radius: 6px; font-size: 15px; font-family: var(--font-body); }

.st-buynow { margin-top: 18px; }
.st-or { text-align: center; position: relative; margin-bottom: 14px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; opacity: .6; }
.st-or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid rgba(0,0,0,.15); }
.st-or span { position: relative; background: var(--bg); padding: 0 12px; }
.st-shipnote { font-size: 12px; opacity: .6; margin-top: 8px; text-align: center; }
.st-desc { margin-top: 26px; padding-top: 22px; border-top: 1px solid rgba(0,0,0,.1); line-height: 1.8; }

/* ── SHIPPING SELECTOR (cart + product page) ── */
.st-ship-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; opacity: .65; margin-bottom: 8px; display: block; }
.st-ship-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  border: 2px solid rgba(0,0,0,.12); background: var(--bg); color: var(--text); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px; font-family: var(--font-body);
}
.st-ship-opt.is-active { border-color: var(--accent); background: rgba(0,0,0,.025); }
.st-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0,0,0,.35); flex-shrink: 0; }
.st-ship-opt.is-active .st-radio { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--bg); background: var(--accent); }
.st-ship-text { flex: 1; font-size: 14px; font-weight: 600; }
.st-ship-text small { display: block; font-weight: 400; opacity: .6; font-size: 12px; }
.st-ship-price { font-size: 13px; font-weight: 700; opacity: .75; }
.st-ship-inline { margin: 0 0 12px; }
.st-ship-inline .st-ship-opt { padding: 8px 12px; margin-bottom: 6px; }

/* ── TERMS ── */
.st-terms { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; margin: 12px 0 8px; cursor: pointer; }
.st-terms input { margin-top: 3px; }
.st-terms-warn { color: #c0392b; font-size: 12px; margin-bottom: 8px; }

/* ── CART DRAWER ── */
.st-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 900; }
.st-overlay[hidden] { display: none; }
.st-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 910;
  background: var(--bg); color: var(--text); box-shadow: -8px 0 30px rgba(0,0,0,.18);
  display: flex; flex-direction: column; transform: translateX(105%); transition: transform .25s ease;
  font-family: var(--font-body);
}
.st-drawer.is-open { transform: translateX(0); }
.st-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid rgba(0,0,0,.1); }
.st-drawer-head h2 { font-family: var(--font-display); font-size: 20px; }
.st-x { background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; color: var(--text); opacity: .6; }
.st-x:hover { opacity: 1; }
.st-drawer-body { flex: 1; overflow-y: auto; padding: 8px 22px; }
.st-empty { text-align: center; padding: 60px 0; opacity: .55; }
.st-empty[hidden] { display: none; }
.st-drawer-foot { padding: 16px 22px 22px; border-top: 1px solid rgba(0,0,0,.1); max-height: 62vh; overflow-y: auto; }
.st-drawer-foot[hidden] { display: none; }

.st-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,.07); align-items: start; }
.st-line img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #eceef1; }
.st-line-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.st-line-name a { color: inherit; text-decoration: none; }
.st-line-var { font-size: 12px; opacity: .6; }
.st-line-price { font-size: 13px; opacity: .75; margin-top: 2px; }
.st-line-tag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #8a6508; margin-top: 3px; }
.st-line-right { text-align: right; font-weight: 700; font-size: 14px; }
.st-qty { display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; border: 1px solid rgba(0,0,0,.2); border-radius: 6px; }
.st-qty button { background: none; border: 0; width: 28px; height: 28px; font-size: 16px; cursor: pointer; color: var(--text); }
.st-qty span { min-width: 22px; text-align: center; font-size: 13px; font-weight: 600; }
.st-remove { display: block; margin-top: 6px; background: none; border: 0; font-size: 11px; text-decoration: underline; cursor: pointer; opacity: .55; color: var(--text); margin-left: auto; }

.st-messages { font-size: 13px; color: #8a6508; padding: 10px 0; }
.st-messages p { margin-bottom: 6px; }
.st-totals > div { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.st-total-row { font-weight: 700; font-size: 17px !important; border-top: 2px solid var(--text); margin-top: 6px; padding-top: 10px !important; }
.st-cartnote { font-size: 12px; opacity: .65; margin: 10px 0; line-height: 1.5; }
.st-pp-missing { font-size: 13px; color: #b73232; text-align: center; padding: 10px; }
.st-pp-missing[hidden], .st-terms-warn[hidden] { display: none; }
#st-paypal-cart, #st-paypal-pdp { margin-top: 10px; min-height: 5px; }

.st-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: #222; color: #fff; padding: 12px 22px; border-radius: 8px; font-size: 14px; z-index: 1000;
  transition: all .25s ease; font-family: var(--font-body);
}
.st-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ── ORDER STATUS ── */
.st-order-table { width: 100%; border-collapse: collapse; margin: 18px 0; max-width: 560px; }
.st-order-table td { padding: 9px 0; border-bottom: 1px solid rgba(0,0,0,.08); font-size: 15px; }
.st-order-table .st-total-row td { border-top: 2px solid var(--text); border-bottom: 0; font-weight: 700; }

/* ── MOBILE ── */
@media (max-width: 760px) {
  .st-product-grid { grid-template-columns: 1fr; gap: 24px; }
  .st-title { font-size: 26px; }
  .st-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .st-card-title { font-size: 15px; }
  .st-card-body { padding: 10px 12px 4px; }
  .st-card-actions { padding: 8px 12px 12px; }
  .st-card-actions .st-btn { font-size: 12px; padding: 10px 8px; }
}
