:root {
  --bg: #fff8fa;
  --surface: #ffffff;
  --surface-soft: #fdf0f4;
  --burgundy: #5a1024;
  --burgundy-dark: #3d0816;
  --rose: #d86c93;
  --rose-light: #f9dbe6;
  --gold: #c8963e;
  --gold-light: #f6e7c8;
  --text: #2a181d;
  --muted: #6f565d;
  --border: #eed7df;
  --success: #1b7f4b;
  --success-bg: #e7f6ee;
  --warning: #a15c07;
  --warning-bg: #fef3dc;
  --danger: #b42318;
  --danger-bg: #fee4e2;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(90, 16, 36, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 248, 250, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
}

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

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--burgundy) 0%, #8a1d3b 100%);
  color: var(--gold-light);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(90, 16, 36, 0.18);
}

.brand-text strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--burgundy);
  line-height: 1.1;
}

.brand-text span {
  font-size: 11px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--burgundy) 0%, #7d1935 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(90, 16, 36, 0.22);
}

.btn-whatsapp {
  background: #1f9d55;
  color: #fff;
  box-shadow: 0 6px 16px rgba(31, 157, 85, 0.2);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, #dfb25b 100%);
  color: #2b1808;
}

.btn-soft {
  background: var(--surface-soft);
  color: var(--burgundy);
  border: 1px solid var(--border);
}

.btn-sm {
  padding: 8px 13px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* Hero */
.hero {
  padding: 22px 0 28px;
}

.hero-card {
  background: linear-gradient(145deg, #fff 0%, #fdeef3 65%, #f9e1ea 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
  align-items: center;
}

@media (min-width: 780px) {
  .hero-card {
    grid-template-columns: 1.15fr 0.85fr;
    padding: 32px;
  }
}

.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-light);
  color: #6b4b12;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.15;
  color: var(--burgundy);
}

.hero p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-flyer {
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 12px 26px rgba(90, 16, 36, 0.16);
  max-width: 340px;
  margin: 0 auto;
}

/* Sections */
.section {
  padding: 20px 0 28px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-size: 22px;
  color: var(--burgundy);
}

.section-sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Filter chips */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 16px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.chip.active {
  background: var(--burgundy);
  color: #fff;
  border-color: var(--burgundy);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(90, 16, 36, 0.05);
  display: flex;
  flex-direction: column;
}

.product-media {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  color: #fff;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-placeholder {
  text-align: center;
  padding: 18px;
}

.product-placeholder span {
  display: block;
  font-size: 28px;
  margin-bottom: 6px;
}

.product-placeholder small {
  font-size: 12px;
  opacity: 0.9;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-status {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--burgundy);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.zoom-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.94);
  color: var(--burgundy);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
  transition: transform 0.15s ease;
}

.zoom-btn:active {
  transform: scale(0.94);
}

.product-media img {
  cursor: zoom-in;
}

.lightbox-modal {
  max-width: 560px;
  padding: 16px;
}

.lightbox-img-wrap {
  width: 100%;
  max-height: 62vh;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #1a080d;
  margin-bottom: 14px;
}

.lightbox-img-wrap img {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
}

/* Assistant virtuel (Chat Widget) */
.chat-fab {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--burgundy) 0%, #8a1d3b 100%);
  color: #fff;
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(90, 16, 36, 0.28);
}

.chat-box {
  position: fixed;
  right: 16px;
  bottom: 76px;
  width: calc(100vw - 32px);
  max-width: 370px;
  height: 460px;
  max-height: 74vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(34, 8, 15, 0.24);
  z-index: 95;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-box.open {
  display: flex;
}

.chat-head {
  background: linear-gradient(135deg, var(--burgundy) 0%, #7d1935 100%);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-head-info strong {
  display: block;
  font-size: 14px;
}

.chat-head-info span {
  font-size: 11px;
  opacity: 0.85;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}

.chat-msg {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
}

.chat-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--burgundy);
  color: #fff;
}

.chat-quick {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  background: #fff;
  border-top: 1px solid var(--border);
}

.chat-quick button {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--burgundy);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border-top: 1px solid var(--border);
}

.chat-form input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
}

.chat-form input:focus {
  outline: 2px solid var(--rose);
  border-color: transparent;
}

.chat-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.chat-prod-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
}

.chat-prod-thumb {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.chat-prod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.chat-prod-info strong {
  display: block;
  font-size: 13px;
  color: var(--burgundy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-prod-info span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.chat-prod-actions {
  display: flex;
  gap: 6px;
  margin-top: 5px;
}

.chat-prod-actions button {
  padding: 4px 9px;
  font-size: 11px;
}

/* Dashboard */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 720px) {
  .quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.dash-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 720px) {
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.todo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.todo-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.order-modal-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 14px;
}

.order-modal-preview img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.order-modal-preview strong {
  display: block;
  color: var(--burgundy);
  font-size: 14px;
}

.order-modal-preview span {
  font-size: 13px;
  color: var(--muted);
}

.product-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--rose);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.product-title {
  margin: 0;
  font-size: 16px;
  color: var(--burgundy);
}

.product-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.price {
  font-size: 17px;
  font-weight: 800;
  color: var(--burgundy);
}

.delay-text {
  font-size: 12px;
  color: var(--muted);
}

/* Info steps & guarantees */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--burgundy);
  color: var(--gold-light);
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}

.info-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--burgundy);
}

.info-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* Footer */
.footer {
  margin-top: 24px;
  background: var(--burgundy-dark);
  color: #f9e6ec;
  padding: 26px 0 36px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.footer-admin-link {
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(246, 231, 200, 0.35);
  color: var(--gold-light);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(34, 8, 15, 0.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 0;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
    padding: 16px;
  }
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--surface);
  width: 100%;
  max-width: 460px;
  border-radius: 22px 22px 0 0;
  padding: 20px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
}

@media (min-width: 640px) {
  .modal {
    border-radius: 22px;
  }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-head h3 {
  margin: 0;
  color: var(--burgundy);
  font-size: 18px;
}

.close-btn {
  border: none;
  background: var(--surface-soft);
  color: var(--burgundy);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

/* Form controls */
.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--burgundy);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--rose);
  border-color: transparent;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Admin App Mobile-First */
.admin-body {
  padding-bottom: 84px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0 18px;
}

@media (min-width: 720px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.stat-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  color: var(--burgundy);
}

.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 3px 10px rgba(90, 16, 36, 0.04);
}

.order-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.st-attente { background: var(--warning-bg); color: var(--warning); }
.st-commandee { background: #e8f1ff; color: #1956b4; }
.st-recue { background: #f3e8ff; color: #6d28d9; }
.st-livraison { background: #fff0e5; color: #c2410c; }
.st-soldee { background: var(--success-bg); color: var(--success); }

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  z-index: 60;
  padding: 6px 2px;
}

.bottom-nav .nav-tab {
  font-size: 10px;
}

.top-tabs {
  display: none;
  gap: 8px;
  padding: 10px 0 4px;
  flex-wrap: wrap;
}

.top-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.top-tab.active {
  background: var(--burgundy);
  color: #fff;
  border-color: var(--burgundy);
}

@media (min-width: 720px) {
  .bottom-nav {
    display: none;
  }
  .top-tabs {
    display: flex;
  }
  .admin-body {
    padding-bottom: 32px;
  }
}

.search-bar {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  margin-bottom: 12px;
}

.search-bar:focus {
  outline: 2px solid var(--rose);
  border-color: transparent;
}

/* Lock Screen */
.pin-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(145deg, var(--burgundy-dark) 0%, var(--burgundy) 100%);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pin-overlay.hidden {
  display: none;
}

.pin-box {
  background: #fff;
  border-radius: 24px;
  padding: 26px 22px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.pin-box img {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  border-radius: 50%;
}

.pin-box h2 {
  margin: 0 0 6px;
  color: var(--burgundy);
  font-size: 20px;
}

.pin-box p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.pin-input {
  width: 100%;
  text-align: center;
  font-size: 24px;
  letter-spacing: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 2px solid var(--border);
  margin-bottom: 12px;
}

.pin-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 8px;
}

.nav-tab {
  border: none;
  background: transparent;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.nav-tab.active {
  color: var(--burgundy);
}

.nav-tab span.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.nav-tab .icon {
  width: 20px;
  height: 20px;
}

.top-tab .icon {
  width: 15px;
  height: 15px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

.template-card pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 13px;
  background: var(--surface-soft);
  padding: 12px;
  border-radius: 12px;
  margin: 8px 0 10px;
  color: var(--text);
}

.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--burgundy-dark);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 200;
  display: none;
}

.toast.show {
  display: block;
}

