/* ============================================
   Thème template — identique au style "West Coast" de Snoop Weed
   (néon vert citron + bleu électrique + jaune, glassmorphism sombre)
   Seul le fond (image ou couleur, piloté par store.json) change par client.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Luckiest+Guy&family=Poppins:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500&display=swap');

:root,
body[data-theme="template"] {
  --wc-bg: #070a07;
  --wc-bg-soft: #0d120c;
  --wc-surface: rgba(9, 13, 8, 0.92);
  --wc-panel: rgba(17, 23, 16, 0.94);
  --wc-panel-strong: rgba(13, 18, 12, 0.98);
  --wc-border: rgba(158, 232, 19, 0.16);
  --wc-border-strong: rgba(158, 232, 19, 0.4);
  --wc-green: #9ee813;
  --wc-green-soft: #c6f75f;
  --wc-blue: #1fa8e8;
  --wc-yellow: #fcc81a;
  --wc-red: #ff2e3b;
  --wc-text: #f3f7ea;
  --wc-text-soft: #cfd9c4;
  --wc-text-muted: #9aa792;
  --wc-glow-green: 0 0 18px rgba(158, 232, 19, 0.55), 0 0 40px rgba(158, 232, 19, 0.25);
  --wc-glow-blue: 0 0 18px rgba(31, 168, 232, 0.6), 0 0 44px rgba(31, 168, 232, 0.28);
  --wc-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  --wc-radius-xl: 26px;
  --wc-radius-lg: 20px;
  --wc-radius-md: 16px;
  --wc-display-font: 'Luckiest Guy', cursive;
}

body[data-theme="template"] {
  background:
    radial-gradient(circle at top left, rgba(158, 232, 19, 0.12), transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(31, 168, 232, 0.1), transparent 26%),
    radial-gradient(circle at 50% 80%, rgba(252, 200, 26, 0.06), transparent 30%),
    linear-gradient(180deg, var(--custom-bg, #070a07) 0%, #050704 100%) !important;
  background-size: cover !important;
  background-position: center !important;
  background-attachment: fixed !important;
  color: var(--wc-text) !important;
  font-family: 'Poppins', sans-serif;
}

/* Quand store.json fournit backgroundImage, main.js pose --custom-bg-image ici */
body[data-theme="template"].has-custom-bg {
  background-image:
    radial-gradient(circle at top left, rgba(158, 232, 19, 0.12), transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(31, 168, 232, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(5, 7, 5, 0.55), rgba(5, 7, 5, 0.75)),
    var(--custom-bg-image) !important;
  background-size: cover !important;
  background-position: center !important;
  background-attachment: fixed !important;
}

body[data-theme="template"]::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body[data-theme="template"] #appContent {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.6)) !important;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-bottom: 120px !important;
}

/* ---------- PANNEAUX VERRE ---------- */
body[data-theme="template"] .glass {
  background: linear-gradient(180deg, rgba(17, 23, 16, 0.92), rgba(7, 10, 7, 0.94)) !important;
  border: 1px solid var(--wc-border) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--wc-shadow) !important;
}

body[data-theme="template"] .scrollbar-none::-webkit-scrollbar {
  display: none;
}
body[data-theme="template"] .scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ---------- LABELS DE SECTION ---------- */
body[data-theme="template"] p.text-xs.font-semibold.uppercase {
  color: var(--wc-green) !important;
  letter-spacing: 0.24em;
  text-shadow: 0 0 12px rgba(158, 232, 19, 0.35);
}

/* ---------- TITRES / POLICE D'AFFICHAGE ---------- */
body[data-theme="template"] #modalName,
body[data-theme="template"] h2#modalName {
  font-family: var(--wc-display-font) !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--wc-text) !important;
  text-shadow: 2px 2px 0 rgba(158, 232, 19, 0.35);
  padding-right: 4.5rem;
  line-height: 1.15;
}

/* ---------- PANNEAU PROFIL ---------- */
body[data-theme="template"] #userProfilePanel,
body[data-theme="template"] #basketSection > div,
body[data-theme="template"] #infoSection > div,
body[data-theme="template"] #contactSection > div,
body[data-theme="template"] #reviewsSection > div {
  border-radius: var(--wc-radius-lg) !important;
}

body[data-theme="template"] #userProfilePanel {
  position: relative;
  overflow: hidden;
  max-width: 1100px;
  margin-bottom: 1.5rem;
  background:
    radial-gradient(circle at 100% 0, rgba(158, 232, 19, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(13, 18, 12, 0.98), rgba(7, 10, 7, 0.96)) !important;
  border-color: var(--wc-border-strong) !important;
}

body[data-theme="template"] #userGreetingBlock {
  flex: 1 1 auto;
  min-width: 0;
}

body[data-theme="template"] #userGreeting {
  color: #ffffff !important;
  font-family: var(--wc-display-font);
  letter-spacing: 0.01em;
}

body[data-theme="template"] #userIdLabel,
body[data-theme="template"] #userProfilePanel p {
  color: var(--wc-text-soft) !important;
}

/* ---------- GRILLE PRODUITS ---------- */
body[data-theme="template"] #shoppingLayout {
  display: block;
  width: 100%;
  max-width: 1100px;
}

body[data-theme="template"] #categoryRail {
  margin-bottom: 1.5rem;
}

body[data-theme="template"] #productsGrid {
  width: 100%;
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  row-gap: 1rem !important;
}

/* ---------- CARTES PRODUIT ---------- */
body[data-theme="template"] #productsGrid > div {
  position: relative;
  min-height: 260px;
  padding: 1rem;
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  align-items: flex-start !important;
  border-radius: var(--wc-radius-xl) !important;
  border: 1px solid rgba(158, 232, 19, 0.16) !important;
  background: rgba(8, 10, 8, 0.94) !important;
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.45) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body[data-theme="template"] #productsGrid > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(158, 232, 19, 0.2) !important;
}

body[data-theme="template"] #productsGrid > div::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 48%, rgba(5, 8, 5, 0.95) 100%);
  pointer-events: none;
  z-index: 1;
}

body[data-theme="template"] #productsGrid img {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 0;
  filter: saturate(1.08);
}

body[data-theme="template"] #productsGrid .absolute {
  top: 1rem;
  left: 1rem;
  transform: none;
  max-width: calc(100% - 2rem);
  padding: 0.4rem 0.75rem;
  border-radius: 999px !important;
  border: 1px solid rgba(31, 168, 232, 0.4) !important;
  background: rgba(6, 16, 22, 0.9) !important;
  color: #8fd9ff !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  z-index: 2;
}

body[data-theme="template"] #productsGrid .text-xl.font-semibold {
  position: relative;
  z-index: 2;
  margin: 0 !important;
  font-family: var(--wc-display-font) !important;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #ffffff !important;
  font-size: 1.2rem !important;
  line-height: 1.05;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.85), 1px 1px 0 rgba(158, 232, 19, 0.4);
}

body[data-theme="template"] #productsGrid button {
  position: absolute;
  right: 0.7rem;
  top: 0.7rem;
  width: 50px;
  height: 50px;
  padding: 0;
  z-index: 2;
  border-radius: 999px !important;
  border: 1px solid rgba(158, 232, 19, 0.7) !important;
  background: linear-gradient(180deg, var(--wc-green) 0%, #6fae0a 100%) !important;
  color: #0a2b0a !important;
  box-shadow: var(--wc-glow-green), 0 0 0 6px rgba(158, 232, 19, 0.08) !important;
}

body[data-theme="template"] #productsGrid button:hover {
  transform: scale(1.05);
}

/* ---------- MODALE PRODUIT ---------- */
body[data-theme="template"] #productModal {
  background: rgba(3, 5, 3, 0.85) !important;
}

body[data-theme="template"] #productModal .glass {
  border-radius: 28px !important;
  border-color: var(--wc-border-strong) !important;
  background:
    radial-gradient(circle at top right, rgba(31, 168, 232, 0.14), transparent 20%),
    linear-gradient(180deg, rgba(15, 21, 14, 0.98), rgba(6, 8, 6, 0.98)) !important;
}

body[data-theme="template"] #modalDesc,
body[data-theme="template"] #modalDesc * {
  color: var(--wc-text-soft) !important;
}

body[data-theme="template"] #closeModal,
body[data-theme="template"] #qtyMinus,
body[data-theme="template"] #qtyPlus,
body[data-theme="template"] #modalOption,
body[data-theme="template"] #modalQty {
  background: rgba(13, 18, 12, 0.96) !important;
  border: 1px solid var(--wc-border) !important;
  color: var(--wc-text) !important;
}

body[data-theme="template"] #modalPrice {
  color: var(--wc-yellow) !important;
  font-family: var(--wc-display-font);
  letter-spacing: 0.01em;
  text-shadow: 0 0 12px rgba(252, 200, 26, 0.35);
}

body[data-theme="template"] #modalPurchase,
body[data-theme="template"] #confirmOrderBtn {
  border: 1px solid rgba(158, 232, 19, 0.7) !important;
  background: linear-gradient(180deg, var(--wc-green) 0%, #6fae0a 100%) !important;
  color: #0a2b0a !important;
  font-weight: 700;
  box-shadow: var(--wc-glow-green), 0 0 0 8px rgba(158, 232, 19, 0.06) !important;
}

body[data-theme="template"] #copyRecapBtn {
  border: 1px solid var(--wc-border-strong) !important;
  background: rgba(158, 232, 19, 0.08) !important;
  color: var(--wc-green-soft) !important;
}

/* ---------- PANIER ---------- */
body[data-theme="template"] #basketItems .glass p.text-gray-300 {
  color: var(--wc-yellow) !important;
  font-weight: 700;
}

body[data-theme="template"] .removeBtn {
  background: rgba(255, 46, 59, 0.85) !important;
  border-color: rgba(255, 46, 59, 0.4) !important;
}

/* ---------- ÉTOILES AVIS ---------- */
body[data-theme="template"] .star-btn.is-filled,
body[data-theme="template"] .star-display.is-filled {
  color: var(--wc-yellow) !important;
  text-shadow: 0 0 8px rgba(252, 200, 26, 0.4);
}

/* ---------- NAVIGATION BASSE ---------- */
body[data-theme="template"] #bottomNav {
  bottom: 0 !important;
  left: 0 !important;
  transform: none !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0.65rem 0 calc(38px + 0.65rem) 0 !important;
  border-radius: 0 !important;
  border: none !important;
  border-top: 1px solid rgba(158, 232, 19, 0.12) !important;
  background: linear-gradient(180deg, rgba(5, 7, 5, 0.4), rgba(4, 6, 4, 0.96)) !important;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  gap: 0 !important;
}

body[data-theme="template"] #bottomNav button {
  min-height: auto !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0.2rem 0 !important;
  color: #7d8a75 !important;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

body[data-theme="template"] #bottomNav button svg {
  margin-bottom: 0.35rem !important;
  width: 26px !important;
  height: 26px !important;
}

body[data-theme="template"] #bottomNav button span {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
}

body[data-theme="template"] #bottomNav button.is-active {
  background: transparent !important;
  color: var(--wc-green) !important;
  text-shadow: 0 0 10px rgba(158, 232, 19, 0.6);
  box-shadow: none !important;
  transform: none !important;
}

body[data-theme="template"] #bottomNav button.is-active svg {
  color: var(--wc-green) !important;
  filter: drop-shadow(0 0 6px rgba(158, 232, 19, 0.55));
}

/* ---------- BADGE PANIER ---------- */
body[data-theme="template"] #basketBadge {
  background: var(--wc-yellow) !important;
  color: #2b1e00 !important;
  box-shadow: 0 0 10px rgba(252, 200, 26, 0.6);
}

body[data-theme="template"] #basketBadge.is-bumping {
  animation: wc-badge-bump 0.35s ease;
}

@keyframes wc-badge-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ---------- ANIMATION "VOL VERS LE PANIER" ---------- */
.fly-to-cart {
  position: fixed;
  z-index: 70;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.3, 0, 0.6, 1), opacity 0.55s ease;
}

/* ---------- ÉCRAN DE CHARGEMENT (logo) ---------- */
#loadingOverlay img {
  max-width: 160px;
  max-height: 160px;
  object-fit: contain;
  margin-bottom: 1rem;
}

/* ---------- ANIMATION DE CONFIRMATION DE COMMANDE ---------- */
#orderSuccessOverlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 5, 3, 0.88);
}

#orderSuccessOverlay .check-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--wc-green);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--wc-glow-green);
  animation: wc-pop-in 0.4s cubic-bezier(0.2, 1.4, 0.5, 1);
}

#orderSuccessOverlay svg {
  width: 48px;
  height: 48px;
  stroke: var(--wc-green);
}

#orderSuccessOverlay svg path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: wc-draw-check 0.4s 0.15s ease forwards;
}

@keyframes wc-pop-in {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes wc-draw-check {
  to { stroke-dashoffset: 0; }
}

/* ---------- PILLS CATÉGORIES ---------- */
body[data-theme="template"] #categoryPills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
body[data-theme="template"] #categoryPills::-webkit-scrollbar { display: none; }

body[data-theme="template"] .category-pill {
  flex: 0 0 auto;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(158, 232, 19, 0.16);
  background: rgba(13, 18, 12, 0.82);
  color: var(--wc-text-soft);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.78rem;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body[data-theme="template"] .category-pill.is-active {
  border-color: rgba(158, 232, 19, 0.7);
  background: linear-gradient(180deg, var(--wc-green) 0%, #6fae0a 100%);
  color: #0a2b0a;
  box-shadow: var(--wc-glow-green);
}

/* ---------- NOTIFICATIONS ---------- */
body[data-theme="template"] .sn-notifications-container {
  top: 84px !important;
}

body[data-theme="template"] .sn-notifications-container .sn-notify {
  background: rgba(13, 18, 12, 0.96);
  border: 1px solid var(--wc-border-strong);
  box-shadow: var(--wc-glow-green);
  color: var(--wc-text);
}

body[data-theme="template"] .sn-notifications-container .sn-notify-title,
body[data-theme="template"] .sn-notifications-container .sn-notify-text,
body[data-theme="template"] .sn-notifications-container .sn-notify-close {
  color: var(--wc-text);
}

body[data-theme="template"] .sn-notifications-container .sn-notify-progress {
  background-color: var(--wc-green);
}

/* ---------- RESPONSIVE ---------- */
@media (min-width: 900px) {
  body[data-theme="template"] #appContent {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  body[data-theme="template"] #productsGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  body[data-theme="template"] #productsGrid {
    gap: 0.85rem;
  }
  body[data-theme="template"] #productsGrid > div {
    min-height: 200px;
    padding: 0.75rem;
  }
  body[data-theme="template"] #productsGrid .text-xl.font-semibold {
    font-size: 1rem !important;
  }
  body[data-theme="template"] #productsGrid button {
    right: 0.5rem;
    top: 0.5rem;
    width: 30px;
    height: 30px;
  }
}
