:root {
  --primary: oklch(0.42 0.16 256);
  --primary-ink: oklch(0.30 0.13 256);
  --bg: oklch(1.00 0.00 0);
  --surface: oklch(0.96 0.012 256);
  --ink: oklch(0.18 0.02 256);
  --muted: oklch(0.48 0.02 256);
  --accent: oklch(0.45 0.17 55);
  --whatsapp: #25D366;
  --radius: 14px;
  --shadow: 0 10px 30px oklch(0.18 0.02 256 / 0.10);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Switzer', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden; /* red de seguridad: nada debe poder generar scroll horizontal */
}

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(1 0 0 / 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid oklch(0.18 0.02 256 / 0.08);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }

.brand-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand-name strong { color: var(--primary); font-weight: 800; }

.nav-cats {
  display: flex;
  gap: 28px;
  font-weight: 500;
  font-size: 15px;
}
.nav-cats a { opacity: 0.72; transition: opacity 0.15s ease; }
.nav-cats a:hover { opacity: 1; }

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  color: var(--ink);
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
}
.nav-toggle:hover { background: var(--surface); }

.cart-btn {
  position: relative;
  border: none;
  background: var(--primary);
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease-out-expo), background 0.15s ease;
}
.cart-btn:hover { background: var(--primary-ink); transform: scale(1.05); }

/* Auth */
.auth-area { display: flex; align-items: center; }

.btn-login {
  border: 1px solid oklch(0.18 0.02 256 / 0.15);
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-login:hover { border-color: var(--primary); background: var(--surface); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-logout:hover { color: var(--accent); }

.btn-my-orders {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.btn-my-orders:hover { color: var(--primary-ink); }

@media (max-width: 780px) {
  .user-name { display: none; }
}

.cart-count {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Hero */
.hero {
  position: relative;
  min-height: 640px;
  height: 92vh;
  max-height: 880px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ink);
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.4s var(--ease-out-expo);
}
.hero-video.active { opacity: 1; }

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, oklch(0.18 0.05 256 / 0.55) 0%, oklch(0.15 0.06 256 / 0.72) 100%),
    linear-gradient(90deg, oklch(0.1 0.06 256 / 0.35) 0%, transparent 50%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 0 24px;
  color: white;
}

.hero-tag {
  display: inline-block;
  background: oklch(1 0 0 / 0.14);
  border: 1px solid oklch(1 0 0 / 0.3);
  backdrop-filter: blur(6px);
  color: white;
  font-weight: 500;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.hero p {
  margin: 22px auto 34px;
  max-width: 520px;
  color: oklch(1 0 0 / 0.85);
  font-size: 17px;
}

.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-weight: 600;
  padding: 15px 32px;
  border-radius: 999px;
  box-shadow: 0 10px 26px oklch(0.42 0.16 256 / 0.4);
  transition: transform 0.2s var(--ease-out-expo), background 0.15s ease;
}
.btn-primary:hover {
  background: var(--primary-ink);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .hero-video { transition: none; }
  .btn-primary:hover, .cart-btn:hover { transform: none; }
}

/* Section intro bands (video + scrim) */
.section-intro {
  position: relative;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ink);
}

.section-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.section-video.ready { opacity: 1; }

.section-intro-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, oklch(0.15 0.05 256 / 0.45), oklch(0.12 0.06 256 / 0.68));
}

.section-intro-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
}

.section-intro-content h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-intro-content p {
  margin: 8px 0 0;
  color: oklch(1 0 0 / 0.82);
  font-size: 15px;
}

/* Seccion generica para categorias nuevas agregadas desde el panel (sin video/tagline curados) */
.category-section-header {
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 40px 24px;
}
.category-section-header h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Catalog */
.catalog-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 24px 80px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

.catalog-loading, .catalog-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 30px 0;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px oklch(0.18 0.02 256 / 0.16);
}

.product-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.product-body {
  padding: 16px 18px 18px;
}

.product-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}

.product-unit {
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0 10px;
}

.product-price {
  font-weight: 700;
  color: var(--accent);
  font-size: 17px;
  margin-bottom: 14px;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid oklch(0.18 0.02 256 / 0.15);
  background: var(--bg);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.qty-btn:hover { background: var(--surface); border-color: var(--primary); }

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

.add-btn {
  width: 100%;
  border: none;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.add-btn:hover { background: var(--primary-ink); }
.add-btn.added { background: var(--accent); }

/* Proceso */
.proceso {
  position: relative;
  padding: 90px 24px;
  overflow: hidden;
  background: var(--ink);
}

.proceso-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, oklch(0.15 0.05 256 / 0.6), oklch(0.1 0.06 256 / 0.82));
}

.proceso-content {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  color: white;
}

.proceso-content > h2 {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 40px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step {
  background: oklch(1 0 0 / 0.08);
  border: 1px solid oklch(1 0 0 / 0.16);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 28px 22px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 700;
  margin-bottom: 14px;
}

.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { margin: 0; color: oklch(1 0 0 / 0.78); font-size: 14px; }

/* SEO: texto visible con contexto local, antes del footer */
.about-us {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  text-align: center;
}
.about-us h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.about-us p { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 28px 24px;
  color: white;
  background: var(--primary);
  font-size: 14px;
}
.site-footer a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Cart drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.15 0.03 256 / 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 60;
}
.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(400px, 92vw);
  background: var(--bg);
  box-shadow: -12px 0 40px oklch(0.15 0.03 256 / 0.25);
  z-index: 70;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease-out-expo);
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  .cart-drawer, .cart-overlay { transition: none; }
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid oklch(0.18 0.02 256 / 0.08);
}
.cart-head h2 { font-size: 20px; }

.cart-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
}

.cart-items { flex: 1; overflow-y: auto; padding: 16px 22px; }

.cart-empty {
  color: var(--muted);
  text-align: center;
  margin-top: 40px;
  font-size: 14px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid oklch(0.18 0.02 256 / 0.06);
}

.cart-item-photo {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-sub { font-size: 12px; color: var(--muted); }

.cart-item-qty { display: flex; align-items: center; gap: 8px; }

.cart-item-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  margin-left: 6px;
}
.cart-item-remove:hover { color: var(--accent); }

.cart-footer { padding: 18px 22px 22px; border-top: 1px solid oklch(0.18 0.02 256 / 0.08); }

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 14px;
}

.btn-primary-block {
  width: 100%;
  border: none;
  background: var(--primary);
  color: white;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 0;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.btn-primary-block:hover:not(:disabled) { background: var(--primary-ink); }
.btn-primary-block:disabled { opacity: 0.5; cursor: not-allowed; }

.payment-method-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}
.payment-method-row select {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid oklch(0.18 0.02 256 / 0.18);
  background: var(--bg);
}

.payment-options-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.payment-options-info p { font-size: 13px; color: var(--muted); margin: 0; }

.payment-option-card {
  background: var(--surface);
  border-radius: 10px;
  padding: 12px 14px;
}
.payment-option-label { font-weight: 700; font-size: 14px; }

.payment-option-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.payment-option-account { font-size: 15px; color: var(--primary); font-weight: 700; }

.payment-option-copy-btn {
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}
.payment-option-copy-btn:hover { background: var(--surface); }

.payment-option-qr-toggle {
  display: block;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0;
  margin-top: 8px;
}
.payment-option-qr-toggle:hover { color: var(--ink); }

.payment-option-qr { width: 120px; height: 120px; object-fit: contain; margin-top: 8px; border-radius: 8px; }

.order-info-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.order-info-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.order-info-form input {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid oklch(0.18 0.02 256 / 0.18);
  background: var(--bg);
}
.order-info-form input:focus { outline: none; border-color: var(--primary); }

.order-info-form .btn-primary-block { margin-top: 6px; }

/* Scroll reveal */
.io-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
.io-reveal.visible { opacity: 1; transform: translateY(0); }

.steps .step:nth-child(1) { transition-delay: 0s; }
.steps .step:nth-child(2) { transition-delay: 0.1s; }
.steps .step:nth-child(3) { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  .io-reveal { transition: opacity 0.3s ease; transform: none; }
}

@media (max-width: 780px) {
  .nav-toggle { display: flex; order: -1; }

  /* La barra superior no cabe en una sola fila en movil (hamburguesa + logo +
     avatar + "Mis pedidos" + "Salir" + carrito) -- eso era lo que generaba el
     desborde horizontal. El area de usuario pasa a su propia fila. */
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; }
  .auth-area { order: 10; flex-basis: 100%; justify-content: flex-end; }

  .nav-cats {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid oklch(0.18 0.02 256 / 0.1);
    box-shadow: 0 12px 24px oklch(0.15 0.03 256 / 0.12);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-cats.open {
    max-height: 60vh;
    overflow-y: auto;
    visibility: visible;
  }
  .nav-cats a {
    padding: 14px 24px;
    border-top: 1px solid oklch(0.18 0.02 256 / 0.06);
  }
  .nav-cats a:first-child { border-top: none; }

  .steps { grid-template-columns: 1fr; }
  .hero { height: auto; min-height: 560px; padding: 100px 0 60px; }
  .section-intro { height: 220px; }
}

/* Login modal (selector de proveedor) */
.login-modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.15 0.03 256 / 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 80;
  padding: 20px;
}
.login-modal-overlay.open { opacity: 1; visibility: visible; }

.login-modal {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 50px oklch(0.15 0.03 256 / 0.3);
}

.login-modal h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-modal p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.login-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}
.login-modal-close:hover { color: var(--ink); }

.login-providers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-provider-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid oklch(0.18 0.02 256 / 0.15);
  background: var(--bg);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.login-provider-btn:hover:not(:disabled) { border-color: var(--primary); background: var(--surface); }
.login-provider-btn:disabled { cursor: not-allowed; color: var(--muted); }

.provider-soon {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  padding: 3px 8px;
  border-radius: 999px;
}

/* Panel de administrador */
.admin-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 50px 24px 100px;
}

.admin-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 28px;
}

.admin-state {
  color: var(--muted);
  font-size: 15px;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

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

.order-customer { font-weight: 700; font-size: 16px; }
.order-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.order-total { font-weight: 700; color: var(--accent); font-size: 17px; }
.order-address { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

.order-items {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  font-size: 14px;
}
.order-items li { padding: 3px 0; }

.order-status-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.order-status-select {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid oklch(0.18 0.02 256 / 0.18);
  background: var(--bg);
}

.my-orders-modal {
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

.product-form-modal {
  max-height: 88vh;
  overflow-y: auto;
}

.order-status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  width: fit-content;
}
.order-status-badge.status-pending { background: oklch(0.48 0.02 256 / 0.12); color: var(--muted); }
.order-status-badge.status-confirmed { background: oklch(0.42 0.16 256 / 0.14); color: var(--primary); }
.order-status-badge.status-delivered { background: oklch(0.60 0.15 145 / 0.14); color: oklch(0.45 0.14 145); }
.order-status-badge.status-cancelled { background: oklch(0.45 0.17 55 / 0.14); color: var(--accent); }

.settings-hint { font-size: 13px; color: var(--muted); margin: -6px 0 4px; }
.settings-saved { color: oklch(0.45 0.14 145); font-weight: 600; font-size: 14px; }

.catalog-options-manager { margin-top: 32px; }
.catalog-options-manager h3 {
  font-size: 15px;
  margin: 22px 0 10px;
}
.catalog-options-manager h3:first-child { margin-top: 0; }

.catalog-options-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  min-height: 30px;
}

.catalog-option-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}

.catalog-option-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.catalog-option-remove:hover { color: var(--accent); }

.catalog-option-add-form {
  display: flex;
  gap: 8px;
}
.catalog-option-add-form input {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid oklch(0.18 0.02 256 / 0.18);
  background: var(--bg);
}
.catalog-option-add-form input:focus { outline: none; border-color: var(--primary); }

#productUnit, #productCategory { text-transform: capitalize; }

.payment-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.payment-option-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}
.payment-option-chip > div { flex: 1; }
.payment-option-chip-qr { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }

.payment-option-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
.payment-option-add-form input[type="text"] {
  flex: 1;
  min-width: 140px;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid oklch(0.18 0.02 256 / 0.18);
  background: var(--bg);
}
.payment-option-add-form input[type="text"]:focus { outline: none; border-color: var(--primary); }
.payment-option-add-form label.settings-hint { margin: 0; display: flex; flex-direction: column; gap: 4px; }

/* Tabs del panel de admin */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid oklch(0.18 0.02 256 / 0.1);
}

.admin-tab {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 4px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.admin-tab-panel[hidden] { display: none; }

.btn-outline {
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 18px;
  transition: background 0.15s ease;
}
.btn-outline:hover { background: var(--surface); }

.products-admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-admin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.product-admin-photo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.photo-source-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: -10px 0 4px;
}
.photo-source-row .btn-outline { margin-bottom: 0; flex: 1; }

.product-photo-preview {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  margin: -8px 0 4px;
}

.product-admin-info { flex: 1; min-width: 0; }
.product-admin-name { font-weight: 700; font-size: 15px; }
.product-admin-meta { font-size: 12px; color: var(--muted); }
.product-admin-inactive { opacity: 0.5; }

.product-admin-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-small {
  border: 1px solid oklch(0.18 0.02 256 / 0.15);
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-small:hover { border-color: var(--primary); }
.btn-small.danger:hover { border-color: var(--accent); color: var(--accent); }

.product-active-label {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}
.product-active-label input { width: auto; }

/* Chat por pedido */
.order-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.order-chat {
  margin-top: 12px;
  border-top: 1px solid oklch(0.18 0.02 256 / 0.1);
  padding-top: 12px;
}

.order-chat-messages {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.chat-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-bubble time { font-size: 10px; color: oklch(1 0 0 / 0.7); align-self: flex-end; }

.chat-bubble-customer {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid oklch(0.18 0.02 256 / 0.12);
  color: var(--ink);
}
.chat-bubble-customer time { color: var(--muted); }

.chat-bubble-team {
  align-self: flex-end;
  background: var(--primary);
  color: white;
}

.order-chat-form {
  display: flex;
  gap: 8px;
}

.order-chat-input {
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid oklch(0.18 0.02 256 / 0.18);
  background: var(--bg);
}
.order-chat-input:focus { outline: none; border-color: var(--primary); }

/* Widget de chat flotante (frontend del cliente) */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 10px 24px oklch(0.18 0.02 256 / 0.3);
  z-index: 70;
  transition: transform 0.15s ease;
}
.chat-fab:hover { transform: scale(1.06); }

/* Puntito de aviso cuando llega un mensaje con el chat cerrado */
.chat-fab.has-unread::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.customer-chat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: min(340px, calc(100vw - 48px));
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px oklch(0.15 0.03 256 / 0.3);
  z-index: 70;
  display: flex;
  flex-direction: column;
  max-height: 420px;
}
.customer-chat-panel[hidden] { display: none; }

.customer-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid oklch(0.18 0.02 256 / 0.1);
}

.customer-chat-panel .order-chat-messages { padding: 14px 16px 0; flex: 1; }
.customer-chat-panel .order-chat-form { padding: 12px 16px 16px; }

@media (max-width: 780px) {
  .chat-fab { bottom: 16px; right: 16px; }
  .customer-chat-panel { bottom: 84px; right: 16px; }
}
