/* ═══════════════════════════════════════════════════════════════════
   components.css — Product cards, buttons, forms, modals, badges
   ═══════════════════════════════════════════════════════════════════ */

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--r);
  font-family: inherit;
  font-weight: 800;
  font-size: .9rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform var(--t), filter var(--t), box-shadow var(--t);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #0a0a0f;
  box-shadow: 0 6px 24px rgba(255,213,31,.3);
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 8px 30px rgba(255,213,31,.4); }
.btn-secondary {
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: rgba(255,255,255,.1); }
.btn-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--line2);
}
.btn-ghost:hover { background: rgba(255,213,31,.08); }
.btn-danger {
  background: rgba(239,68,68,.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.3);
}
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .8rem; border-radius: var(--r-sm); }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 0; width: 48px; border-radius: var(--r-sm); }
.btn-icon.sm { width: 38px; min-height: 38px; }
.btn:disabled { opacity: .45; pointer-events: none; }

/* Ripple effect */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.18);
  border-radius: inherit;
  opacity: 0;
  transform: scale(.5);
  transition: opacity .3s, transform .3s;
}
.btn:active::after { opacity: 1; transform: scale(1); transition: 0s; }

/* ── Product Cards ─────────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  transition: transform var(--t), box-shadow var(--t);
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-card:active { transform: scale(.98); }

.product-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface2);
  overflow: hidden;
}
.product-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.04); }

.product-img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text3);
  font-size: 2rem;
}
.product-img-placeholder span { font-size: .72rem; font-weight: 700; }

/* Stock badge on image */
@keyframes stock-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}
.stock-badge {
  position: absolute;
  top: 8px; left: 8px;
  padding: 4px 9px;
  border-radius: var(--r-full);
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
/* Green: qty > 5 -- slow calm pulse */
.stock-badge.ok {
  background: rgba(34,197,94,.18);
  color: #86efac;
  border: 1px solid rgba(34,197,94,.35);
  animation: stock-blink 2.4s ease-in-out infinite;
}
/* Yellow: qty 3-5 -- medium pulse */
.stock-badge.low {
  background: rgba(245,158,11,.18);
  color: #fcd34d;
  border: 1px solid rgba(245,158,11,.35);
  animation: stock-blink 1.5s ease-in-out infinite;
}
/* Red: qty 1-2 -- fast urgent pulse */
.stock-badge.critical {
  background: rgba(239,68,68,.18);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.35);
  animation: stock-blink 0.8s ease-in-out infinite;
}
/* Out of stock -- static, no animation */
.stock-badge.out {
  background: rgba(100,100,100,.18);
  color: #9ca3af;
  border: 1px solid rgba(100,100,100,.25);
}

/* Share button on image */
.share-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(10,10,15,.7);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--text2);
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.share-btn:hover { background: rgba(255,213,31,.15); color: var(--gold); }

.product-body {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.product-name {
  font-size: .82rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  /* CSS clamp — safety net: never shows more than 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* JS _truncName() handles the 15-word word-level truncation */
}
.product-brand {
  font-size: .68rem;
  color: var(--text3);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-price {
  font-size: 1rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -.02em;
}
.product-add-btn {
  margin-top: auto;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  font-size: .8rem;
  border-radius: var(--r-sm);
}

/* ── Category Chips ────────────────────────────────────────────── */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text2);
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.chip.active {
  background: rgba(255,213,31,.15);
  border-color: rgba(255,213,31,.5);
  color: var(--gold);
}
.chip:hover { border-color: rgba(255,213,31,.3); color: var(--text); }

/* ── Search ────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0 14px;
  height: 50px;
  transition: border-color var(--t), box-shadow var(--t);
  position: relative; /* FIX: anchors the absolute-positioned dropdown */
}
.search-bar:focus-within {
  border-color: rgba(255,213,31,.5);
  box-shadow: 0 0 0 3px rgba(255,213,31,.1);
}
.search-bar .search-icon { color: var(--text3); font-size: 18px; flex-shrink: 0; }
.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .9rem;
  font-weight: 700;
}
.search-input::placeholder { color: var(--text3); font-weight: 600; }
.search-clear {
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  display: none;
}

/* Autocomplete dropdown */
/* Search wrapper — must be position:relative to anchor the dropdown */
.search-wrap {
  position: relative;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 200; /* raised above product cards and topbar content */
  max-height: 360px;
  overflow-y: auto;
  animation: fadeSlideDown .2s ease both;
}
@keyframes fadeSlideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background var(--t);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover  { background: var(--surface3); }
.search-result-item:active { background: rgba(255,213,31,.07); }
.search-result-item.sri-active { background: rgba(255,213,31,.07); }
.sri-arrow { flex-shrink: 0; color: var(--text3); opacity: 0; transition: opacity .15s; }
.search-result-item:hover .sri-arrow,
.search-result-item.sri-active .sri-arrow { opacity: 1; color: var(--gold); }
.sri-img {
  width: 42px; height: 42px;
  border-radius: var(--r-xs);
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}
.sri-info { flex: 1; min-width: 0; }
.sri-name { font-size: .82rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sri-price { font-size: .75rem; color: var(--gold); font-weight: 900; }

/* ── Forms / Inputs ────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--gap); }
.form-label {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text2);
}
.form-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text);
  font-size: .9rem;
  font-weight: 700;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-input:focus {
  border-color: rgba(255,213,31,.5);
  box-shadow: 0 0 0 3px rgba(255,213,31,.1);
}
.form-input::placeholder { color: var(--text3); font-weight: 600; }
.form-error { font-size: .75rem; color: #fca5a5; font-weight: 700; }

/* ── Cart Items ────────────────────────────────────────────────── */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
  width: 64px; height: 64px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface2);
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: .86rem; font-weight: 800; line-height: 1.3; margin-bottom: 4px; }
.cart-item-price { font-size: .8rem; color: var(--gold); font-weight: 900; }
.cart-item-subtotal { font-size: .78rem; color: var(--text2); font-weight: 700; }
.cart-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 4px;
}
.qty-btn {
  width: 30px; height: 30px;
  border-radius: var(--r-xs);
  background: var(--surface3);
  border: none;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: background var(--t);
  display: grid;
  place-items: center;
}
.qty-btn:hover { background: rgba(255,213,31,.15); color: var(--gold); }
.qty-value { font-size: .88rem; font-weight: 900; min-width: 24px; text-align: center; }
.cart-remove-btn { font-size: .7rem; color: #fca5a5; background: none; border: none; cursor: pointer; font-weight: 700; }

/* ── Product Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-lg);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform var(--t-lg);
  padding-bottom: calc(24px + var(--safe-bottom));
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 2px;
  margin: 12px auto 8px;
}
.modal-product-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--surface2);
}
.modal-body { padding: 16px; }
.modal-product-name { font-size: 1.2rem; font-weight: 900; line-height: 1.2; margin-bottom: 6px; }
.modal-product-price { font-size: 1.6rem; font-weight: 900; color: var(--gold); margin-bottom: 12px; letter-spacing: -.03em; }
.modal-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.modal-spec {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.modal-spec-label { font-size: .67rem; color: var(--text3); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.modal-spec-value { font-size: .88rem; font-weight: 800; color: var(--text); }
.modal-qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.modal-qty-label { font-size: .8rem; font-weight: 800; color: var(--text2); }
.modal-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

/* ── Order Summary ─────────────────────────────────────────────── */
.order-summary {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
}
.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  font-size: .86rem;
  color: var(--text2);
  border-bottom: 1px solid var(--line);
}
.order-row:last-child { border-bottom: none; }
.order-row.total {
  padding-top: 12px;
  font-size: 1rem;
  font-weight: 900;
  color: var(--white);
}
.order-row.total span { color: var(--gold); font-size: 1.15rem; }

/* ── Payment option chips ──────────────────────────────────────── */
.payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
  margin-bottom: 10px;
}
.payment-option.selected {
  border-color: var(--gold);
  background: rgba(255,213,31,.06);
}
.payment-option input[type="radio"] { accent-color: var(--gold); width: 18px; height: 18px; }
.payment-option-label { font-size: .88rem; font-weight: 800; }
.payment-option-sub { font-size: .74rem; color: var(--text2); }

/* ── Checkout type selector ────────────────────────────────────── */
.checkout-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.checkout-type-btn {
  padding: 16px 12px;
  border-radius: var(--r-lg);
  border: 2px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: all var(--t);
}
.checkout-type-btn .ct-icon { font-size: 1.8rem; margin-bottom: 8px; }
.checkout-type-btn .ct-label { font-size: .86rem; font-weight: 900; display: block; }
.checkout-type-btn .ct-sub { font-size: .72rem; color: var(--text2); font-weight: 600; }
.checkout-type-btn.active { border-color: var(--gold); background: rgba(255,213,31,.08); }
.checkout-type-btn:hover { border-color: rgba(255,213,31,.4); }

/* ── Order Confirm ─────────────────────────────────────────────── */
.confirm-icon {
  width: 80px; height: 80px;
  border-radius: var(--r-xl);
  background: rgba(34,197,94,.12);
  border: 2px solid rgba(34,197,94,.4);
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  margin: 0 auto 16px;
  box-shadow: 0 0 40px rgba(34,197,94,.2);
}
.order-ref {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: .8rem;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  text-align: center;
  color: var(--text2);
  margin: 10px 0;
}
.order-ref strong { color: var(--gold); display: block; font-size: .9rem; letter-spacing: .05em; }

/* ── Hero Banner ───────────────────────────────────────────────── */
.hero-banner {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: linear-gradient(135deg, #111118, #1a1a28);
  border: 1px solid var(--line);
  padding: 24px 20px;
  margin-bottom: 20px;
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,213,31,.2), transparent 70%);
}
.hero-eyebrow {
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--gold);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
  animation: pulse 1.8s infinite;
}
@keyframes pulse { 50% { opacity:.4; transform:scale(.7); } }
.hero-title { font-size: 1.6rem; font-weight: 900; line-height: 1.1; color: var(--white); margin-bottom: 6px; }
.hero-title .highlight { color: var(--gold); }
.hero-sub { font-size: .82rem; color: var(--text2); font-weight: 600; margin-bottom: 16px; }

/* ── Load More ─────────────────────────────────────────────────── */
.load-more-wrap { text-align: center; margin: 20px 0; }
.load-more-btn { min-width: 160px; }

/* ── Sticky bottom action bar ──────────────────────────────────── */
.sticky-action-bar {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100%);
  padding: 12px 16px;
  background: rgba(10,10,15,.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 90;
  padding-left:  calc(var(--pad) + var(--safe-left));
  padding-right: calc(var(--pad) + var(--safe-right));
}

/* ── Product detail full page ──────────────────────────────────── */
.product-full-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--surface2);
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 800;
  color: var(--text2);
  background: var(--surface3);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 7px 14px;
  margin-bottom: 14px;
  text-decoration: none;
  transition: color var(--t);
}
.back-btn:hover { color: var(--text); text-decoration: none; }

/* ════════════════════════════════════════════════════════════════
   SPK Rewards — Loyalty Points UI
   ════════════════════════════════════════════════════════════════ */

/* Loyalty card on checkout */
.loyalty-card {
  background: linear-gradient(135deg, rgba(255,213,31,.1), rgba(255,190,0,.05));
  border: 1px solid rgba(255,213,31,.35);
  border-radius: 20px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.loyalty-card::before {
  content: '';
  position: absolute; inset: 0 0 auto; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,213,31,.6), transparent);
}
.loyalty-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.loyalty-card-icon {
  font-size: 1.4rem;
  width: 42px; height: 42px;
  border-radius: 14px;
  background: rgba(255,213,31,.15);
  border: 1px solid rgba(255,213,31,.3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.loyalty-card-info {
  flex: 1;
  min-width: 0;
}
.loyalty-card-info strong {
  display: block;
  font-size: .88rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1.2;
}
.loyalty-card-info span {
  display: block;
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  margin-top: 2px;
}

/* Toggle switch */
.loyalty-toggle-wrap {
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.loyalty-toggle-wrap input { display: none; }
.loyalty-toggle {
  display: block;
  width: 46px; height: 26px;
  border-radius: 13px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.15);
  position: relative;
  transition: background .2s, border-color .2s;
}
.loyalty-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.loyalty-toggle-wrap input:checked + .loyalty-toggle {
  background: var(--gold);
  border-color: var(--gold);
}
.loyalty-toggle-wrap input:checked + .loyalty-toggle::after {
  transform: translateX(20px);
  background: #0a0a0f;
}

/* Slider row */
.loyalty-use-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,213,31,.2);
  animation: loySlideIn .25s ease both;
}
@keyframes loySlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.loyalty-slider-wrap { margin-bottom: 8px; }
.loyalty-slider {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,213,31,.2);
  outline: none;
  cursor: pointer;
}
.loyalty-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid #0a0a0f;
  box-shadow: 0 0 12px rgba(255,213,31,.5);
  cursor: pointer;
  transition: transform .15s;
}
.loyalty-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.loyalty-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: .68rem;
  color: rgba(255,255,255,.4);
  font-weight: 700;
  margin-top: 4px;
}
.loyalty-preview {
  text-align: center;
  font-size: .8rem;
  color: rgba(255,255,255,.7);
  padding: 8px 12px;
  background: rgba(255,213,31,.06);
  border-radius: 12px;
  border: 1px solid rgba(255,213,31,.15);
}

/* Loyalty balance card on account page */
.loy-balance-card {
  background: linear-gradient(135deg, rgba(255,213,31,.12), rgba(255,190,0,.06));
  border: 1px solid rgba(255,213,31,.35);
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.loy-balance-card::before {
  content: '';
  position: absolute; inset: 0 0 auto; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,213,31,.7), transparent);
}
.loy-balance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.loy-balance-label {
  font-size: .65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(255,213,31,.8);
  display: flex;
  align-items: center;
  gap: 7px;
}
.loy-balance-label::before {
  content: '⭐';
  font-size: .9rem;
}
.loy-balance-big {
  font-size: 2.2rem;
  font-weight: 950;
  color: var(--gold);
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: 4px;
}
.loy-balance-ghs {
  font-size: .84rem;
  font-weight: 700;
  color: rgba(255,255,255,.5);
}
.loy-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,213,31,.15);
}
.loy-stat {
  text-align: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255,213,31,.07);
}
.loy-stat-val {
  font-size: 1.1rem;
  font-weight: 950;
  color: var(--gold);
  display: block;
  margin-bottom: 2px;
}
.loy-stat-lbl {
  font-size: .62rem;
  color: rgba(255,255,255,.4);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Loyalty history log */
.loy-log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.loy-log-item:last-child { border-bottom: none; }
.loy-log-dot {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: .9rem;
  flex-shrink: 0;
}
.loy-log-dot.earn    { background: rgba(34,197,94,.15);  }
.loy-log-dot.redeem  { background: rgba(255,213,31,.15); }
.loy-log-dot.expire  { background: rgba(239,68,68,.15);  }
.loy-log-dot.manual  { background: rgba(113,168,255,.15);}
.loy-log-dot.bonus   { background: rgba(168,85,247,.15); }
.loy-log-info { flex: 1; min-width: 0; }
.loy-log-note { font-size: .78rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.loy-log-date { font-size: .67rem; color: rgba(255,255,255,.35); margin-top: 2px; }
.loy-log-pts  { font-size: .9rem; font-weight: 950; flex-shrink: 0; }
.loy-log-pts.earn   { color: #86efac; }
.loy-log-pts.redeem { color: #fcd34d; }
.loy-log-pts.expire { color: #fca5a5; }
.loy-log-pts.manual { color: #93c5fd; }

/* Order confirm earn banner */
.loy-earn-banner {
  background: linear-gradient(135deg, rgba(34,197,94,.12), rgba(34,197,94,.05));
  border: 1px solid rgba(34,197,94,.3);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  animation: loySlideIn .35s ease both .4s;
  position: relative;
  overflow: hidden;
}
.loy-earn-banner::before {
  content: '';
  position: absolute; inset: 0 0 auto; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34,197,94,.5), transparent);
}
.loy-earn-icon {
  font-size: 1.6rem;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.25);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.loy-earn-text strong { display: block; font-weight: 900; font-size: .9rem; color: #86efac; margin-bottom: 2px; }
.loy-earn-text span   { font-size: .76rem; color: rgba(255,255,255,.5); }

/* ── Variant chips (modal + product page) ────────────────────────────────── */
.modal-variant-chip {
  border: 1.5px solid var(--border, #2a2a2a);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: .82rem;
  font-weight: 700;
  background: var(--surface, #111);
  color: var(--text, #fff);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  text-align: left;
  line-height: 1.3;
}
.modal-variant-chip:hover:not(:disabled) {
  border-color: var(--gold, #f4c542);
  color: var(--gold, #f4c542);
}
.modal-variant-chip.selected {
  background: var(--gold, #f4c542);
  border-color: var(--gold, #f4c542);
  color: #111;
}
.modal-variant-chip.out-of-stock {
  opacity: .38;
  cursor: not-allowed;
  text-decoration: line-through;
}
@keyframes priceFlash {
  0%   { opacity: .3; transform: scale(.95); }
  100% { opacity: 1;  transform: scale(1);  }
}
.modal-product-price { transition: color .15s; }

/* ── Modal variant chips ─────────────────────────────────────────────────── */
.modal-vchip {
  border: 1.5px solid #2a2a2a; border-radius: 10px;
  padding: 9px 15px; font-size: .82rem; font-weight: 700;
  background: #111; color: #fff; cursor: pointer; text-align: left;
  line-height: 1.3; transition: border-color .13s, background .13s, color .13s;
}
.modal-vchip:hover:not(.modal-vchip-out) { border-color: #f4c542; color: #f4c542; }
.modal-vchip.modal-vchip-sel {
  background: #f4c542; border-color: #f4c542; color: #111 !important;
}
.modal-vchip.modal-vchip-out {
  opacity: .35; cursor: not-allowed; text-decoration: line-through;
}
@keyframes priceIn { from { opacity: .2; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.modal-product-price { animation: none; }
.modal-product-price.flash { animation: priceIn .2s ease-out; }
