/* Thème Candy (08/11/2026) : l'habillage bonbon brillant de tous les écrans du moteur.
   Chargé par themes/charger.js avec vitrine.css (l'accueil). Actif seulement si <body data-glossy="candy">.
   Les couleurs viennent de --g-a … --g-d (posées par glossy.js, celles de la marque). */

body[data-theme="template"][data-glossy] {
  --g-a: #e020e0;   /* magenta */
  --g-b: #20d8f0;   /* cyan */
  --g-c: #ffd21a;   /* jaune */
  --g-d: #ff4a1a;   /* orange */
  --g-ink: #2a0b4a; /* encre */
  --g-ressort: cubic-bezier(.34, 1.56, .64, 1);
  --g-doux: cubic-bezier(.2, .8, .3, 1);
}

/* ---------- Animations communes ---------- */

/* Entrée en cascade : cachée seulement si le script a posé .g-anime (jamais de contenu perdu). */
body.g-anime[data-glossy] #productsGrid > .product-card {
  opacity: 0;
  translate: 0 26px;
  scale: .94;
}
body.g-anime[data-glossy] #productsGrid > .product-card.g-vu {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  transition: opacity .45s ease, translate .6s var(--g-ressort), scale .6s var(--g-ressort);
  transition-delay: calc(var(--g-i, 0) * 70ms);
}

/* Toucher : la carte s'écrase un peu, puis rebondit au relâcher. `scale` seul, le reste garde `transform`. */
body[data-glossy] #productsGrid > .product-card.g-tenu { scale: 1.03 .95; transition: scale .12s ease-out; }
body[data-glossy] #productsGrid > .product-card.g-rebond { animation: g-rebond .5s var(--g-ressort); }
@keyframes g-rebond { 0% { scale: 1.03 .95; } 45% { scale: .97 1.04; } 100% { scale: 1; } }

/* Reflet qui balaie chaque carte à tour de rôle. */
body[data-glossy] #productsGrid > .product-card .g-reflet {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; border-radius: inherit;
}
body[data-glossy] #productsGrid > .product-card .g-reflet::before {
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 45%; left: -60%;
  background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,.55) 45%, rgba(255,255,255,.05) 60%, transparent 70%);
  animation: g-reflet 5.5s ease-in-out infinite;
  animation-delay: calc(var(--g-i, 0) * .8s);
}
@keyframes g-reflet { 0%, 70% { left: -60%; } 100% { left: 130%; } }

/* Étincelles à l'ajout au panier. */
.g-etincelle {
  position: fixed; z-index: 9999; pointer-events: none; width: 10px; height: 10px; border-radius: 3px;
  background: var(--c, #fff); box-shadow: 0 0 10px var(--c, #fff);
  animation: g-jaillir .7s var(--g-doux, ease-out) forwards;
}
@keyframes g-jaillir {
  0% { transform: translate(-50%, -50%) rotate(0) scale(1); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--r)) scale(.2); opacity: 0; }
}

/* Le bouton + saute à l'ajout. */
body[data-glossy] #productsGrid .pc-add.is-added { animation: g-hop .6s var(--g-ressort) !important; }
@keyframes g-hop { 0% { scale: 1; } 30% { scale: 1.35; rotate: -12deg; } 60% { scale: .9; rotate: 8deg; } 100% { scale: 1; rotate: 0deg; } }

/* Le bouton panier respire doucement. */
body[data-glossy] #bottomNav #basketBtn img.nav-ico { animation: g-respire 2.8s ease-in-out infinite; }
@keyframes g-respire { 0%, 100% { scale: 1; } 50% { scale: 1.07; } }

/* Le logo flotte. */
body[data-glossy] .shop-logo { animation: g-flotte 4s ease-in-out infinite; }
@keyframes g-flotte { 0%, 100% { translate: 0 0; rotate: -2deg; } 50% { translate: 0 -4px; rotate: 2deg; } }

/* ============================================================
   CANDY : bonbon brillant façon Pixar
   ============================================================ */
body[data-theme="template"][data-glossy="candy"] .shop-header-inner {
  border: 2px solid rgba(255,255,255,.9);
  background:
    linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 55%),
    linear-gradient(135deg, var(--g-a), #8a2be2 55%, var(--g-b));
  box-shadow: 0 14px 30px rgba(90, 16, 168, .45), inset 0 -6px 14px rgba(0,0,0,.18), inset 0 2px 0 rgba(255,255,255,.8);
}
body[data-theme="template"][data-glossy="candy"] .shop-logo {
  border: 3px solid #fff; background: #fff; box-shadow: 0 8px 18px rgba(0,0,0,.25);
}
body[data-theme="template"][data-glossy="candy"] .shop-headings * { color: #fff !important; text-shadow: 0 2px 0 rgba(42,11,74,.45); }

body[data-theme="template"][data-glossy="candy"] .category-pill {
  border: 2px solid rgba(255,255,255,.85);
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(240,225,255,.9));
  color: var(--g-ink);
  box-shadow: 0 6px 14px rgba(42,11,74,.25), inset 0 -3px 0 rgba(42,11,74,.12);
}
body[data-theme="template"][data-glossy="candy"] .category-pill.is-active {
  background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,0) 50%), linear-gradient(135deg, var(--g-a), var(--g-d));
  color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25);
  box-shadow: 0 8px 18px rgba(224,32,224,.45), inset 0 -3px 0 rgba(0,0,0,.18);
}

body[data-theme="template"][data-glossy="candy"] #productsGrid > .product-card {
  border: 2px solid rgba(255,255,255,.95) !important;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.95), rgba(255,255,255,0) 55%),
    linear-gradient(160deg, #fff4fd, #f3e3ff 50%, #e2f8ff) !important;
  box-shadow: 0 16px 30px rgba(42,11,74,.35), inset 0 -8px 16px rgba(138,43,226,.12) !important;
}
body[data-theme="template"][data-glossy="candy"] #productsGrid > .product-card::after {
  background: linear-gradient(180deg, transparent 55%, rgba(255,255,255,.85) 78%, #fff 100%);
}
body[data-theme="template"][data-glossy="candy"] #productsGrid img {
  top: 8px !important; left: 8px !important; width: calc(100% - 16px) !important; height: 64% !important;
  border-radius: 20px !important; object-fit: cover !important;
  filter: saturate(1.15) drop-shadow(0 10px 12px rgba(42,11,74,.25));
}
body[data-theme="template"][data-glossy="candy"] #productsGrid .pc-name { color: var(--g-ink) !important; text-shadow: none; }
body[data-theme="template"][data-glossy="candy"] #productsGrid .pc-price {
  color: var(--g-a) !important; text-shadow: none; font-weight: 800;
}
body[data-theme="template"][data-glossy="candy"] #productsGrid .pc-price-from { color: #7a5c99 !important; }
body[data-theme="template"][data-glossy="candy"] #productsGrid .pc-badge {
  background: #fff !important; color: var(--g-a) !important; border: 2px solid var(--g-a) !important;
  rotate: -6deg; box-shadow: 0 4px 0 rgba(224,32,224,.35) !important; font-weight: 800;
}
body[data-theme="template"][data-glossy="candy"] #productsGrid .pc-add {
  border: 2px solid #fff !important;
  background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,0) 50%), linear-gradient(135deg, var(--g-d), var(--g-a)) !important;
  color: #fff !important;
  box-shadow: 0 8px 16px rgba(255,74,26,.45), inset 0 -3px 0 rgba(0,0,0,.18) !important;
}

/* ---------- CANDY : tous les écrans (fiche, panier, commande, infos, avis, contact) ---------- */
body[data-glossy="candy"] {
  --g-panneau:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,1), rgba(255,255,255,0) 60%),
    linear-gradient(165deg, #fffaff, #f6ebff 55%, #ebfaff);
}
/* Les panneaux deviennent des bonbons blancs brillants. */
body[data-theme="template"][data-glossy="candy"] #productModalPanel,
body[data-theme="template"][data-glossy="candy"] #basketSection > .glass,
body[data-theme="template"][data-glossy="candy"] #orderModal > .glass,
body[data-theme="template"][data-glossy="candy"] #infoSection .glass,
body[data-theme="template"][data-glossy="candy"] #reviewsSection .glass,
body[data-theme="template"][data-glossy="candy"] #contactSection > .glass,
body[data-theme="template"][data-glossy="candy"] #productsEmpty {
  background: var(--g-panneau) !important;
  border: 2px solid #fff !important;
  border-radius: 26px !important;
  box-shadow: 0 18px 40px rgba(42,11,74,.4), inset 0 -8px 18px rgba(138,43,226,.10), inset 0 2px 0 #fff !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
/* Texte foncé partout dans ces panneaux (le thème de base l'écrit clair, pour un fond noir). */
body[data-theme="template"][data-glossy="candy"] :is(#productModalPanel, #basketSection > .glass, #orderModal > .glass, #infoSection .glass, #reviewsSection .glass, #contactSection > .glass, #productsEmpty),
body[data-theme="template"][data-glossy="candy"] :is(#productModalPanel, #basketSection > .glass, #orderModal > .glass, #infoSection .glass, #reviewsSection .glass, #contactSection > .glass, #productsEmpty) :is(p, span, label, div, h2, h3, b, small, li, a:not(.wc-reseau)) {
  color: var(--g-ink) !important; text-shadow: none !important;
}
/* Petits titres dans les panneaux : magenta ; titres de page (hors panneaux) : blancs. */
body[data-theme="template"][data-glossy="candy"] :is(#productModalPanel, #orderModal > .glass, #reviewsSection .glass) p.uppercase,
body[data-theme="template"][data-glossy="candy"] #orderModal > .glass label,
body[data-theme="template"][data-glossy="candy"] #productModalPanel p.text-xs {
  color: var(--g-a) !important; letter-spacing: .14em;
}
body[data-theme="template"][data-glossy="candy"] .pageSection > p,
body[data-theme="template"][data-glossy="candy"] .pageSection > p.text-xs.font-semibold.uppercase {
  color: #fff !important; text-shadow: 0 2px 6px rgba(42,11,74,.7), 0 0 14px rgba(224,32,224,.45) !important;
}
body[data-theme="template"][data-glossy="candy"] #modalName {
  color: var(--g-ink) !important; text-shadow: 0 2px 0 rgba(224,32,224,.25) !important;
}
body[data-theme="template"][data-glossy="candy"] #modalMediaGallery img {
  filter: drop-shadow(0 14px 16px rgba(42,11,74,.28));
  animation: g-flotte 4.5s ease-in-out infinite;
}

/* Champs de saisie : blancs, bord lilas, 16 px (pas de zoom iPhone). */
body[data-theme="template"][data-glossy="candy"] :is(#productModalPanel, #orderModal, #reviewsSection) :is(input, select, textarea),
body[data-theme="template"][data-glossy="candy"] #productSearch {
  background: #fff !important; color: var(--g-ink) !important; font-size: 16px !important;
  border: 2px solid #e6d3ff !important; border-radius: 16px !important;
  box-shadow: inset 0 3px 6px rgba(42,11,74,.08) !important;
}
body[data-theme="template"][data-glossy="candy"] :is(input, textarea)::placeholder { color: #a48cc0 !important; }
body[data-theme="template"][data-glossy="candy"] :is(input, select, textarea):focus {
  outline: none !important; border-color: var(--g-a) !important; box-shadow: 0 0 0 4px rgba(224,32,224,.18) !important;
}

/* Bouton principal : gelée magenta → orange, reflet en haut, rebond au toucher. */
body[data-theme="template"][data-glossy="candy"] :is(#modalPurchase, .basket-cta, #confirmOrderBtn, #submitReviewBtn, #promoApplyBtn) {
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 48%), linear-gradient(135deg, var(--g-d), var(--g-a)) !important;
  color: #fff !important; text-shadow: 0 1px 0 rgba(0,0,0,.25) !important;
  border: 2px solid #fff !important; border-radius: 999px !important;
  box-shadow: 0 10px 22px rgba(255,74,26,.4), inset 0 -4px 0 rgba(0,0,0,.18) !important;
  font-weight: 800 !important; letter-spacing: .02em;
  transition: scale .15s var(--g-ressort) !important;
}
body[data-theme="template"][data-glossy="candy"] :is(#modalPurchase, .basket-cta, #confirmOrderBtn, #submitReviewBtn) {
  animation: g-appel 2.6s ease-in-out infinite;
}
@keyframes g-appel { 0%, 100% { box-shadow: 0 10px 22px rgba(255,74,26,.4), inset 0 -4px 0 rgba(0,0,0,.18); } 50% { box-shadow: 0 10px 30px rgba(224,32,224,.65), inset 0 -4px 0 rgba(0,0,0,.18); } }
body[data-theme="template"][data-glossy="candy"] :is(#modalPurchase, .basket-cta, #confirmOrderBtn, #submitReviewBtn, #promoApplyBtn, #copyRecapBtn, #closeModalBtn, .basket-clear, #closeModal, .delivery-choice, #qtyMinus, #qtyPlus, .qty-control button):active { scale: .94; }

/* Boutons secondaires : pastille blanche. */
body[data-theme="template"][data-glossy="candy"] :is(#copyRecapBtn, #closeModalBtn, .basket-clear, #closeModal, .delivery-choice) {
  background: linear-gradient(180deg, #fff, #f3e8ff) !important; color: var(--g-ink) !important;
  border: 2px solid #e6d3ff !important; border-radius: 999px !important;
  box-shadow: 0 4px 0 rgba(42,11,74,.12) !important; text-shadow: none !important;
}
body[data-theme="template"][data-glossy="candy"] #closeModal * { color: var(--g-ink) !important; }
body[data-theme="template"][data-glossy="candy"] #orderModal .delivery-choice.delivery-choice-active {
  background: linear-gradient(135deg, var(--g-b), #8a5cff) !important; color: #fff !important; border-color: #fff !important;
}

/* Quantité : boutons ronds en gelée cyan. */
body[data-theme="template"][data-glossy="candy"] :is(#qtyMinus, #qtyPlus, .qty-control button) {
  background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,0) 50%), linear-gradient(135deg, var(--g-b), #7b5cff) !important;
  color: #fff !important; border: 2px solid #fff !important; border-radius: 999px !important;
  box-shadow: 0 5px 12px rgba(32,216,240,.4) !important;
}
body[data-theme="template"][data-glossy="candy"] :is(#qtyMinus, #qtyPlus, .qty-control button) * { color: #fff !important; }

/* Prix : gros, magenta. */
body[data-theme="template"][data-glossy="candy"] :is(#productModalPanel, #basketSection) :is(#modalPrice, #modalPrice *, .basket-total, .basket-subtotal) {
  color: var(--g-a) !important; font-weight: 900 !important; text-shadow: 0 2px 0 rgba(224,32,224,.15) !important;
}

/* Panier : chaque ligne est une petite carte bonbon. */
body[data-theme="template"][data-glossy="candy"] .basket-line {
  background: #fff !important; border: 2px solid #f0e2ff !important; border-radius: 20px !important;
  box-shadow: 0 6px 14px rgba(42,11,74,.12) !important;
}
body[data-theme="template"][data-glossy="candy"] .basket-thumb { border-radius: 14px !important; background: #f6ebff !important; }
body[data-theme="template"][data-glossy="candy"] .removeBtn { color: var(--g-d) !important; }

/* Total du panier : bandeau gelée violet, texte blanc. */
body[data-theme="template"][data-glossy="candy"] #basketSection .basket-summary {
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 50%), linear-gradient(135deg, #7b2cf0, var(--g-a)) !important;
  border: 2px solid #fff !important; border-radius: 22px !important;
  box-shadow: 0 10px 22px rgba(123,44,240,.35), inset 0 -4px 0 rgba(0,0,0,.15) !important;
}
body[data-theme="template"][data-glossy="candy"] #basketSection > .glass .basket-summary :is(span, div, p, .basket-total) {
  color: #fff !important; text-shadow: 0 1px 0 rgba(0,0,0,.2) !important;
}
body[data-theme="template"][data-glossy="candy"] #basketSection .qty-control {
  background: #f3e8ff !important; border: 2px solid #e6d3ff !important; box-shadow: none !important;
}

/* Avis : étoiles dorées brillantes. */
body[data-theme="template"][data-glossy="candy"] :is(.star-btn, .star-display) { color: #e3d6f2 !important; }
body[data-theme="template"][data-glossy="candy"] :is(.star-btn, .star-display).is-filled {
  color: var(--g-c) !important; text-shadow: 0 2px 0 #e0a800, 0 0 10px rgba(255,210,26,.6) !important;
}

/* Contact : liens en pastilles blanches brillantes. */
body[data-theme="template"][data-glossy="candy"] .wc-reseau {
  background: var(--g-panneau) !important; border: 2px solid #fff !important; border-radius: 22px !important;
  box-shadow: 0 10px 22px rgba(42,11,74,.3) !important;
}
body[data-theme="template"][data-glossy="candy"] .wc-reseau :is(b, small, svg) { color: var(--g-ink) !important; }

/* Commande : fenêtre et fond. */
body[data-theme="template"][data-glossy="candy"] #orderModal { background: rgba(42,11,74,.55) !important; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
body[data-theme="template"][data-glossy="candy"] #productModal { background: rgba(42,11,74,.55) !important; }
body[data-theme="template"][data-glossy="candy"] #productModal.is-open #productModalPanel { animation: g-arrive .55s var(--g-ressort); }
body[data-theme="template"][data-glossy="candy"] #orderModal:not(.hidden) > .glass { animation: g-arrive .55s var(--g-ressort); }
@keyframes g-arrive { 0% { translate: 0 40px; scale: .9; opacity: 0; } 100% { translate: 0 0; scale: 1; opacity: 1; } }

/* Le bouton « Installer l'app » se retire quand une fiche ou la commande est ouverte (il couvrait « Fermer »). */
body[data-glossy]:has(#productModal.is-open) .install-btn,
body[data-glossy]:has(#orderModal:not(.hidden)) .install-btn { opacity: 0; pointer-events: none; }

/* Recherche et compteur. */
body[data-theme="template"][data-glossy="candy"] #searchClear { color: var(--g-ink) !important; }

/* Notifications : bonbon blanc. */
body[data-theme="template"][data-glossy="candy"] .sn-notifications-container .sn-notify {
  background: var(--g-panneau) !important; border: 2px solid #fff !important; border-radius: 20px !important;
  box-shadow: 0 12px 28px rgba(42,11,74,.4) !important;
}
body[data-theme="template"][data-glossy="candy"] .sn-notifications-container .sn-notify * { color: var(--g-ink) !important; }

/* Barre du bas : libellé actif blanc, bouton panier en gelée. */
body[data-theme="template"][data-glossy="candy"] #bottomNav button span { color: rgba(255,255,255,.7) !important; }
body[data-theme="template"][data-glossy="candy"] #bottomNav button.is-active span { color: #fff !important; text-shadow: 0 0 10px rgba(255,255,255,.6); }
body[data-theme="template"][data-glossy="candy"] #bottomNav #basketBtn::before {
  background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,0) 50%), linear-gradient(135deg, var(--g-d), var(--g-a)) !important;
  border: 3px solid #fff !important; box-shadow: 0 10px 24px rgba(224,32,224,.55) !important;
}
body[data-theme="template"][data-glossy="candy"] #basketBadge {
  background: var(--g-c) !important; color: var(--g-ink) !important; border: 2px solid #fff !important; font-weight: 900 !important;
}

/* ---------- Titres de section, étiquettes, barre du bas (les 3 styles) ---------- */
body[data-theme="template"][data-glossy] #categoryRail > p.text-xs.font-semibold.uppercase,
body[data-theme="template"][data-glossy] .stage-head > p.text-xs.font-semibold.uppercase,
body[data-theme="template"][data-glossy] .products-count {
  color: #fff !important; text-shadow: 0 2px 6px rgba(42,11,74,.7), 0 0 14px rgba(224,32,224,.45);
}
body[data-theme="template"][data-glossy] #productsGrid .pc-badge {
  max-width: calc(100% - 4.2rem); letter-spacing: .02em; font-size: .68rem;
}
body[data-theme="template"][data-glossy] #bottomNav {
  background: linear-gradient(180deg, rgba(42,11,74,.55), rgba(24,6,44,.97)) !important;
}
body[data-theme="template"][data-glossy] #bottomNav::before {
  background: linear-gradient(90deg, transparent, var(--g-a) 25%, var(--g-b) 50%, var(--g-c) 75%, transparent) !important;
  box-shadow: 0 0 10px rgba(224,32,224,.6) !important;
}
body[data-theme="template"][data-glossy="candy"] #bottomNav {
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,0) 30%), linear-gradient(135deg, rgba(90,16,168,.94), rgba(170,20,170,.94)) !important;
}

/* ---------- Mouvement réduit : tout s'arrête ---------- */
@media (prefers-reduced-motion: reduce) {
  body[data-glossy] *, body[data-glossy] *::before, body[data-glossy] *::after { animation: none !important; transition: none !important; }
  body.g-anime[data-glossy] #productsGrid > .product-card { opacity: 1; translate: none; scale: none; }
}
