/* ============================================
   IRON THRONE COMMAND CENTER — STYLE.CSS
   VapeShop.bh Realm Theme
   ============================================ */

/* --- DESIGN TOKENS --- */
:root {
  --gold: #DAB048;
  --gold-bright: #F0C860;
  --gold-dim: #A88030;
  --ember: #FF6B2B;
  --stone-dark: #0d0d0d;
  --stone: #1a1a1a;
  --stone-mid: #252525;
  --stone-light: #333;
  --text: #d4cfc7;
  --text-bright: #f0ece4;
  --text-muted: #666;

  --card-bg: rgba(26, 26, 26, 0.85);
  --card-border: rgba(218, 176, 72, 0.1);
  --card-border-hover: rgba(218, 176, 72, 0.4);
  --bar-bg: rgba(0, 0, 0, 0.75);
  --bar-blur: blur(14px);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --top-bar-h: 56px;
  --bottom-bar-h: 40px;

  --font-display: 'Cinzel Decorative', serif;
  --font-heading: 'Cinzel', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- RESET & BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--stone-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  color: var(--gold);
  text-decoration: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--stone-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--stone-light);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dim);
}

/* --- 3D BACKGROUND CANVAS --- */
#throne-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- TOP BAR --- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: var(--top-bar-h);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  background: var(--bar-bg);
  backdrop-filter: var(--bar-blur);
  -webkit-backdrop-filter: var(--bar-blur);
  border-bottom: 1px solid rgba(218, 176, 72, 0.08);
}

.logo {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.logo span {
  color: var(--gold-dim);
  font-size: 12px;
  font-weight: 400;
}

/* Category pills */
.category-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.category-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--stone-light);
  color: var(--text-muted);
  background: rgba(37, 37, 37, 0.6);
  transition: all 0.25s var(--ease-out);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.pill:hover,
.pill.active {
  color: var(--stone-dark);
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(218, 176, 72, 0.25);
}

/* Top bar actions */
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cart-btn,
.game-hub-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 20px;
  transition: background 0.2s;
}
.cart-btn:hover,
.game-hub-btn:hover {
  background: rgba(218, 176, 72, 0.1);
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--ember);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0);
  transition: transform 0.3s var(--ease-spring);
}
.cart-badge.visible {
  transform: scale(1);
}

/* --- MAIN CONTENT (Product Grid Area) --- */
.main-content {
  position: relative;
  z-index: 5;
  padding-top: calc(var(--top-bar-h) + 12px);
  padding-bottom: calc(var(--bottom-bar-h) + 20px);
  min-height: 100vh;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 10px;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- PRODUCT CARD --- */
.product-card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover);
  box-shadow: 0 8px 32px rgba(218, 176, 72, 0.12), 0 0 0 1px rgba(218, 176, 72, 0.15);
}

.product-card:active {
  transform: translateY(-2px);
}

.card-category-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.6);
  color: var(--gold);
  border: 1px solid rgba(218, 176, 72, 0.15);
  z-index: 2;
}

.card-sale-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--ember);
  color: #fff;
  z-index: 2;
}

.card-image-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 aspect */
  background: linear-gradient(180deg, rgba(26,26,26,0.3), rgba(13,13,13,0.6));
  overflow: hidden;
}

.card-image-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  transition: transform 0.4s var(--ease-out);
}

.product-card:hover .card-image-wrap img {
  transform: scale(1.05);
}

.card-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card-name {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-bright);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-brand {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.card-price {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
}

.card-price-old {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.card-price-currency {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

.card-add-btn {
  margin-top: 8px;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--stone-dark);
  background: linear-gradient(135deg, var(--gold-dim), var(--gold), var(--gold-bright));
  transition: all 0.25s var(--ease-out);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.card-add-btn:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright), #fff3c4);
  box-shadow: 0 4px 16px rgba(218, 176, 72, 0.3);
}

.card-add-btn:active {
  transform: scale(0.97);
}

/* Rating stars */
.card-rating {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--gold-dim);
}

/* --- PRODUCT DETAIL MODAL --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  background: var(--stone);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-out);
}

.modal-overlay.open .modal-panel {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  z-index: 2;
  transition: background 0.2s;
}
.modal-close:hover {
  background: rgba(218, 176, 72, 0.2);
}

.modal-image-wrap {
  position: relative;
  width: 100%;
  padding-top: 80%;
  background: linear-gradient(180deg, rgba(37,37,37,0.5), rgba(13,13,13,0.8));
}

.modal-image-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px;
}

.modal-body {
  padding: 20px;
}

.modal-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-dim);
  margin-bottom: 4px;
}

.modal-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1.3;
  margin-bottom: 8px;
}

.modal-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 12px;
}
.modal-rating .rating-text {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-price {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}
.modal-price .currency {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
}
.modal-price-old {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-bottom: 12px;
}

.modal-description {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 20px;
}
.modal-description p {
  margin-bottom: 8px;
}

/* Quantity selector */
.qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.qty-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--stone-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--gold);
  background: var(--stone-mid);
  transition: background 0.2s;
}
.qty-btn:hover {
  background: var(--stone-light);
}

.qty-value {
  width: 48px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  background: var(--stone);
}

/* Modal action buttons */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-add-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--stone-dark);
  background: linear-gradient(135deg, var(--gold-dim), var(--gold), var(--gold-bright));
  transition: all 0.25s var(--ease-out);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.modal-add-btn:hover {
  box-shadow: 0 4px 20px rgba(218, 176, 72, 0.35);
}

.modal-secondary-actions {
  display: flex;
  gap: 8px;
}

.modal-link-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--stone-mid);
  border: 1px solid var(--stone-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  transition: all 0.2s;
}
.modal-link-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.modal-link-btn.whatsapp {
  color: #25D366;
  border-color: rgba(37, 211, 102, 0.2);
}
.modal-link-btn.whatsapp:hover {
  border-color: #25D366;
  background: rgba(37, 211, 102, 0.08);
}

/* --- CART DRAWER --- */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 26;
  width: 340px;
  max-width: 90vw;
  background: var(--stone);
  border-left: 1px solid var(--card-border);
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out);
  display: flex;
  flex-direction: column;
}
.cart-drawer.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(218, 176, 72, 0.08);
}

.cart-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}

.cart-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.cart-close:hover {
  background: rgba(218, 176, 72, 0.1);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.cart-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 14px;
}
.cart-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cart-item-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--stone-mid);
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-price {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--stone-mid);
  border: 1px solid var(--stone-light);
  color: var(--text);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.cart-qty-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.cart-item-qty span {
  font-size: 13px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}

.cart-item-remove {
  align-self: flex-start;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.2s;
}
.cart-item-remove:hover {
  color: var(--ember);
  background: rgba(255, 107, 43, 0.1);
}

.cart-footer {
  padding: 16px;
  border-top: 1px solid rgba(218, 176, 72, 0.1);
}

.cart-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cart-subtotal-label {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cart-subtotal-value {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
}

.cart-checkout-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--stone-dark);
  background: linear-gradient(135deg, var(--gold-dim), var(--gold), var(--gold-bright));
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s;
}
.cart-checkout-btn:hover {
  box-shadow: 0 4px 20px rgba(218, 176, 72, 0.35);
}

/* --- GAME HUB PANEL --- */
.gamehub-overlay {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.gamehub-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.gamehub-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: 340px;
  max-width: 90vw;
  background: var(--stone);
  border-left: 1px solid var(--card-border);
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.gamehub-panel.open {
  transform: translateX(0);
}

.gamehub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(218, 176, 72, 0.08);
}

.gamehub-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}

.gamehub-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.gamehub-close:hover {
  background: rgba(218, 176, 72, 0.1);
}

.gamehub-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gamehub-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--stone-mid);
  border: 1px solid var(--card-border);
  transition: all 0.25s;
  min-height: 56px;
  text-decoration: none;
}
.gamehub-item:hover {
  border-color: var(--gold-dim);
  background: rgba(218, 176, 72, 0.05);
}

.gamehub-item-icon {
  font-size: 24px;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.gamehub-item-text {
  flex: 1;
}

.gamehub-item-name {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-bright);
  margin-bottom: 2px;
}

.gamehub-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.gamehub-item-arrow {
  color: var(--text-muted);
  font-size: 16px;
  flex-shrink: 0;
}

/* --- BOTTOM BAR --- */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: var(--bottom-bar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bar-bg);
  backdrop-filter: var(--bar-blur);
  -webkit-backdrop-filter: var(--bar-blur);
  border-top: 1px solid rgba(218, 176, 72, 0.06);
}

.bottom-bar a {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 40px;
  transition: color 0.2s;
}
.bottom-bar a:hover {
  color: var(--gold);
}

/* --- TOAST NOTIFICATION --- */
.toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 50;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--stone-dark);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease-spring);
  box-shadow: 0 4px 20px rgba(218, 176, 72, 0.3);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- LOADING STATE --- */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--stone-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--text-muted);
}

/* --- ATTRIBUTION FOOTER --- */
.attribution {
  text-align: center;
  padding: 20px 16px 8px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
}
.attribution a {
  color: var(--text-muted);
}
.attribution a:hover {
  color: var(--gold-dim);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet: 3 columns */
@media (min-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 0 16px;
  }
  .card-name {
    font-size: 13px;
  }
  .card-price {
    font-size: 16px;
  }
  .logo {
    font-size: 18px;
  }
  .pill {
    font-size: 12px;
    padding: 6px 16px;
  }
}

/* Desktop: 4 columns + modal center */
@media (min-width: 960px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0 24px;
  }
  .card-info {
    padding: 12px;
  }
  .card-name {
    font-size: 14px;
  }
  .card-price {
    font-size: 17px;
  }
  .card-add-btn {
    font-size: 12px;
  }
  .top-bar {
    padding: 0 24px;
  }
  .logo {
    font-size: 20px;
  }
  .pill {
    font-size: 12px;
    padding: 7px 18px;
  }

  /* Modal: center on desktop */
  .modal-overlay {
    align-items: center;
  }
  .modal-panel {
    border-radius: var(--radius-lg);
    max-height: 85vh;
    transform: translateY(40px) scale(0.95);
    opacity: 0;
    transition: transform 0.4s var(--ease-out), opacity 0.3s;
  }
  .modal-overlay.open .modal-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Large desktop */
@media (min-width: 1280px) {
  .product-grid {
    gap: 20px;
    padding: 0 32px;
  }
}

/* Desktop checkout: side-by-side columns */
@media (min-width: 720px) {
  .checkout-columns {
    flex-direction: row;
    align-items: flex-start;
  }
  .checkout-summary {
    flex: 1;
    position: sticky;
    top: 80px;
  }
  .checkout-form-wrap {
    flex: 1.2;
  }
}

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeInUp 0.4s var(--ease-out) both;
}

/* Stagger cards */
.product-card:nth-child(1) { animation-delay: 0.02s; }
.product-card:nth-child(2) { animation-delay: 0.04s; }
.product-card:nth-child(3) { animation-delay: 0.06s; }
.product-card:nth-child(4) { animation-delay: 0.08s; }
.product-card:nth-child(5) { animation-delay: 0.10s; }
.product-card:nth-child(6) { animation-delay: 0.12s; }
.product-card:nth-child(7) { animation-delay: 0.14s; }
.product-card:nth-child(8) { animation-delay: 0.16s; }

/* --- SEARCH BAR --- */
.search-toggle-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}
.search-toggle-btn:hover {
  background: rgba(218, 176, 72, 0.1);
  color: var(--gold);
}

.search-bar {
  position: fixed;
  top: var(--top-bar-h);
  left: 0;
  right: 0;
  z-index: 9;
  padding: 8px 12px;
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(218, 176, 72, 0.06);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s var(--ease-out), opacity 0.25s;
}
.search-bar.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.search-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--stone-mid);
  border: 1px solid var(--stone-light);
  border-radius: var(--radius-pill);
  padding: 0 14px;
  max-width: 600px;
  margin: 0 auto;
  transition: border-color 0.25s;
}
.search-bar-inner:focus-within {
  border-color: var(--gold-dim);
}

.search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-bright);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 0;
  min-height: 44px;
}
.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  color: var(--text-muted);
  transition: all 0.2s;
  opacity: 0;
  pointer-events: none;
  flex-shrink: 0;
}
.search-clear.visible {
  opacity: 1;
  pointer-events: auto;
}
.search-clear:hover {
  color: var(--text-bright);
  background: rgba(255,255,255,0.06);
}

/* --- SKELETON LOADING --- */
.skeleton-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.skeleton-image {
  width: 100%;
  padding-top: 100%;
  background: linear-gradient(90deg, var(--stone-mid) 25%, var(--stone-light) 50%, var(--stone-mid) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--stone-mid) 25%, var(--stone-light) 50%, var(--stone-mid) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.price { width: 40%; height: 16px; }
.skeleton-btn {
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--stone-mid) 25%, var(--stone-light) 50%, var(--stone-mid) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  margin-top: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Grid fade-in when loaded */
.product-grid.loaded {
  animation: gridFadeIn 0.4s var(--ease-out) both;
}
@keyframes gridFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- CART SHAKE ANIMATION --- */
@keyframes cartShake {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-12deg); }
  30% { transform: rotate(10deg); }
  45% { transform: rotate(-8deg); }
  60% { transform: rotate(6deg); }
  75% { transform: rotate(-3deg); }
}
.cart-btn.shake {
  animation: cartShake 0.5s var(--ease-out);
}

/* --- CARD ADD PULSE --- */
@keyframes goldPulse {
  0% { box-shadow: 0 0 0 0 rgba(218, 176, 72, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(218, 176, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(218, 176, 72, 0); }
}
.card-add-btn.pulse {
  animation: goldPulse 0.6s ease-out;
}

/* --- CATEGORY PILLS SCROLL SHADOWS --- */
.category-pills-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.category-pills-wrap::before,
.category-pills-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.category-pills-wrap::before {
  left: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.8), transparent);
}
.category-pills-wrap::after {
  right: 0;
  background: linear-gradient(270deg, rgba(0,0,0,0.8), transparent);
}
.category-pills-wrap.shadow-left::before { opacity: 1; }
.category-pills-wrap.shadow-right::after { opacity: 1; }

/* --- EMPTY CART STATE (enhanced) --- */
.cart-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}
.cart-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.cart-empty-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.cart-empty-browse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-height: 44px;
  transition: all 0.25s;
}
.cart-empty-browse:hover {
  background: rgba(218, 176, 72, 0.1);
  border-color: var(--gold);
}

/* --- TOP BAR SCROLL ENHANCEMENT --- */
.top-bar.scrolled {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* --- CHECKOUT OVERLAY --- */
.checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.92);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}
.checkout-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.checkout-panel {
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(218, 176, 72, 0.1);
  position: sticky;
  top: 0;
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 2;
}

.checkout-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

.checkout-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.checkout-close:hover {
  background: rgba(218, 176, 72, 0.1);
}

.checkout-body {
  flex: 1;
  padding: 20px;
}

.checkout-columns {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.checkout-section-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

/* Order summary */
.checkout-summary {
  background: var(--stone);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.checkout-item:last-child {
  border-bottom: none;
}
.checkout-item-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
}
.checkout-item-qty {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.checkout-item-price {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}

.checkout-totals {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(218, 176, 72, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checkout-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text);
}
.checkout-total-row.grand {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  padding-top: 8px;
  border-top: 1px solid rgba(218, 176, 72, 0.15);
  margin-top: 4px;
}

/* Checkout form */
.checkout-form-wrap {
  background: var(--stone);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.form-group label .req {
  color: var(--ember);
}
.form-group label .opt {
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  font-size: 10px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stone-light);
  background: var(--stone-mid);
  color: var(--text-bright);
  font-family: var(--font-body);
  font-size: 14px;
  min-height: 44px;
  transition: border-color 0.25s;
  outline: none;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold-dim);
}
.form-group input.invalid,
.form-group select.invalid,
.form-group textarea.invalid {
  border-color: var(--ember);
}
.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-group textarea {
  resize: vertical;
  min-height: 64px;
}

.field-error {
  font-size: 11px;
  color: var(--ember);
  margin-top: 4px;
  min-height: 0;
  overflow: hidden;
  transition: min-height 0.2s;
}
.field-error:not(:empty) {
  min-height: 16px;
}

/* Shipping & Payment radio cards */
.shipping-options,
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stone-light);
  background: var(--stone-mid);
  cursor: pointer;
  transition: all 0.25s;
  min-height: 48px;
}
.radio-card:hover {
  border-color: var(--gold-dim);
}
.radio-card.selected {
  border-color: var(--gold);
  background: rgba(218, 176, 72, 0.06);
}
.radio-card input[type="radio"] {
  display: none;
}
.radio-card-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--stone-light);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.25s;
}
.radio-card.selected .radio-card-dot {
  border-color: var(--gold);
}
.radio-card.selected .radio-card-dot::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}
.radio-card-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
}
.radio-card-price {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}

/* Payment cards */
.payment-card {
  min-height: 60px;
}
.payment-card-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.payment-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.payment-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
}
.payment-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Place order button */
.place-order-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--stone-dark);
  background: linear-gradient(135deg, var(--gold-dim), var(--gold), var(--gold-bright));
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  transition: all 0.25s;
  position: relative;
}
.place-order-btn:hover {
  box-shadow: 0 4px 24px rgba(218, 176, 72, 0.4);
}
.place-order-btn:active {
  transform: scale(0.98);
}
.place-order-btn.loading .place-order-text {
  opacity: 0;
}
.place-order-btn.loading .place-order-spinner {
  display: block;
}
.place-order-spinner {
  display: none;
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(13, 13, 13, 0.3);
  border-top-color: var(--stone-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --- ORDER CONFIRMATION --- */
.confirmation-overlay {
  position: fixed;
  inset: 0;
  z-index: 31;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}
.confirmation-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.confirmation-panel {
  text-align: center;
  padding: 40px 24px;
  max-width: 420px;
  width: 100%;
}

.confirmation-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: fadeInUp 0.5s var(--ease-out) both;
}
.confirmation-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-bright);
  margin-bottom: 8px;
  animation: fadeInUp 0.5s var(--ease-out) 0.1s both;
}
.confirmation-order {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 12px;
  animation: fadeInUp 0.5s var(--ease-out) 0.2s both;
}
.confirmation-message {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 28px;
  animation: fadeInUp 0.5s var(--ease-out) 0.3s both;
}

.confirmation-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeInUp 0.5s var(--ease-out) 0.4s both;
}
.confirmation-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-height: 48px;
  transition: all 0.25s;
  text-decoration: none;
}
.confirmation-btn.primary {
  color: var(--stone-dark);
  background: linear-gradient(135deg, var(--gold-dim), var(--gold), var(--gold-bright));
}
.confirmation-btn.primary:hover {
  box-shadow: 0 4px 20px rgba(218, 176, 72, 0.35);
}
.confirmation-btn.whatsapp {
  color: #25D366;
  border: 1px solid rgba(37, 211, 102, 0.3);
  background: rgba(37, 211, 102, 0.06);
}
.confirmation-btn.whatsapp:hover {
  border-color: #25D366;
  background: rgba(37, 211, 102, 0.12);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ Game Feature Iframe Panel ============ */
.gameframe-overlay {
  display: none; position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
}
.gameframe-overlay.open { display: flex; flex-direction: column; }
.gameframe-panel {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  background: #0d0d0d;
}
.gameframe-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: #111; border-bottom: 1px solid rgba(218,176,72,0.15);
  flex-shrink: 0;
}
.gameframe-back {
  background: none; border: 1px solid rgba(218,176,72,0.2); color: #DAB048;
  padding: 6px 14px; font-family: 'Cinzel', serif; font-size: 12px;
  cursor: pointer; border-radius: 6px; letter-spacing: 0.5px;
}
.gameframe-back:active { background: rgba(218,176,72,0.1); }
.gameframe-title {
  font-family: 'Cinzel', serif; font-size: 14px; color: #f0ece4; font-weight: 600;
}
.gameframe-close {
  background: none; border: none; color: #666; font-size: 24px; cursor: pointer; padding: 4px 8px;
}
.gameframe-iframe {
  flex: 1; width: 100%; border: none; background: #0d0d0d;
}
.gamehub-divider {
  height: 1px; background: rgba(218,176,72,0.1); margin: 6px 16px;
}
.gamehub-item-normal .gamehub-item-name { color: #888; }
