/* SBH Boutique — design e-commerce premium */

:root {
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-2: #f5f2eb;
  --border: #e8e4dd;
  --border-strong: #d9d3ca;
  --text: #2a2725;
  --text-2: #6b6663;
  --text-3: #a09b97;
  --rose: #c8847d;
  --rose-dark: #a96762;
  --rose-light: #f5e6e3;
  --gold: #b8956f;
  --green: #6b8e6b;
  --green-light: #e7efe7;
  --red: #c47171;
  --red-light: #f3e0e0;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.08);
  --container: 1200px;
  --safe-bottom: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; display: flex; flex-direction: column; }

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

h1, h2, h3, .serif { font-family: 'Playfair Display', Georgia, serif; font-weight: 500; letter-spacing: -.01em; }

/* ── Header ───────────────────────────────────────────── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,.85);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: .9rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.brand-logo { height: 44px; width: auto; max-width: 140px; object-fit: contain; flex-shrink: 0; }
.brand-tagline {
  font-family: 'Inter', sans-serif;
  font-size: .68rem;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: .22em;
  text-transform: uppercase;
  border-left: 1px solid var(--border-strong);
  padding-left: .75rem;
  line-height: 1;
}

.header-actions { display: flex; align-items: center; gap: .6rem; }

.lang-switch {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 2px;
  font-size: .72rem;
  font-weight: 500;
}
.lang-switch button {
  padding: .25rem .55rem;
  border-radius: 999px;
  color: var(--text-3);
  transition: all .2s;
}
.lang-switch button.active {
  background: var(--text);
  color: var(--bg);
}

.cart-link {
  display: flex; align-items: center; gap: .4rem;
  padding: .5rem .85rem;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: .85rem; color: var(--text);
  transition: background .2s;
}
.cart-link:hover { background: var(--rose-light); }
.cart-count {
  background: var(--rose);
  color: #fff;
  border-radius: 999px;
  padding: .1rem .45rem;
  font-size: .72rem;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}
.cart-count[data-empty="true"] { display: none; }

/* ── Container ────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  width: 100%;
  flex: 1;
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  padding: 2rem 0 2.5rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 .5rem;
  line-height: 1.1;
}
.hero p {
  color: var(--text-2);
  font-size: 1rem;
  margin: 0 auto;
  max-width: 540px;
}

/* ── Filters ──────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0 1.5rem;
}
.filters-centered { justify-content: center; }
.filter-chip {
  white-space: nowrap;
  padding: .4rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: .85rem;
  color: var(--text-2);
  background: var(--surface);
  transition: all .2s;
}
.filter-chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.filter-chip:not(.active):hover {
  border-color: var(--text-2);
  color: var(--text);
}

.search-row {
  display: flex; gap: .6rem; align-items: center;
  margin-bottom: 1.5rem;
}
.search-input {
  flex: 1;
  padding: .7rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .95rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.search-input:focus { border-color: var(--rose); }
.search-input::placeholder { color: var(--text-3); }

/* ── Product grid ─────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
}
@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
  display: block;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.card-img-wrap {
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}
.card-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.card:hover .card-img-wrap img { transform: scale(1.04); }
.card-img-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 3rem;
}

.card-body { padding: 1rem 1rem 1.25rem; }
.card-cat {
  font-size: .68rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: .35rem;
}
.card-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--text);
  margin: 0 0 .4rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price {
  font-size: 1rem;
  color: var(--rose-dark);
  font-weight: 600;
}
.card-sizes-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-top: .35rem;
  font-size: .68rem;
  color: var(--text-2);
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: .02em;
}

/* ── Product detail ──────────────────────────────────── */
.back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .88rem;
  color: var(--text-2);
  margin-bottom: 1.5rem;
}
.back-link:hover { color: var(--text); }

.product {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 880px) {
  .product { grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: start; }
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.gallery-main {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.gallery-main img {
  width: 100%; height: 100%; object-fit: cover;
}
.gallery-thumbs {
  display: flex; gap: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumb {
  width: 80px; height: 80px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  opacity: .6;
  transition: opacity .2s;
  background: var(--surface-2);
}
.gallery-thumb.active { opacity: 1; box-shadow: 0 0 0 2px var(--rose); }
.gallery-thumb:hover { opacity: .9; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-info { padding: .5rem 0; }
.product-cat {
  font-size: .72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: .75rem;
}
.product-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 500;
  margin: 0 0 1rem;
  line-height: 1.15;
}
.product-price {
  font-size: 1.75rem;
  color: var(--rose-dark);
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.product-dims {
  display: flex; gap: .5rem;
  font-size: .85rem;
  color: var(--text-2);
  padding: .6rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

/* ── Variant selector (page produit) ──────────────────── */
.variant-selector { margin: 0 0 1.5rem; }
.variant-selector-label {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: .55rem;
}
.variant-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.variant-pill {
  padding: .55rem 1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.variant-pill:hover { border-color: var(--text-2); }
.variant-pill.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ── Catalog "from" label ─────────────────────────────── */
.from-label {
  font-size: .72rem;
  color: var(--text-3);
  font-weight: 400;
  text-transform: lowercase;
  margin-right: .2rem;
}

/* ── Color dots (catalog card + product page) ─────────── */
.card-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: .6rem;
}
.color-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.1);
  box-shadow: 0 0 0 1px rgba(255,255,255,.6) inset;
  flex-shrink: 0;
  cursor: help;
  transition: transform .15s;
}
.color-dot:hover { transform: scale(1.2); }
.color-more {
  font-size: .68rem;
  color: var(--text-3);
  margin-left: 2px;
  font-weight: 500;
}

.product-colors { margin: 0 0 1.5rem; }
.product-colors-label {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: .55rem;
}
.product-colors-dots {
  display: flex; flex-wrap: wrap;
  gap: .55rem;
}
.color-dot-lg {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.08);
  box-shadow: 0 0 0 2px rgba(255,255,255,.6) inset, var(--shadow-sm);
  cursor: help;
  transition: transform .15s;
}
.color-dot-lg:hover { transform: scale(1.12); }

/* ── Cart item variant badge ──────────────────────────── */
.cart-item-variant {
  display: inline-block;
  margin-left: .4rem;
  padding: .12rem .5rem;
  background: var(--rose-light);
  color: var(--rose-dark);
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  letter-spacing: .03em;
  vertical-align: middle;
}

/* ── Order item variant badge (admin) ─────────────────── */
.order-item-variant {
  display: inline-block;
  margin-left: .35rem;
  padding: .1rem .45rem;
  background: var(--rose-light);
  color: var(--rose-dark);
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.product-desc {
  font-size: .92rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 1.75rem;
  white-space: pre-line;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .9rem 1.5rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 500;
  text-align: center;
  transition: all .2s;
  font-family: inherit;
  width: 100%;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
}
.btn-primary:hover { background: var(--rose-dark); border-color: var(--rose-dark); }
.btn-primary:disabled { background: var(--text-3); border-color: var(--text-3); cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--text); background: var(--surface-2); }
.btn-whatsapp {
  background: #25D366;
  color: #fff;
  border: 1px solid #25D366;
}
.btn-whatsapp:hover { background: #1ebd5a; border-color: #1ebd5a; }
.btn-email {
  background: var(--rose);
  color: #fff;
  border: 1px solid var(--rose);
}
.btn-email:hover { background: var(--rose-dark); border-color: var(--rose-dark); }
.btn-danger {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid var(--red-light);
}
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: .55rem 1rem; font-size: .85rem; }
.btn-row { display: flex; gap: .6rem; }
.btn-row .btn { width: auto; flex: 1; }

.actions { display: flex; flex-direction: column; gap: .65rem; }

/* ── Cart ─────────────────────────────────────────────── */
.cart-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.cart-header h1 {
  font-size: 2rem;
  margin: 0 0 .35rem;
}
.cart-header p { color: var(--text-2); margin: 0; font-size: .9rem; }

.cart-items { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  background: var(--surface);
  padding: 1rem;
  border-radius: var(--radius);
  align-items: center;
}
.cart-item-img {
  width: 80px; height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { min-width: 0; }
.cart-item-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  margin: 0 0 .25rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item-cat { font-size: .72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .25rem; }
.cart-item-price { color: var(--rose-dark); font-weight: 600; font-size: .95rem; }
.cart-item-remove {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-size: 1rem;
  transition: all .2s;
}
.cart-item-remove:hover { background: var(--surface-2); color: var(--red); }

.cart-total {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.cart-total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: .5rem;
  font-size: .9rem;
  color: var(--text-2);
}
.cart-total-row.grand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  padding-top: .85rem;
  border-top: 1px solid var(--border);
  margin-top: .5rem;
}
.cart-total-row.grand strong { color: var(--rose-dark); font-family: 'Playfair Display', serif; font-weight: 500; font-size: 1.5rem; }

.checkout-form {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.checkout-form .field { margin-bottom: 1rem; }
.checkout-form .field label {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.checkout-form .field input,
.checkout-form .field textarea {
  width: 100%;
  padding: .75rem .9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
}
.checkout-form .field input:focus,
.checkout-form .field textarea:focus { border-color: var(--rose); background: var(--surface); }
.checkout-form .field textarea { resize: vertical; min-height: 80px; }
.checkout-summary { margin-bottom: 1.25rem; }

.cart-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-2);
}
.cart-empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.cart-empty h2 { font-size: 1.4rem; margin: 0 0 .5rem; }
.cart-empty p { margin: 0 0 1.5rem; font-size: .9rem; }

/* ── States ───────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-3);
  font-size: .9rem;
}
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-2);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .35; }
.empty-state h2 { font-size: 1.4rem; margin: 0 0 .5rem; }
.empty-state p { color: var(--text-3); margin: 0; }

.badge-soldout {
  position: absolute;
  top: .75rem; right: .75rem;
  background: rgba(42, 39, 37, .85);
  color: #fff;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  backdrop-filter: blur(4px);
}

/* ── Footer ───────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2rem 1.25rem;
  margin-top: 3rem;
  text-align: center;
  font-size: .8rem;
  color: var(--text-3);
}
.footer p { margin: .25rem 0; }
.footer a { color: var(--text-2); }
.footer a:hover { color: var(--rose-dark); text-decoration: underline; }

/* ── Toast ────────────────────────────────────────────── */
#toast {
  position: fixed;
  left: 50%; bottom: calc(var(--safe-bottom) + 24px);
  transform: translateX(-50%) translateY(120%);
  background: var(--text);
  color: var(--bg);
  padding: .85rem 1.25rem;
  border-radius: 999px;
  font-size: .85rem;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── ADMIN ────────────────────────────────────────────── */
.admin-wrap { max-width: 880px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.admin-tabs {
  display: flex;
  gap: .5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 0;
}
.admin-tab {
  padding: .85rem 1.25rem;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-3);
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: color .2s, border-color .2s;
}
.admin-tab:hover { color: var(--text-2); }
.admin-tab.active {
  color: var(--text);
  border-bottom-color: var(--rose);
}
.tab-count {
  background: var(--rose);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  border-radius: 999px;
  padding: .1rem .45rem;
  min-width: 18px;
  text-align: center;
}
.tab-count:empty, .tab-count[style*="none"] { display: none; }

/* Orders grid */
.orders-grid { display: flex; flex-direction: column; gap: 1rem; }
.order-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.order-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  margin-bottom: .75rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.order-customer {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.2;
}
.order-date { font-size: .78rem; color: var(--text-3); margin-top: .15rem; }
.order-total {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  color: var(--rose-dark);
  font-weight: 500;
  white-space: nowrap;
}
.order-contact {
  font-size: .85rem;
  color: var(--text-2);
  margin-bottom: .65rem;
  line-height: 1.7;
}
.order-contact a { color: var(--rose-dark); }
.order-contact a:hover { text-decoration: underline; }
.order-notes {
  font-size: .82rem;
  color: var(--text-2);
  background: var(--surface-2);
  padding: .55rem .8rem;
  border-radius: var(--radius);
  margin-bottom: .85rem;
  line-height: 1.5;
}
.order-items { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.order-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: .65rem;
  align-items: center;
  background: var(--surface-2);
  padding: .5rem .75rem;
  border-radius: var(--radius);
}
.order-item img, .order-item-noimg {
  width: 48px; height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-size: 1.3rem;
}
.order-item-name { font-size: .9rem; font-weight: 500; line-height: 1.2; }
.order-item-meta { font-size: .75rem; color: var(--text-3); margin-top: .15rem; }
.order-actions {
  display: flex; gap: .5rem; align-items: center;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
}
.order-status-select {
  flex: 1;
  padding: .55rem .85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: inherit;
  font-size: .85rem;
  cursor: pointer;
}
.btn-mini-danger {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: var(--red-light);
  color: var(--red);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.btn-mini-danger:hover { background: var(--red); color: #fff; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.admin-header h1 { font-size: 1.5rem; margin: 0; }
.admin-list { display: flex; flex-direction: column; gap: .75rem; }
.admin-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 1rem;
  background: var(--surface);
  padding: .75rem;
  border-radius: var(--radius);
  align-items: center;
}
.admin-row-thumb {
  width: 60px; height: 60px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.admin-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-row-info h3 { font-family: 'Playfair Display', serif; font-size: 1rem; margin: 0 0 .15rem; font-weight: 500; }
.admin-row-info .meta { font-size: .78rem; color: var(--text-3); }
.admin-row-info .meta .pub { color: var(--green); margin-left: .5rem; font-weight: 500; }
.admin-row-info .meta .unpub { color: var(--text-3); margin-left: .5rem; }
.admin-row-actions { display: flex; gap: .35rem; }
.admin-row-actions button {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: background .2s;
}
.admin-row-actions button:hover { background: var(--surface-2); }
.admin-row-actions .danger:hover { background: var(--red-light); color: var(--red); }

/* Admin form modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 18, 16, .55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  /* Block all touch gestures on overlay (pinch zoom, pan-through) */
  touch-action: none;
  overscroll-behavior: contain;
  /* Prevent text selection drag from feeling like dragging the modal */
  user-select: none;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: calc(100% - 2rem);
  max-width: 640px;
  max-height: calc(100vh - 2rem);
  margin: 1rem;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;          /* prevents internal leak; rounded corners stay clean */
  /* Restore selection inside the modal */
  user-select: auto;
  -webkit-user-select: auto;
}

.modal-header {
  flex: 0 0 auto;
  padding: 1.2rem 1.5rem .85rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.modal-header h2 {
  font-size: 1.3rem;
  margin: 0;
  line-height: 1.2;
}

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 1.5rem;
  -webkit-overflow-scrolling: touch;
  /* Allow vertical scrolling only — no pinch-zoom */
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.modal-footer {
  flex: 0 0 auto;
  display: flex; gap: .6rem;
  justify-content: flex-end;
  padding: .9rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  /* Subtle shadow when content scrolls behind */
  box-shadow: 0 -2px 6px rgba(0,0,0,.03);
}
.modal-footer .btn { width: auto; min-width: 100px; }

/* Body scroll lock when modal open */
body.modal-open {
  overflow: hidden;
  /* Prevent iOS rubber-band scroll-through */
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Mobile: full-screen modal */
@media (max-width: 540px) {
  .modal {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }
  .modal-header { padding: 1rem 1.1rem .8rem; }
  .modal-body { padding: 1.1rem 1.1rem; }
  .modal-footer { padding: .75rem 1.1rem; }
  .modal-footer .btn { min-width: 0; flex: 1; }
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--rose); }
.field textarea { resize: vertical; min-height: 80px; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .5rem;
  margin-top: .5rem;
}
.photo-slot {
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-size: 1.4rem;
}
.photo-slot.has-img { border-style: solid; cursor: default; }
.photo-slot.has-img:hover .photo-remove { opacity: 1; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(42, 39, 37, .85);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  opacity: 0;
  transition: opacity .2s;
}
.photo-slot.uploading::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,.7) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23c8847d" stroke-width="2"><circle cx="12" cy="12" r="10" opacity=".2"/><path d="M22 12a10 10 0 01-10 10" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/></path></svg>') center no-repeat;
}

/* ── Colors editor (admin form) ───────────────────────── */
.colors-preview {
  display: flex; flex-wrap: wrap; gap: .4rem;
  align-items: center;
  min-height: 28px;
  padding: .5rem .65rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: .55rem;
}
.colors-preview-empty { font-size: .78rem; color: var(--text-3); font-style: italic; }
.color-dot-md {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.08);
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.55) inset;
}
.color-row {
  display: grid;
  grid-template-columns: 44px 110px 1fr 36px 36px;
  gap: .45rem;
  align-items: center;
  margin-bottom: .5rem;
}
.color-row .color-picker {
  width: 44px; height: 36px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
}
.color-row .color-hex,
.color-row .color-name {
  padding: .55rem .75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  outline: none;
}
.color-row .color-hex { text-transform: uppercase; font-family: 'SF Mono', Menlo, monospace; font-size: .82rem; }
.color-row .color-hex:focus,
.color-row .color-name:focus { border-color: var(--rose); }
.color-pick-btn, .color-remove {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  transition: all .15s;
}
.color-pick-btn:hover { background: var(--rose-light); color: var(--rose-dark); }
.color-remove:hover { background: var(--red-light); color: var(--red); }
@media (max-width: 540px) {
  .color-row { grid-template-columns: 36px 1fr 36px 36px; }
  .color-row .color-name { grid-column: 1 / -1; }
}

/* ── EyeDropper / Color picker overlay (fallback Safari) */
.eyedropper-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 18, 16, .94);
  z-index: 1000;
  display: flex; flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
}
.eyedropper-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
  color: #fff;
  padding: 0 .5rem;
}
.eyedropper-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
}
.eyedropper-cancel {
  padding: .5rem 1.25rem;
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 999px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.2);
  transition: background .2s;
}
.eyedropper-cancel:hover { background: rgba(255,255,255,.2); }
.eyedropper-gallery {
  display: flex; flex-direction: column; gap: 1rem;
  max-width: 900px; margin: 0 auto; width: 100%;
}
.eyedropper-canvas {
  width: 100%; height: auto;
  border-radius: var(--radius);
  cursor: crosshair;
  background: var(--surface-2);
  display: block;
}
.eyedropper-error {
  background: var(--red-light);
  color: var(--red);
  padding: .85rem;
  border-radius: var(--radius);
  font-size: .85rem;
  text-align: center;
}

/* ── Variants editor (admin form) ─────────────────────── */
.variant-row {
  display: grid;
  grid-template-columns: 24px 1.2fr 90px 70px 90px 28px 28px 32px;
  gap: .4rem;
  align-items: center;
  margin-bottom: .45rem;
  padding: .35rem .35rem .35rem .15rem;
  border-radius: var(--radius);
  transition: background .2s, opacity .2s;
}
.variant-row.dragging { opacity: .35; background: var(--surface-2); }
.variant-row.drag-over { background: var(--rose-light); box-shadow: inset 0 2px 0 var(--rose); }
.variant-handle {
  width: 24px; height: 36px;
  color: var(--text-3);
  font-size: .85rem;
  letter-spacing: -2px;
  cursor: grab;
  display: flex; align-items: center; justify-content: center;
  user-select: none;
}
.variant-handle:active { cursor: grabbing; }
.variant-row input {
  padding: .55rem .65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  transition: border-color .2s;
  min-width: 0;
}
.variant-row input:focus { border-color: var(--rose); }
.variant-row .variant-sku { font-family: 'SF Mono', Menlo, monospace; font-size: .78rem; color: var(--text-2); }
.variant-up, .variant-down {
  width: 28px; height: 36px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  transition: all .15s;
}
.variant-up:hover, .variant-down:hover { background: var(--rose-light); color: var(--rose-dark); }
.variant-remove {
  width: 32px; height: 36px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  transition: all .2s;
}
.variant-remove:hover { background: var(--red-light); color: var(--red); }

.variants-summary-row {
  font-size: .8rem;
  color: var(--text-2);
  margin-top: .4rem;
  padding: .55rem .85rem;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.variants-summary { font-weight: 500; color: var(--text); }

@media (max-width: 640px) {
  .variant-row {
    grid-template-columns: 24px 1fr 80px 28px 28px 32px;
    grid-auto-flow: dense;
  }
  .variant-row .variant-stock,
  .variant-row .variant-sku {
    grid-column: 2 / -1;
  }
}

.toggle-row {
  display: flex; align-items: center; gap: .75rem;
  background: var(--surface-2);
  padding: .85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  cursor: pointer;
}
.toggle-row input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--rose);
  cursor: pointer;
  margin: 0;
}
.toggle-row span { font-size: .9rem; color: var(--text); font-weight: 500; }
.toggle-row .hint { font-size: .75rem; color: var(--text-3); font-weight: 400; display: block; margin-top: 2px; }

.modal-actions {
  display: flex; gap: .6rem; justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.modal-actions .btn { width: auto; min-width: 100px; }

/* Login screen */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 70vh;
  padding: 2rem 1rem;
}
.login-box {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-md);
}
.login-box h1 {
  font-size: 1.5rem;
  margin: 0 0 .35rem;
  text-align: center;
}
.login-box .subtitle {
  text-align: center;
  font-size: .85rem;
  color: var(--text-2);
  margin: 0 0 1.5rem;
}
.error-msg {
  background: var(--red-light);
  color: var(--red);
  padding: .65rem .85rem;
  border-radius: var(--radius);
  font-size: .82rem;
  margin-bottom: 1rem;
  display: none;
}
.error-msg.show { display: block; }

/* ── Mobile tweaks ────────────────────────────────────── */
@media (max-width: 540px) {
  .container { padding: 1rem 1rem 3rem; }
  .header-inner { padding: .75rem 1rem; }
  .header-actions { gap: .35rem; }
  .product-title { font-size: 1.6rem; }
  .product-price { font-size: 1.5rem; }
  .gallery-thumb { width: 64px; height: 64px; }
  .grid { gap: .85rem; }
  .card-body { padding: .75rem .75rem 1rem; }
  .card-name { font-size: .95rem; }
  .card-price { font-size: .92rem; }
  .cart-item { grid-template-columns: 64px 1fr auto; padding: .75rem; }
  .cart-item-img { width: 64px; height: 64px; }
  .form-row { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .cart-link span:nth-child(2) { display: none; }
  .brand-name { font-size: .95rem; }
}
