/* ============================================
   DRACO — Styles
   Palette: near-black #0d0d0d, panel #161616,
            white #ffffff, red accent #e02020,
            muted grey #8a8a8a
   ============================================ */

:root {
  --black: #0d0d0d;
  --panel: #161616;
  --panel-light: #1f1f1f;
  --white: #ffffff;
  --off-white: #f7f7f7;
  --red: #e21c1c;
  --red-dark: #b81616;
  --grey: #8a8a8a;
  --grey-light: #d4d4d4;
  --border: #2a2a2a;
  --radius: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--off-white);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; }
img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
.site-header {
  background: var(--black);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  color: var(--white);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-mark { color: var(--red); font-size: 1.1rem; }
.main-nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.nav-link {
  color: var(--grey-light);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s;
  padding: 6px 0;
}
.nav-link:hover { color: var(--white); }
.nav-link.active { color: var(--red); }
.cart-btn {
  background: transparent;
  color: var(--white);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  padding: 6px;
}
.cart-count {
  background: var(--red);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.menu-toggle {
  display: none;
  background: transparent;
  color: var(--white);
  font-size: 1.4rem;
  padding: 4px 8px;
  border-radius: 6px;
}
.menu-toggle:hover { background: var(--panel-light); }
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--black);
  border-top: 1px solid var(--border);
}
.mobile-nav.open { display: flex; }
.mobile-nav .nav-link {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}
.mobile-nav .nav-link:last-child { border-bottom: none; }

/* ===== HERO ===== */
.hero {
  background: var(--black);
  color: var(--white);
  padding: 64px 24px 72px;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero-title {
  font-size: 3.2rem;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -1px;
}
.hero-tagline {
  font-size: 1.15rem;
  color: var(--grey-light);
  margin: 0 0 8px;
  font-weight: 600;
}
.hero-desc {
  color: var(--grey);
  font-size: 1rem;
  margin: 0 0 28px;
  max-width: 46ch;
  line-height: 1.5;
}
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.12s ease, background 0.15s;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--white);
}
.btn-ghost:hover { border-color: var(--grey); }
.hero-visual {
  background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
  border-radius: var(--radius);
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  border: 1px solid var(--border);
}

/* ===== PRODUCTS SECTION ===== */
.products-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.section-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 0 0 4px;
}
.section-underline {
  width: 48px;
  height: 3px;
  background: var(--red);
  margin: 0 0 32px;
}
.products-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 11px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--white);
}
.search-input:focus {
  outline: none;
  border-color: var(--red);
}
.sort-select {
  padding: 11px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--white);
  min-width: 180px;
}
.sort-select:focus {
  outline: none;
  border-color: var(--red);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.product-card {
  background: var(--white);
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.product-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.product-image {
  aspect-ratio: 1;
  background: #f0f0f0;
  overflow: hidden;
  position: relative;
}
.discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--red);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 2;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.product-name {
  font-weight: 700;
  font-size: 0.98rem;
  margin: 0;
}
.product-category {
  color: var(--grey);
  font-size: 0.82rem;
  margin: 0 0 6px;
}
.product-price {
  color: var(--red);
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0 0 12px;
}
.old-price {
  color: var(--grey);
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: line-through;
  margin-right: 6px;
}
.add-to-cart-btn {
  background: var(--red);
  color: var(--white);
  padding: 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  margin-top: auto;
  transition: background 0.15s;
}
.add-to-cart-btn:hover { background: var(--red-dark); }
.add-to-cart-btn.added { background: #1f9d4f; }

/* ===== CART PAGE ===== */
.page-title-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 8px;
}
.page-title-bar h1 { font-size: 1.7rem; font-weight: 800; margin: 0; }

.cart-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
.cart-items {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid #e8e8e8;
  overflow: hidden;
}
.cart-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #eee;
}
.cart-row:last-child { border-bottom: none; }
.cart-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
  flex-shrink: 0;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-details { flex: 1; min-width: 0; }
.cart-details .name { font-weight: 700; font-size: 0.95rem; margin: 0 0 2px; }
.cart-details .unit-price { color: var(--grey); font-size: 0.85rem; margin: 0; }
.qty-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--off-white);
  border-radius: 6px;
  padding: 4px 8px;
}
.qty-control button {
  background: transparent;
  width: 22px;
  height: 22px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--black);
  border-radius: 4px;
}
.qty-control button:hover { background: #e5e5e5; }
.qty-control span { min-width: 16px; text-align: center; font-weight: 600; }
.cart-line-total {
  color: var(--red);
  font-weight: 800;
  min-width: 70px;
  text-align: right;
}
.remove-btn {
  background: transparent;
  color: var(--grey);
  font-size: 1.1rem;
  padding: 4px;
}
.remove-btn:hover { color: var(--red); }

.summary-card {
  background: var(--white);
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  padding: 22px;
}
.summary-card h3 { margin: 0 0 16px; font-size: 1.05rem; }
.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  color: var(--grey);
  margin-bottom: 10px;
}
.summary-line.total {
  color: var(--black);
  font-weight: 800;
  font-size: 1.15rem;
  border-top: 1px solid #eee;
  padding-top: 14px;
  margin-top: 4px;
}
.summary-line.total .val { color: var(--red); }
.summary-card .btn { width: 100%; text-align: center; margin-top: 16px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--black);
  font-weight: 600;
  font-size: 0.92rem;
  background: var(--white);
  border: 1px solid #e0e0e0;
  padding: 10px 18px;
  border-radius: 6px;
}
.back-link:hover { border-color: var(--grey); }

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--grey);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* ===== CHECKOUT PAGE ===== */
.checkout-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
.form-card {
  background: var(--white);
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  padding: 28px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
}
.field .req { color: var(--red); }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--off-white);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--red);
  background: var(--white);
}
.field textarea { resize: vertical; min-height: 70px; }
.field-error {
  color: var(--red);
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}
.field.invalid input,
.field.invalid select { border-color: var(--red); }
.form-error-banner {
  background: #fdecec;
  color: var(--red-dark);
  border: 1px solid #f5b5b5;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 18px;
}
.field.invalid .field-error { display: block; }

.order-summary-mini { background: var(--white); border: 1px solid #e8e8e8; border-radius: var(--radius); padding: 22px; }
.order-summary-mini h3 { margin: 0 0 14px; font-size: 1.05rem; }
.mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}
.mini-row .mini-name { font-weight: 600; }
.mini-row .mini-qty { color: var(--grey); font-weight: 400; }
.mini-row .mini-price { color: var(--red); font-weight: 700; }

.submit-note {
  text-align: center;
  color: var(--grey);
  font-size: 0.85rem;
  margin-top: 14px;
}

/* ===== CONFIRMATION PAGE ===== */
.confirm-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}
.confirm-check {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #e6f7ec;
  color: #1f9d4f;
  font-size: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.confirm-wrap h1 { font-size: 1.6rem; margin: 0 0 12px; }
.confirm-wrap p { color: var(--grey); line-height: 1.6; margin: 0 0 6px; }
.confirm-wrap .btn { margin-top: 24px; }
.confirm-box {
  margin-top: 32px;
  border: 1px solid #eee;
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
}

/* ===== PRODUCT DETAIL PAGE ===== */
.product-detail-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: var(--white);
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  overflow: hidden;
  padding: 32px;
}
.product-detail-image {
  position: relative;
  aspect-ratio: 1;
  background: #f0f0f0;
  border-radius: var(--radius);
  overflow: hidden;
}
.product-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.gallery-slider {
  display: flex; width: 100%; height: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.gallery-slider::-webkit-scrollbar { display: none; }
.gallery-slider img { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.gallery-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; padding: 6px 10px; border-radius: 20px;
  background: rgba(0,0,0,0.45); pointer-events: none;
}
.gallery-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.7); }
.gallery-dot.active { background: var(--red); }
.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; font-size: 1.4rem; line-height: 1;
  cursor: pointer; display: none; z-index: 2;
}
.gallery-arrow.prev { left: 8px; }
.gallery-arrow.next { right: 8px; }
@media (hover: hover) { .gallery-arrow { display: block; } }
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.gallery-thumb {
  width: 72px; height: 72px; object-fit: cover; cursor: pointer;
  border-radius: 8px; border: 2px solid #e8e8e8; background: #f0f0f0;
}
.gallery-thumb.active { border-color: var(--red); }
.product-detail-info { display: flex; flex-direction: column; }
.product-detail-name {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 4px 0 12px;
}
.product-detail-price {
  color: var(--red);
  font-weight: 800;
  font-size: 1.5rem;
  margin: 0 0 16px;
}
.product-detail-price .old-price { font-size: 1rem; }
.product-detail-desc {
  color: var(--grey);
  line-height: 1.6;
  margin: 0 0 20px;
}

/* ===== CONTACT PAGE ===== */
.contact-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.contact-wrap .contact-card {
  background: var(--white);
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 14px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.contact-wrap .contact-card .ic { font-size: 1.4rem; }
.contact-wrap a.contact-card {
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.contact-wrap a.contact-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--black);
  color: var(--grey-light);
  padding: 48px 24px 0;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}
.footer-logo { margin-bottom: 12px; }
.footer-col p { font-size: 0.88rem; color: var(--grey); line-height: 1.6; margin: 0 0 8px; }
.footer-col h4 { color: var(--white); font-size: 0.95rem; margin: 0 0 12px; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 18px 0;
  font-size: 0.8rem;
  color: var(--grey);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--black);
  color: var(--white);
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { height: 200px; order: -1; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .main-nav { gap: 16px; }
  .product-detail-layout { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero-title { font-size: 2.2rem; }
  .cart-row { flex-wrap: wrap; }
  .header-inner { padding: 14px 16px; }
  .main-nav { display: none; }
  .menu-toggle { display: block; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ===== ADMIN DASHBOARD ===== */
.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  padding: 24px;
}
.admin-login-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 360px;
}
.admin-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.admin-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-product-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  padding: 12px 16px;
}
.admin-product-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f0f0;
}
.admin-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.admin-product-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .admin-product-row { flex-wrap: wrap; }
  .admin-product-actions { width: 100%; }
  .admin-product-actions .btn { flex: 1; }
}

/* Choix de couleur */
.color-picker { margin-top: 8px; }
.color-label { margin: 0 0 8px; color: var(--grey); font-size: 0.95rem; }
.color-label strong { color: var(--black); }
.color-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.color-chip {
  padding: 8px 16px; border-radius: 20px; border: 2px solid #ddd;
  background: #fff; color: var(--black); font-size: 0.9rem; cursor: pointer;
}
.color-chip.selected { border-color: var(--red); background: #fdecec; color: var(--red-dark); font-weight: 600; }

.color-swatch {
  width: 38px; height: 38px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid #ccc; box-shadow: inset 0 0 0 3px #fff;
}
.color-swatch.selected { border-color: var(--red); box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px var(--red); }
.color-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid #bbb; margin-right: 6px; vertical-align: middle;
}

/* Cartes produits : dots + couleurs visibles dès la liste */
.product-image .gallery-dots { bottom: 8px; gap: 6px; padding: 4px 8px; }
.product-image .gallery-dot { width: 8px; height: 8px; }
.card-colors { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.card-color {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid #bbb; box-shadow: inset 0 0 0 2px #fff;
}