/* MACIF BLAQ — mobile-first storefront styles */
:root {
  --bg: #060606;
  --surface: #101010;
  --card: #141414;
  --card-2: #1a1a1a;
  --line: #262626;
  --line-2: #333;
  --text: #f7f7f7;
  --muted: #9c9c9c;
  --faint: #6e6e6e;
  --accent: #ffffff;
  --danger: #ff5a5a;
  --success: #3ddc84;
  --warn: #ffb020;
  --radius: 14px;
  --radius-s: 10px;
  --frame: 480px;
  --bottombar: 62px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .55);
}

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

html { scroll-behavior: smooth; }

body {
  background: #000;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }

.display { font-family: 'Archivo Black', 'Inter', system-ui, sans-serif; letter-spacing: .02em; text-transform: uppercase; }

/* ---------- app frame ---------- */
.app {
  max-width: var(--frame);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--bottombar) + env(safe-area-inset-bottom, 0px) + 16px);
}

@media (min-width: 560px) {
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); box-shadow: 0 0 60px rgba(0,0,0,.8); }
}

/* ---------- promo strip ---------- */
.promo {
  background: var(--text);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
  padding: 7px 12px;
}

/* ---------- header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 6, 6, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { height: 38px; width: auto; border-radius: 8px; }
.brand-name { font-size: 15px; line-height: 1.1; }
.brand-name small { display: block; font-family: 'Inter'; font-size: 9px; font-weight: 600; letter-spacing: .3em; color: var(--muted); text-transform: uppercase; }

/* ---------- search ---------- */
.search-wrap { padding: 10px 16px 4px; }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
}
.search:focus-within { border-color: var(--line-2); }
.search input { flex: 1; background: none; border: 0; outline: none; font-size: 15px; min-width: 0; }
.search input::placeholder { color: var(--faint); }
.search svg { flex: none; opacity: .6; }
.search .clear { display: none; padding: 2px 6px; color: var(--muted); font-size: 18px; line-height: 1; }
.search.has-value .clear { display: block; }

/* ---------- category chips ---------- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px 6px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}
.chip.active { background: var(--text); color: #000; border-color: var(--text); }

/* ---------- hero ---------- */
.hero { position: relative; margin: 10px 0 4px; overflow: hidden; }
.hero img { width: 100%; height: 340px; object-fit: cover; object-position: center 30%; filter: grayscale(18%) contrast(1.05); }
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,6,6,.15) 0%, rgba(6,6,6,.35) 55%, rgba(6,6,6,.92) 100%);
}
.hero-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 16px 18px; z-index: 2; }
.hero-copy h1 { font-size: clamp(24px, 7vw, 34px); line-height: 1.08; margin-bottom: 6px; }
.hero-copy p { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

/* ---------- sections ---------- */
.section { padding: 18px 16px 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { font-size: 18px; }
.section-head a { font-size: 12px; color: var(--muted); }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-img { position: relative; aspect-ratio: 1 / 1; background: var(--card-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.off {
  position: absolute; top: 8px; left: 8px;
  background: var(--text); color: #000;
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  padding: 4px 8px; border-radius: 999px;
}
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-size: 13px; font-weight: 600; line-height: 1.35; min-height: 2.6em; }
.card-price { display: flex; align-items: baseline; gap: 8px; }
.price { font-weight: 800; font-size: 15px; }
.price-old { color: var(--faint); text-decoration: line-through; font-size: 12px; }
.card .btn { margin-top: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  transition: transform .06s ease, opacity .15s ease;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--text); color: #000; }
.btn-primary:disabled { opacity: .45; }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); background: transparent; }
.btn-danger { border: 1px solid rgba(255, 90, 90, .4); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- bottom bar ---------- */
.bottombar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--frame);
  z-index: 50;
  background: rgba(10, 10, 10, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}
.bottombar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  min-height: 44px;
  justify-content: center;
}
.bottombar a.active { color: var(--text); }
.bottombar svg { width: 22px; height: 22px; }

/* ---------- bottom sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  z-index: 95;
  bottom: 0; left: 50%;
  transform: translate(-50%, 105%);
  width: 100%;
  max-width: var(--frame);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  transition: transform .28s cubic-bezier(.32, .72, 0, 1);
  overscroll-behavior: contain;
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-grab { width: 40px; height: 4px; background: var(--line-2); border-radius: 4px; margin: 10px auto 4px; }
.sheet-close { position: absolute; top: 10px; right: 12px; z-index: 5; width: 34px; height: 34px; border-radius: 999px; background: rgba(0,0,0,.5); color: var(--text); font-size: 18px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.sheet-body { padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }

.p-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-s); background: var(--card-2); }
.p-name { font-size: 18px; margin-top: 14px; }
.p-desc { color: var(--muted); font-size: 14px; margin-top: 6px; }
.p-price { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.p-price .price { font-size: 20px; }

.opt-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  min-width: 44px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.opt.active { border-color: var(--text); background: var(--text); color: #000; }

.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.stepper button { width: 40px; height: 40px; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.stepper span { min-width: 28px; text-align: center; font-weight: 700; }

.totals { margin-top: 16px; border-top: 1px dashed var(--line-2); padding-top: 12px; font-size: 14px; display: grid; gap: 6px; }
.totals .row { display: flex; justify-content: space-between; }
.totals .row b { font-size: 16px; }
.muted-note { color: var(--faint); font-size: 12px; margin-top: 6px; }

/* ---------- forms ---------- */
.field { margin-top: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.input, textarea.input, select.input {
  width: 100%;
  min-height: 48px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  outline: none;
  font-size: 15px;
}
.input:focus { border-color: var(--line-2); }
textarea.input { min-height: 90px; resize: vertical; }
.input::placeholder { color: var(--faint); }
.field .hint { color: var(--faint); font-size: 12px; margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* ---------- orders page ---------- */
.lookup { display: flex; gap: 10px; padding: 14px 16px 4px; }
.lookup .input { flex: 1; }
.order-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0 16px 12px;
}
.order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-code { font-weight: 800; font-size: 14px; letter-spacing: .04em; }
.order-date { color: var(--faint); font-size: 12px; margin-top: 4px; }
.order-items { border-top: 1px dashed var(--line-2); margin-top: 10px; padding-top: 10px; display: grid; gap: 6px; font-size: 14px; }
.order-items .line { display: flex; justify-content: space-between; gap: 10px; }
.order-items .line span:first-child { color: var(--muted); }
.order-total { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 800; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  color: var(--muted);
}
.badge.pending { color: var(--warn); border-color: rgba(255, 176, 32, .35); background: rgba(255, 176, 32, .08); }
.badge.confirmed, .badge.paid { color: #6db3ff; border-color: rgba(109, 179, 255, .35); background: rgba(109, 179, 255, .08); }
.badge.shipped, .badge.delivered { color: var(--success); border-color: rgba(61, 220, 132, .35); background: rgba(61, 220, 132, .08); }
.badge.cancelled { color: var(--danger); border-color: rgba(255, 90, 90, .35); background: rgba(255, 90, 90, .08); }

/* ---------- empty / loading states ---------- */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .display { color: var(--text); font-size: 18px; margin-bottom: 8px; }
.empty p { font-size: 14px; }
.spin { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--text); border-radius: 50%; margin: 40px auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { border-radius: var(--radius); background: linear-gradient(100deg, var(--card) 40%, var(--card-2) 50%, var(--card) 60%); background-size: 200% 100%; animation: shimmer 1.2s infinite; aspect-ratio: 1/1; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- settings ---------- */
.settings-list { padding: 6px 16px; }
.settings-group { margin-bottom: 18px; }
.settings-title { font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); padding: 8px 4px 8px; }
.settings-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 14px;
  margin-bottom: 8px;
  min-height: 52px;
}
.settings-item a, .settings-item button { font-weight: 600; font-size: 14px; text-align: left; }
.settings-item .chev { color: var(--faint); }
.settings-item .sub { color: var(--faint); font-size: 12px; margin-top: 2px; font-weight: 400; }
.about-brand { text-align: center; padding: 20px 24px 8px; color: var(--muted); font-size: 13px; }
.about-brand img { height: 52px; margin: 0 auto 12px; border-radius: 10px; }

/* ---------- cookie banner ---------- */
.cookie {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  bottom: calc(var(--bottombar) + env(safe-area-inset-bottom, 0px) + 10px);
  width: calc(100% - 24px);
  max-width: calc(var(--frame) - 24px);
  z-index: 80;
  background: #161616;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  transition: transform .3s cubic-bezier(.32, .72, 0, 1);
}
.cookie.open { transform: translateX(-50%) translateY(0); }
.cookie h3 { font-size: 14px; margin-bottom: 6px; }
.cookie p { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.cookie a { text-decoration: underline; color: var(--text); }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions .btn { flex: 1; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  top: 14px;
  z-index: 200;
  background: #1c1c1c;
  border: 1px solid var(--line-2);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform .25s ease;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(255, 90, 90, .5); color: #ffb3b3; }

/* ---------- legal pages ---------- */
.legal-page { padding: 16px; }
.legal-page h1 { font-size: 22px; margin: 14px 0 6px; }
.legal-page .updated { color: var(--faint); font-size: 12px; margin-bottom: 18px; }
.legal-page h2 { font-size: 15px; margin: 22px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.legal-page p, .legal-page li { color: #cfcfcf; font-size: 14px; margin-bottom: 10px; }
.legal-page ul { padding-left: 18px; margin-bottom: 10px; }
.legal-page a { color: var(--text); text-decoration: underline; }
.back-row { display: flex; align-items: center; gap: 8px; padding: 12px 16px 0; }
.back-row a { color: var(--muted); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 26px; border-top: 1px solid var(--line); padding: 18px 16px 8px; text-align: center; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 12px; }
.foot-links a { color: var(--muted); font-size: 12.5px; font-weight: 600; min-height: 32px; }
.foot-copy { color: var(--faint); font-size: 11.5px; }

/* ---------- admin ---------- */
.admin-wrap { padding: 0 16px 24px; }
.login-box { max-width: 360px; margin: 60px auto; padding: 24px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.login-box h1 { font-size: 18px; margin-bottom: 4px; }
.login-box p { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.tabs { display: flex; gap: 8px; padding: 12px 16px 0; }
.tab { flex: 1; min-height: 44px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.tab.active { background: var(--text); color: #000; border-color: var(--text); }
.adm-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 10px 12px; margin-bottom: 8px;
}
.adm-row img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: var(--card-2); flex: none; }
.adm-row .info { flex: 1; min-width: 0; }
.adm-row .info b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-row .info span { color: var(--muted); font-size: 12px; }
.adm-row .actions { display: flex; gap: 6px; flex: none; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.icon-btn.del { color: var(--danger); border-color: rgba(255,90,90,.3); }
.toggle { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line); transition: background .15s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #888; transition: transform .15s ease, background .15s; }
.toggle.on { background: rgba(61, 220, 132, .3); }
.toggle.on::after { transform: translateX(18px); background: var(--success); }
.preview { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius-s); border: 1px dashed var(--line-2); background: var(--card); margin-top: 8px; }
.upload-drop { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px dashed var(--line-2); border-radius: var(--radius-s); padding: 16px; color: var(--muted); font-size: 14px; min-height: 52px; }

/* success panel in sheet */
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: rgba(61, 220, 132, .12); border: 1px solid rgba(61, 220, 132, .4); display: flex; align-items: center; justify-content: center; margin: 8px auto 14px; }
.success-icon svg { width: 30px; height: 30px; color: var(--success); }

@media (min-width: 560px) {
  .hero img { height: 400px; }
}
