/* ===== Neverland Theme – Monde imaginaire nocturne ===== */
:root {
  --bg-deep: #0a0a1a;
  --bg-card: rgba(18, 18, 40, 0.85);
  --bg-card-hover: rgba(28, 28, 55, 0.95);
  --gold: #e8c872;
  --gold-soft: #f0d78c;
  --lavender: #b8a9e8;
  --pink-glow: #e8a0c8;
  --text: #f0eaf8;
  --text-muted: #a89bc0;
  --border: rgba(232, 200, 114, 0.25);
  --success: #7dcea0;
  --radius: 18px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  font-family: 'Quicksand', system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ===== Fond étoilé animé ===== */
#stars-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #1a1040 0%, #0a0a1a 60%, #050510 100%);
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle var(--duration) ease-in-out infinite;
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50% { opacity: var(--opacity); transform: scale(1.1); }
}

/* Lueur douce en haut */
#glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 50%;
  background: radial-gradient(ellipse, rgba(184, 169, 232, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== App container ===== */
#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 40px;
}

/* ===== Header ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 18px 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px var(--gold));
}

.logo h1 {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--gold-soft), var(--lavender));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.points-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(232, 200, 114, 0.12);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  backdrop-filter: blur(8px);
}

.points-icon {
  font-size: 1rem;
}

.points-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 6px;
  padding: 0 14px 16px;
}

.tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 11px 8px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.tab.active {
  background: rgba(232, 200, 114, 0.15);
  border-color: var(--border);
  color: var(--gold-soft);
}

.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: var(--gold);
  color: #1a1040;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  margin-left: 4px;
  padding: 0 5px;
}

.cart-count:empty,
.cart-count[data-count="0"] {
  display: none;
}

/* ===== Sections ===== */
.section {
  display: none;
  padding: 0 14px;
  animation: fadeIn 0.35s ease;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Produits ===== */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 14px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.product-card:active {
  transform: scale(0.98);
}

.product-emoji {
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(232, 200, 114, 0.35));
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 200, 114, 0.08);
  border-radius: 14px;
}

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

.product-name {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold-soft);
  margin-bottom: 4px;
}

.product-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-price {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.btn-add {
  background: linear-gradient(135deg, rgba(232, 200, 114, 0.25), rgba(184, 169, 232, 0.2));
  border: 1px solid var(--border);
  color: var(--gold-soft);
  padding: 7px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add:active {
  transform: scale(0.95);
  background: rgba(232, 200, 114, 0.35);
}

/* ===== Panier ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

.empty-sub {
  font-size: 0.9rem;
  margin-top: 4px;
  opacity: 0.7;
}

.cart-item {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-item-emoji {
  font-size: 1.5rem;
}

.cart-item-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.cart-item-price {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(232, 200, 114, 0.1);
  color: var(--gold-soft);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.qty-value {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

/* ===== Fidélité & Livraison ===== */
.loyalty-box,
.delivery-box {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}

.loyalty-title,
.delivery-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--gold-soft);
  margin-bottom: 8px;
}

.loyalty-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 4px 0 12px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-label input {
  margin-top: 3px;
  accent-color: var(--gold);
}

.delivery-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.radio-card {
  cursor: pointer;
}

.radio-card input {
  display: none;
}

.radio-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.radio-card input:checked + .radio-content {
  background: rgba(232, 200, 114, 0.12);
  border-color: var(--border);
  color: var(--gold-soft);
}

.radio-icon {
  font-size: 1.4rem;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--gold);
}

.form-group textarea {
  resize: none;
}

/* ===== Total & Bouton ===== */
.total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 4px;
  font-size: 1.05rem;
}

.total-box strong {
  font-size: 1.35rem;
  color: var(--gold-soft);
  font-family: 'Cinzel', serif;
}

.btn-primary {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #c9a84c, #e8c872, #b8a9e8);
  background-size: 200% 200%;
  color: #1a1040;
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 24px rgba(232, 200, 114, 0.35);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary:not(:disabled):active {
  transform: scale(0.98);
}

.cash-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(18, 18, 40, 0.95);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 0.95rem;
  z-index: 100;
  opacity: 0;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  max-width: 90%;
  text-align: center;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-color: rgba(125, 206, 160, 0.4);
}

.hidden {
  display: none !important;
}

/* Scrollbar discrète */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(232, 200, 114, 0.3);
  border-radius: 4px;
}
