/* ===========================================================================
   PROMAX — Stylesheet
   Tema dinámico vía CSS variables. Los colores se inyectan desde app.js
   leyendo la config de la sucursal.
   =========================================================================== */

:root {
  /* Defaults — sobrescritos por JS al cargar la sucursal */
  --c-primary: #1a1a1a;
  --c-primary-rgb: 26, 26, 26;
  --c-secondary: #c89545;
  --c-bg: #fafaf7;
  --c-surface: #ffffff;
  --c-ink: #1a1a1a;
  --c-ink-soft: #4a4a4a;
  --c-border: #e8e6e0;
  --c-success: #16a34a;
  --c-danger: #dc2626;
  --c-warn: #d97706;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 4px rgba(0,0,0,0.04);
  --shadow: 0 4px 14px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 24px 48px -12px rgba(0,0,0,0.18), 0 8px 16px rgba(0,0,0,0.06);

  --header-h: 64px;
  --maxw: 1100px;

  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --c-bg: #0f0f10;
  --c-surface: #1a1a1c;
  --c-ink: #f3f3f0;
  --c-ink-soft: #a8a8a3;
  --c-border: #2a2a2c;
  --shadow: 0 4px 14px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 48px -12px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

/* El atributo HTML `hidden` siempre tiene que ganar.
   Sin esto, cualquier `display: flex/grid` definido en una clase pisa el hidden
   nativo del browser y el elemento aparece aunque tenga el atributo. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  padding-bottom: 96px; /* dejá lugar al FAB */
}

button { font-family: inherit; }

/* ========== HEADER ========== */
.px-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  transition: box-shadow 0.2s var(--ease);
}
.px-header.scrolled { box-shadow: var(--shadow-sm); }

.px-header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.px-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.px-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.px-brand-info { min-width: 0; }

.px-brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.px-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-ink-soft);
  background: transparent;
  border: none;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  margin-left: -4px;
  transition: background 0.15s var(--ease);
}
.px-status:hover { background: var(--c-bg); }
.px-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #9ca3af;
}
.px-status.open .px-status-dot {
  background: var(--c-success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}
.px-status.closed .px-status-dot {
  background: var(--c-danger);
}
.px-status-caret { width: 12px; height: 12px; opacity: 0.6; }

.px-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.px-icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--c-ink);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.px-icon-btn:hover { background: var(--c-bg); }
.px-icon-btn svg { width: 20px; height: 20px; }

/* Search bar */
.px-search-bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.px-search-bar[hidden] { display: none; }
.px-search-icon {
  width: 18px; height: 18px;
  position: absolute;
  margin-left: 12px;
  color: var(--c-ink-soft);
  pointer-events: none;
}
.px-search-bar input {
  flex: 1;
  height: 44px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-full);
  padding: 0 16px 0 40px;
  background: var(--c-bg);
  color: var(--c-ink);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border 0.15s var(--ease);
}
.px-search-bar input:focus {
  border-color: var(--c-primary);
  background: var(--c-surface);
}

/* Categorías */
.px-cats {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}
.px-cats::-webkit-scrollbar { display: none; }

.px-cat-btn {
  padding: 8px 14px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-ink-soft);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s var(--ease);
  scroll-snap-align: start;
}
.px-cat-btn:hover { color: var(--c-ink); border-color: var(--c-ink-soft); }
.px-cat-btn.px-active {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-surface);
}

/* ========== HERO ========== */
.px-hero {
  position: relative;
  overflow: hidden;
  padding: 48px 16px 56px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.px-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(var(--c-primary-rgb), 0.18), transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(var(--c-primary-rgb), 0.12), transparent 60%);
  pointer-events: none;
}
.px-hero-content { position: relative; }
.px-hero-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-primary);
}
.px-hero-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.px-hero-sub {
  margin: 0;
  font-size: 15px;
  color: var(--c-ink-soft);
  max-width: 480px;
}

/* ========== INFO STRIP ========== */
.px-info {
  max-width: var(--maxw);
  margin: -16px auto 24px;
  padding: 0 16px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.px-info:empty { display: none; }

.px-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--c-ink);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  box-shadow: var(--shadow-sm);
}
button.px-info-card { width: 100%; }
.px-info-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--c-primary);
}

.px-info-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--c-bg);
  color: var(--c-ink-soft);
}
.px-info-card-icon svg { width: 18px; height: 18px; }
.px-info-card-icon.px-ok {
  background: rgba(22, 163, 74, 0.12);
  color: var(--c-success);
}
.px-info-card-icon.px-warn {
  background: rgba(217, 119, 6, 0.12);
  color: var(--c-warn);
}
.px-info-card-icon.px-wapp {
  background: rgba(37, 211, 102, 0.14);
  color: #25d366;
}
.px-info-card-icon.px-envio {
  background: rgba(var(--c-primary-rgb), 0.12);
  color: var(--c-primary);
}

.px-info-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.px-info-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}
.px-info-card-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.px-info-card-arrow {
  width: 16px;
  height: 16px;
  color: var(--c-ink-soft);
  flex-shrink: 0;
  transition: transform 0.15s var(--ease);
}
.px-info-card:hover .px-info-card-arrow { transform: translateX(2px); color: var(--c-primary); }

/* Closed banner */
.px-closed-banner {
  max-width: var(--maxw);
  margin: 0 auto 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #78350f;
  font-size: 14px;
}
[data-theme="dark"] .px-closed-banner {
  background: linear-gradient(135deg, #78350f, #92400e);
  color: #fef3c7;
}
.px-closed-banner svg { width: 22px; height: 22px; flex-shrink: 0; }
.px-closed-banner strong { display: block; }
.px-closed-banner span { font-size: 13px; opacity: 0.9; }

/* ========== PRODUCTS ========== */
.px-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

.px-cat-title {
  margin: 32px 0 14px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.px-cat-title-count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--c-ink-soft);
}

.px-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.px-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
  cursor: pointer;
  position: relative;
}
.px-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--c-primary);
}
.px-card:active { transform: translateY(-1px); }

.px-card-img {
  position: relative;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, rgba(var(--c-primary-rgb),0.06), rgba(var(--c-primary-rgb),0.02));
  overflow: hidden;
}
.px-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-out);
}
.px-card:hover .px-card-img img { transform: scale(1.04); }

.px-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.4;
}

.px-card-fav {
  position: absolute;
  top: 8px; right: 8px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--c-ink-soft);
  transition: all 0.15s var(--ease);
  backdrop-filter: blur(4px);
}
.px-card-fav:hover { transform: scale(1.1); color: var(--c-danger); }
.px-card-fav.px-faved { color: var(--c-danger); }
.px-card-fav svg { width: 16px; height: 16px; }

.px-card-body {
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.px-card-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.px-card-desc {
  margin: 0;
  font-size: 12px;
  color: var(--c-ink-soft);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.px-card-foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.px-price {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--c-ink);
  letter-spacing: -0.02em;
}
.px-price-old {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-ink-soft);
  text-decoration: line-through;
  margin-right: 6px;
}

.px-card-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--c-ink);
  color: var(--c-surface);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}
.px-card-add:hover {
  background: var(--c-primary);
  transform: scale(1.08);
}
.px-card-add svg { width: 16px; height: 16px; }

.px-card-qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--c-ink);
  color: var(--c-surface);
  border-radius: var(--radius-full);
  padding: 4px;
  flex-shrink: 0;
}
.px-card-qty button {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.px-card-qty button:hover { background: rgba(255,255,255,0.15); }
.px-card-qty span {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

/* Skeleton */
.px-skeleton .px-card-img,
.px-skeleton .px-card-body {
  background: linear-gradient(90deg, var(--c-border) 25%, var(--c-surface) 50%, var(--c-border) 75%);
  background-size: 200% 100%;
  animation: pxShimmer 1.5s infinite;
}
.px-skeleton .px-card-body { height: 80px; }
.px-skeleton:hover { transform: none; box-shadow: none; }
@keyframes pxShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty */
.px-empty {
  padding: 60px 20px;
  text-align: center;
}
.px-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.px-empty h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
}
.px-empty p {
  margin: 0;
  color: var(--c-ink-soft);
  font-size: 14px;
}

/* ========== FAB ========== */
.px-cart-fab {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  background: var(--c-ink);
  color: var(--c-surface);
  border: none;
  border-radius: var(--radius-full);
  padding: 14px 20px 14px 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 90;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
  animation: pxFabIn 0.35s var(--ease-out);
}
.px-cart-fab[hidden] { display: none; }
.px-cart-fab svg { width: 18px; height: 18px; }
.px-cart-fab-count {
  background: var(--c-secondary);
  color: var(--c-ink);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  font-family: var(--font-mono);
}
.px-cart-fab-total { font-family: var(--font-mono); font-weight: 700; }
.px-cart-fab:hover { transform: translateX(-50%) translateY(-2px); }
.px-cart-fab.px-bump { animation: pxBump 0.4s var(--ease); }
@keyframes pxFabIn {
  from { transform: translateX(-50%) translateY(40px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}
@keyframes pxBump {
  0%   { transform: translateX(-50%) translateY(0) scale(1); }
  40%  { transform: translateX(-50%) translateY(-4px) scale(1.05); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}

/* ========== DRAWER ========== */
.px-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
}
.px-drawer[hidden] { display: none; }

.px-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: pxFadeIn 0.2s var(--ease);
}
@keyframes pxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.px-drawer-panel {
  position: absolute;
  background: var(--c-surface);
  display: flex;
  flex-direction: column;
  /* mobile: bottom sheet */
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 92vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  animation: pxSlideUp 0.3s var(--ease-out);
}
@keyframes pxSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@media (min-width: 768px) {
  .px-drawer-panel {
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    width: 440px;
    max-width: 100%;
    max-height: none;
    border-radius: 0;
    animation: pxSlideLeft 0.3s var(--ease-out);
  }
  @keyframes pxSlideLeft {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
  }
}

.px-drawer-header {
  position: sticky;
  top: 0;
  background: var(--c-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  z-index: 1;
}
.px-drawer-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.px-drawer-handle {
  display: none;
  width: 36px; height: 4px;
  background: var(--c-border);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  padding: 0;
}
@media (max-width: 767px) {
  .px-drawer-panel { padding-top: 16px; }
  .px-drawer-handle {
    display: block;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Cart items */
.px-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.px-cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-border);
  align-items: center;
}
.px-cart-item:last-child { border-bottom: none; }
.px-cart-item-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  opacity: 0.6;
}
.px-cart-item-info { flex: 1; min-width: 0; }
.px-cart-item-name {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.px-cart-item-price {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-ink-soft);
}
.px-cart-item-qty {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--c-bg);
  border-radius: var(--radius-full);
  padding: 2px;
}
.px-cart-item-qty button {
  width: 26px; height: 26px;
  border: none;
  background: transparent;
  color: var(--c-ink);
  border-radius: 50%;
  cursor: pointer;
  font-weight: 600;
}
.px-cart-item-qty button:hover { background: var(--c-border); }
.px-cart-item-qty span {
  min-width: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.px-cart-empty {
  padding: 60px 30px;
  text-align: center;
  flex: 1;
}
.px-cart-empty p {
  color: var(--c-ink-soft);
  margin: 0 0 16px;
}

.px-cart-footer {
  border-top: 1px solid var(--c-border);
  padding: 16px;
  background: var(--c-surface);
}

.px-cart-totals { margin-bottom: 12px; }
.px-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
  color: var(--c-ink-soft);
}
.px-row strong { font-family: var(--font-mono); color: var(--c-ink); }
.px-row-total {
  font-size: 17px;
  padding: 10px 0 4px;
  margin-top: 4px;
  border-top: 1px solid var(--c-border);
  color: var(--c-ink);
  font-weight: 600;
}
.px-row-total strong { font-size: 19px; }

/* Buttons */
.px-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: var(--c-surface);
  color: var(--c-ink);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}
.px-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.px-btn svg { width: 16px; height: 16px; }
.px-btn-primary {
  background: var(--c-ink);
  color: var(--c-surface);
}
.px-btn-primary:hover:not(:disabled) {
  background: var(--c-primary);
  transform: translateY(-1px);
}
.px-btn-ghost {
  background: transparent;
  border-color: var(--c-border);
}
.px-btn-ghost:hover { border-color: var(--c-ink); }
.px-btn-big {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
}

/* Form */
.px-form {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}

/* ----- Resumen del pedido ----- */
.px-form-summary {
  background: linear-gradient(135deg, rgba(var(--c-primary-rgb), 0.06), rgba(var(--c-primary-rgb), 0.02));
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
}
.px-form-summary-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: transparent;
  border: none;
  font-family: inherit;
  text-align: left;
  color: var(--c-ink);
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.px-form-summary-head:hover { background: rgba(var(--c-primary-rgb), 0.04); }
.px-form-summary-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--c-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-primary);
  flex-shrink: 0;
}
.px-form-summary-icon svg { width: 20px; height: 20px; }
.px-form-summary-info { flex: 1; min-width: 0; }
.px-form-summary-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}
.px-form-summary-sub {
  display: block;
  font-size: 12px;
  color: var(--c-ink-soft);
  margin-top: 2px;
}
.px-form-summary-caret {
  width: 18px; height: 18px;
  color: var(--c-ink-soft);
  transition: transform 0.2s var(--ease);
}
.px-form-summary-head[aria-expanded="true"] .px-form-summary-caret {
  transform: rotate(180deg);
}
.px-form-summary-items {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--c-border);
  margin-top: 4px;
  padding-top: 12px;
}
.px-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.px-summary-item-thumb {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--c-surface);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  opacity: 0.7;
}
.px-summary-item-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.px-summary-item-qty {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--c-ink-soft);
  padding: 2px 6px;
  background: var(--c-surface);
  border-radius: 4px;
}
.px-summary-item-price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
}

/* ----- Secciones ----- */
.px-form-section {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 14px 4px;
  margin-bottom: 14px;
}
.px-form-section:last-of-type { margin-bottom: 16px; }

.px-form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--c-border);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-ink-soft);
}
.px-form-section-title svg {
  width: 16px; height: 16px;
  color: var(--c-primary);
}
.px-opt {
  font-weight: 500;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--c-ink-soft);
}

/* ----- Campos ----- */
.px-field { margin-bottom: 10px; }
.px-field:last-child { margin-bottom: 0; }
.px-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-ink-soft);
  margin-bottom: 5px;
}
.px-req { color: var(--c-danger); margin-left: 2px; }

.px-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.px-input-icon {
  position: absolute;
  left: 12px;
  width: 18px; height: 18px;
  color: var(--c-ink-soft);
  pointer-events: none;
  transition: color 0.15s var(--ease);
}
/* specificity bump para que gane sobre `.px-field input { padding: 11px 14px }` */
.px-field .px-input-wrap input { padding-left: 42px; }

.px-field input,
.px-field textarea {
  width: 100%;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-ink);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
  resize: none;
}
.px-field input:focus,
.px-field textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb), 0.12);
}
.px-input-wrap input:focus + svg,
.px-input-wrap:focus-within .px-input-icon { color: var(--c-primary); }
.px-field.px-error input,
.px-field.px-error textarea {
  border-color: var(--c-danger);
  background: rgba(220, 38, 38, 0.04);
}

.px-field-hint {
  display: block;
  font-size: 11px;
  color: var(--c-ink-soft);
  margin-top: 4px;
  line-height: 1.4;
}
.px-field-hint strong {
  font-family: var(--font-mono);
  color: var(--c-ink);
  font-weight: 600;
}
.px-field-error {
  display: block;
  font-size: 12px;
  color: var(--c-danger);
  font-weight: 500;
  margin-top: 4px;
}

/* ----- Segmented ----- */
.px-segmented {
  display: flex;
  gap: 4px;
  background: var(--c-surface);
  padding: 4px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.px-segmented-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 9px 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-ink-soft);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.px-segmented-btn svg { width: 16px; height: 16px; }
.px-segmented-btn.px-active {
  background: var(--c-surface);
  color: var(--c-ink);
  box-shadow: var(--shadow-sm);
}
.px-segmented-btn.px-active svg { color: var(--c-primary); }

/* ----- Totales y CTA ----- */
.px-form-totals {
  padding: 14px;
  background: var(--c-bg);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.px-form-where {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(37, 211, 102, 0.1);
  color: #1ea857;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 12px;
}
[data-theme="dark"] .px-form-where {
  background: rgba(37, 211, 102, 0.15);
  color: #25d366;
}
.px-form-where svg { width: 16px; height: 16px; flex-shrink: 0; }
.px-form-where strong { font-family: var(--font-mono); }

.px-form-note {
  text-align: center;
  font-size: 11px;
  color: var(--c-ink-soft);
  margin: 10px 0 0;
}

.px-form-disabled {
  padding: 60px 24px;
  text-align: center;
}
.px-form-disabled h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
}
.px-form-disabled p {
  margin: 0;
  color: var(--c-ink-soft);
}

/* ========== HORARIOS MODAL ========== */
.px-modal-horarios { padding: 0; }
@media (min-width: 768px) {
  .px-modal-horarios { width: 460px; }
}

.px-horarios-summary {
  margin: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
}
.px-horarios-summary.px-ok {
  background: rgba(22, 163, 74, 0.1);
  color: var(--c-success);
}
.px-horarios-summary.px-warn {
  background: rgba(217, 119, 6, 0.1);
  color: var(--c-warn);
}
.px-horarios-summary > div { color: var(--c-ink); flex: 1; }
.px-horarios-summary strong { display: block; font-size: 15px; }
.px-horarios-summary div > div { font-size: 13px; color: var(--c-ink-soft); }
.px-horarios-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px currentColor;
  opacity: 0.95;
}
.px-horarios-summary.px-warn .px-horarios-dot { opacity: 0.7; }

.px-horarios-block {
  padding: 0 16px 16px;
}
.px-horarios-block h4 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-ink-soft);
}

.px-dias-list {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.px-dia-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border);
  font-size: 14px;
}
.px-dia-row:last-child { border-bottom: none; }
.px-dia-row.px-hoy {
  background: rgba(var(--c-primary-rgb), 0.06);
}
.px-dia-row.px-hoy .px-dia-nombre {
  color: var(--c-primary);
  font-weight: 700;
}
.px-dia-row.px-cerrado .px-dia-rango {
  color: var(--c-ink-soft);
  font-style: italic;
}
.px-dia-nombre em {
  font-style: normal;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.px-dia-rango { font-family: var(--font-mono); font-size: 13px; }

.px-horarios-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--c-bg);
  border-radius: var(--radius);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--c-ink);
  transition: background 0.15s var(--ease);
}
a.px-horarios-link:hover { background: var(--c-border); }
.px-horarios-link svg { width: 24px; height: 24px; color: var(--c-primary); flex-shrink: 0; }
.px-horarios-link strong { display: block; font-size: 14px; }
.px-horarios-link span { font-size: 12px; color: var(--c-ink-soft); }

/* Product modal */
.px-modal-product { padding: 0; }
@media (min-width: 768px) {
  .px-modal-product { width: 540px; }
}
.px-modal-close {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 2;
  background: rgba(255,255,255,0.9) !important;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .px-modal-close { background: rgba(26, 26, 28, 0.9) !important; }

.px-modal-gallery {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(var(--c-primary-rgb),0.08), rgba(var(--c-primary-rgb),0.02));
  overflow: hidden;
}
.px-modal-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.px-modal-gallery img.px-active { opacity: 1; }

.px-gallery-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.px-gallery-dots button {
  width: 8px; height: 8px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
}
.px-gallery-dots button.px-active { background: white; transform: scale(1.3); }

.px-modal-info {
  padding: 24px;
}
.px-modal-rubro {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-primary);
  margin-bottom: 8px;
}
.px-modal-name {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.px-modal-desc {
  margin: 0 0 16px;
  color: var(--c-ink-soft);
  line-height: 1.5;
  font-size: 14px;
}
.px-modal-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--c-border);
}
.px-modal-price {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.px-modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Success overlay */
.px-success {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: pxFadeIn 0.3s var(--ease);
}
.px-success[hidden] { display: none; }
.px-success-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: pxPopIn 0.4s var(--ease-out);
}
@keyframes pxPopIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.px-success-check {
  width: 80px; height: 80px;
  margin: 0 auto 18px;
}
.px-success-check svg {
  width: 100%; height: 100%;
  display: block;
}
.px-check-circle {
  stroke: var(--c-success);
  stroke-width: 2.5;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: pxStroke 0.6s var(--ease-out) 0.1s forwards;
}
.px-check-mark {
  stroke: var(--c-success);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: pxStroke 0.4s var(--ease-out) 0.5s forwards;
}
@keyframes pxStroke {
  to { stroke-dashoffset: 0; }
}

.px-success h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}
.px-success p {
  margin: 0 0 4px;
  color: var(--c-ink-soft);
  font-size: 14px;
}
.px-success-num {
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 8px 0 18px !important;
  color: var(--c-primary) !important;
  font-weight: 600;
}

/* Toast */
.px-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-ink);
  color: var(--c-surface);
  padding: 12px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 400;
  animation: pxToastIn 0.3s var(--ease-out);
}
.px-toast[hidden] { display: none; }
.px-toast.px-toast-error { background: var(--c-danger); }
.px-toast.px-toast-success { background: var(--c-success); }
@keyframes pxToastIn {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}

/* ========== INFO BLOCK ========== */
.px-info-block {
  max-width: var(--maxw);
  margin: 32px auto 8px;
  padding: 0 16px;
}
.px-info-block-head {
  text-align: center;
  margin-bottom: 14px;
}
.px-info-block-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}
.px-info-block-head p { display: none; }

.px-info-block-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.px-info-block-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-decoration: none;
  color: var(--c-ink);
  transition: all 0.18s var(--ease);
}
a.px-info-block-card:hover {
  border-color: var(--c-primary);
  background: rgba(var(--c-primary-rgb), 0.04);
}

.px-info-block-icon {
  grid-row: 1 / 3;
  align-self: center;
  width: 36px; height: 36px;
  border-radius: 9px;
  background: rgba(var(--c-primary-rgb), 0.1);
  color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
}
.px-info-block-icon svg { width: 18px; height: 18px; }

.px-info-block-card h4 {
  grid-column: 2;
  margin: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
  line-height: 1.3;
}
.px-info-block-card p {
  grid-column: 2;
  margin: 1px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-ink);
  line-height: 1.35;
  word-break: break-word;
}

/* Footer */
.px-footer {
  text-align: center;
  padding: 40px 20px 100px;
  color: var(--c-ink-soft);
  font-size: 12px;
}
.px-footer p { margin: 0; }

/* Small phones */
@media (max-width: 380px) {
  .px-products { grid-template-columns: 1fr 1fr; gap: 10px; }
  .px-card-name { font-size: 13px; }
  .px-price { font-size: 15px; }
  .px-card-body { padding: 10px 10px 10px; }
}
