:root {
  /* Paleta Base - Modo Claro */
  --color-primary-h: 220;
  --color-primary-s: 40%;
  --color-primary-l: 18%;
  --color-primary: hsl(var(--color-primary-h), var(--color-primary-s), var(--color-primary-l));
  --color-primary-light: hsl(var(--color-primary-h), var(--color-primary-s), 45%);
  
  --color-accent-h: 160;
  --color-accent-s: 70%;
  --color-accent-l: 37%;
  --color-accent: hsl(var(--color-accent-h), var(--color-accent-s), var(--color-accent-l));
  --color-accent-glow: hsla(var(--color-accent-h), var(--color-accent-s), var(--color-accent-l), 0.2);

  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  
  --color-bg: #f8fafc;
  --color-surface-rgb: 255, 255, 255;
  --color-surface: #ffffff;
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-border: rgba(15, 23, 42, 0.08);
  
  --radius-card: 20px;
  --radius-btn: 14px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-float: 0 20px 40px -15px rgba(0, 0, 0, 0.15);
  
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] {
  /* Paleta Base - Modo Oscuro */
  --color-primary-h: 224;
  --color-primary-s: 64%;
  --color-primary-l: 58%;
  --color-primary: hsl(var(--color-primary-h), var(--color-primary-s), var(--color-primary-l));
  --color-primary-light: hsl(var(--color-primary-h), var(--color-primary-s), 70%);
  
  --color-bg: #090d16;
  --color-surface-rgb: 15, 23, 42;
  --color-surface: #0f172a;
  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-border: rgba(248, 250, 252, 0.08);
  --shadow-card: 0 15px 35px -10px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(255, 255, 255, 0.02);
  --shadow-float: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

html {
  color-scheme: light dark;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  transition: background-color var(--transition-smooth);
}

/* Aplicar accent-color global para coherencia de marca nativa */
body, input, textarea, select {
  accent-color: var(--color-accent);
}

/* Esferas de Brillo de Fondo (Glow Spheres) */
.glow-sphere {
  position: fixed;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(100px);
  opacity: 0.15;
  mix-blend-mode: screen;
  transition: all var(--transition-smooth);
}

.sphere-1 {
  top: -100px;
  right: -100px;
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  animation: pulseSphere 12s infinite alternate;
}

.sphere-2 {
  bottom: -100px;
  left: -100px;
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
  animation: pulseSphere 15s infinite alternate-reverse;
}

@keyframes pulseSphere {
  0% {
    transform: scale(1) translate(0, 0);
    opacity: 0.12;
  }
  100% {
    transform: scale(1.3) translate(30px, 20px);
    opacity: 0.22;
  }
}

/* Theme Toggle */
.theme-toggle-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: #fff;
  transition: all var(--transition-smooth);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-toggle-btn:hover {
  transform: rotate(15deg) scale(1.05);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

/* Contenedor Principal (SPA) */
#app {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Vistas SPA - compatible con todos los navegadores */
.view {
  display: none;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

.view.active {
  display: flex;
  flex-direction: column;
}

/* Banner de Noscript */
.noscript-banner {
  background: linear-gradient(135deg, var(--color-warning), #d97706);
  color: #fff;
  text-align: center;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Header Premium */
/* Header Premium y Portada Storefront */
.app-header {
  background: linear-gradient(135deg, hsl(var(--color-primary-h), var(--color-primary-s), 14%) 0%, hsl(var(--color-primary-h), var(--color-primary-s), 8%) 100%);
  color: #fff;
  padding: 0 0 20px 0;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: var(--shadow-float);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.store-cover-banner {
  width: 100%;
  height: 110px;
  position: relative;
  background: linear-gradient(135deg, hsl(var(--color-primary-h), 50%, 22%) 0%, hsl(var(--color-accent-h), 45%, 18%) 50%, hsl(var(--color-primary-h), 60%, 14%) 100%);
  overflow: hidden;
}

.store-cover-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15), transparent 60%);
  pointer-events: none;
}

.store-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.store-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(15, 23, 42, 0.75) 100%);
}

.header-content-wrapper {
  padding: 0 16px;
  position: relative;
  z-index: 5;
  margin-top: -32px;
}

.store-brand-meta {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.store-avatar-container {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--color-surface);
  border: 3px solid hsl(var(--color-primary-h), var(--color-primary-s), 14%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.store-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
}

.store-badges-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
  width: 100%;
}

.store-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  width: fit-content;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.store-status-badge.open {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.store-status-badge.closed {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.store-status-badge.open .status-dot {
  box-shadow: 0 0 8px #34d399;
  animation: pulseDot 1.8s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.store-info-box {
  margin-top: 10px;
}

.store-contact-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.store-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 2px;
}

.store-desc.hours {
  color: #38bdf8;
  font-weight: 500;
}

.store-welcome-box {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--color-primary);
  border-radius: 10px;
}

.store-welcome-text {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  font-style: italic;
  margin: 0;
}

.header-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  position: relative;
  z-index: 10;
  width: 100%;
}

.store-badge-container {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, var(--color-accent) 0%, hsl(var(--color-accent-h), var(--color-accent-s), 28%) 100%);
  color: #fff;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px var(--color-accent-glow);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.orders-history-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.2s;
}

.orders-history-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.orders-btn-icon {
  font-size: 12px;
}

.app-header .theme-toggle-btn {
  position: static !important;
  width: 34px !important;
  height: 34px !important;
  font-size: 14px !important;
  box-shadow: none !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}

.store-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  line-height: 1.25;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  word-break: break-word;
}

.store-desc {
  font-size: 12px;
  color: #cbd5e1;
  opacity: 0.9;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.store-desc.phone {
  font-weight: 600;
  color: #93c5fd;
}

/* Buscador Flotante */
.search-bar-container {
  padding: 16px 20px;
  background-color: transparent;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--color-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  padding: 10px 16px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-smooth);
}

.search-box:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-accent-glow), var(--shadow-card);
  transform: translateY(-1px);
}

.search-icon {
  font-size: 16px;
  margin-right: 10px;
  opacity: 0.7;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--color-text-primary);
  background: transparent;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.7;
}

.clear-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0 4px;
  display: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.clear-btn:hover {
  opacity: 1;
}

/* Pestañas de Categorías */
.categories-tabs-container {
  padding: 4px 20px 16px;
  overflow-x: auto;
  white-space: nowrap;
  /* Ocultar scrollbar de forma estandarizada */
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.categories-tabs-container::-webkit-scrollbar {
  display: none;
}

.tabs-list {
  display: inline-flex;
  gap: 10px;
}

.tab-item {
  background-color: var(--color-surface);
  color: var(--color-text-secondary);
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.tab-item:hover {
  border-color: var(--color-primary-light);
  color: var(--color-text-primary);
  transform: translateY(-1px);
}

.tab-item.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px -3px hsla(var(--color-primary-h), var(--color-primary-s), var(--color-primary-l), 0.3);
}

/* Grid del Catálogo */
.catalog-main {
  flex: 1;
  padding: 0 14px 120px;
}

.catalog-grid,
.catalog-grid.grid-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 320px) {
  .catalog-grid,
  .catalog-grid.grid-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (min-width: 600px) and (max-width: 991px) {
  .catalog-grid,
  .catalog-grid.grid-layout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

/* Tarjetas de Producto - Glassmorphic */
.product-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all var(--transition-smooth);
  position: relative;
  min-width: 0;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  pointer-events: none;
}

.product-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 26px -10px rgba(0, 0, 0, 0.15), var(--shadow-card);
  border-color: rgba(var(--color-primary-h), var(--color-primary-s), var(--color-primary-l), 0.15);
}

.card-img-wrapper {
  width: 100%;
  aspect-ratio: 1;
  max-height: 150px;
  background-color: rgba(0, 0, 0, 0.02);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.product-card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

.card-placeholder-img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
}

.badge-prescription {
  background: linear-gradient(135deg, var(--color-warning) 0%, #d97706 100%);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.2);
}

.badge-low-stock {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 5px;
}

/* Insignias Comerciales Storefront (Ficha Web & Merchandising) */
.badge-promo {
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-oferta {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

.badge-nuevo {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

.badge-destacado {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.badge-mas_vendido {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.detail-promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  text-transform: uppercase;
}

.card-info {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 36px;
  line-height: 1.38;
  text-wrap: pretty;
}

/* Meta información de tarjeta: Categoría y Existencias en Stock */
.product-card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.product-desc-tag,
.product-category-tag {
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
  line-height: 1.25;
}

.product-stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.product-stock-pill .stock-dot {
  font-size: 9px;
  line-height: 1;
}

.product-stock-pill.in-stock {
  color: #10b981;
}

.product-stock-pill.low-stock {
  color: #f59e0b;
}

.product-stock-pill.out-of-stock {
  color: #ef4444;
}

[data-theme="dark"] .product-stock-pill.in-stock {
  color: #34d399;
}

[data-theme="dark"] .product-stock-pill.low-stock {
  color: #fbbf24;
}

[data-theme="dark"] .product-stock-pill.out-of-stock {
  color: #f87171;
}

.card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 2;
  width: 100%;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
}

.product-price {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.2px;
  white-space: nowrap;
  line-height: 1.2;
}

.card-action-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.card-qty-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 9px;
  overflow: hidden;
  height: 32px;
  flex-shrink: 0;
}

.card-qty-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 24px;
  height: 32px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--transition-smooth);
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.card-qty-btn:hover {
  background: var(--color-accent-glow);
}

.card-qty-display {
  font-size: 12.5px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  color: var(--color-text-primary);
  user-select: none;
  padding: 0 2px;
}

/* Botón Agregar a ancho completo */
.add-btn {
  width: 100%;
  height: 35px;
  min-height: 35px;
  background: linear-gradient(135deg, var(--color-accent) 0%, hsl(var(--color-accent-h), var(--color-accent-s), 28%) 100%);
  color: #fff;
  border: none;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 8px var(--color-accent-glow);
  transition: all var(--transition-smooth);
  position: relative;
  z-index: 3;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  white-space: nowrap;
}

.add-btn-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.add-btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-btn-arrow {
  font-size: 13px;
  line-height: 1;
  transition: transform var(--transition-smooth);
}

.add-btn:hover .add-btn-arrow {
  transform: translateX(2px);
}

.add-btn.add-btn-full {
  width: 100%;
  flex: 1;
}

.add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px var(--color-accent-glow);
}

.add-btn:active {
  transform: scale(0.96) translateY(1px);
  box-shadow: 0 2px 6px var(--color-accent-glow);
}

.add-btn.add-btn-success {
  background: #059669 !important;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.4) !important;
}

.add-btn:disabled, .add-btn.out, .add-btn.add-btn-disabled {
  background: var(--color-border);
  color: var(--color-text-secondary);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  font-size: 11px;
}



/* Skeletons */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--color-border) 25%, var(--color-surface) 50%, var(--color-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite linear;
}

.skeleton-card {
  height: 270px;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
}

/* Botón Flotante del Carrito */
.floating-cart-btn {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 500px;
  background: linear-gradient(135deg, var(--color-accent) 0%, hsl(var(--color-accent-h), var(--color-accent-s), 28%) 100%);
  color: #fff;
  border: none;
  padding: 16px 24px;
  border-radius: 9999px;
  box-shadow: 0 10px 30px -5px hsla(var(--color-accent-h), var(--color-accent-s), var(--color-accent-l), 0.4);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  z-index: 200;
  transition: all var(--transition-bounce);
}

.floating-cart-btn:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 15px 35px -5px hsla(var(--color-accent-h), var(--color-accent-s), var(--color-accent-l), 0.5);
}

.floating-cart-btn:active {
  transform: translateX(-50%) scale(0.96);
}

.floating-cart-btn.hidden {
  bottom: -100px;
  opacity: 0;
  pointer-events: none;
}

.cart-btn-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-badge {
  background-color: #fff;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  min-width: 24px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.cart-label {
  flex: 1;
  text-align: left;
  margin-left: 12px;
}

.cart-total {
  font-size: 17px;
  font-weight: 800;
}

/* Bottom Sheet del Carrito - Con soporte de @starting-style de Modern Web Guidance */
.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}

.bottom-sheet-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 580px;
  background-color: var(--color-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  box-shadow: var(--shadow-float);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  z-index: 600;
  border-top: 1px solid var(--color-border);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-sheet-overlay.open .bottom-sheet {
  transform: translateX(-50%) translateY(0);
}

.sheet-header {
  padding: 16px 24px 8px;
  border-bottom: 1px solid var(--color-border);
}

.drag-handle {
  width: 48px;
  height: 5px;
  background-color: var(--color-text-secondary);
  opacity: 0.25;
  border-radius: 9999px;
  margin: 0 auto 16px;
}

.sheet-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-title-row h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.close-sheet-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--color-text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.close-sheet-btn:hover {
  opacity: 1;
}

.sheet-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.cart-items-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Ítems del Carrito */
.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.cart-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cart-item-img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background-color: rgba(0, 0, 0, 0.02);
  object-fit: cover;
}

.cart-item-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary-light);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 4px 6px;
  background-color: rgba(0, 0, 0, 0.02);
}

.qty-btn {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary-light);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.qty-btn:hover {
  background-color: rgba(0,0,0,0.05);
}

.qty-text {
  font-size: 14px;
  font-weight: 700;
  width: 22px;
  text-align: center;
}

.qty-input {
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  width: 44px;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-primary);
  padding: 2px 2px;
  transition: all 0.2s ease;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: var(--color-border);
}

.qty-input:focus {
  outline: none;
  background-color: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-h), var(--color-primary-s), var(--color-primary-l), 0.2);
}

.delete-item-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-danger);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: all 0.2s;
}

.delete-item-btn:hover {
  opacity: 1;
  transform: scale(1.05);
}

.sheet-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--color-border);
  background-color: rgba(0, 0, 0, 0.01);
}

.sheet-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.sheet-total-row .total-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-accent);
}

.sheet-checkout-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px -3px hsla(var(--color-primary-h), var(--color-primary-s), var(--color-primary-l), 0.3);
  transition: all var(--transition-smooth);
}

.sheet-checkout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -3px hsla(var(--color-primary-h), var(--color-primary-s), var(--color-primary-l), 0.4);
}

.sheet-checkout-btn:active {
  transform: translateY(1px);
}

/* View Checkout */
.checkout-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background-color: var(--color-surface);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.checkout-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.back-btn {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary-light);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.back-btn:hover {
  background-color: rgba(0,0,0,0.03);
}

.checkout-main {
  padding: 20px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.order-summary-box h3 {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-secondary);
}

.summary-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.summary-item-row .qty-name {
  color: var(--color-text-primary);
  font-weight: 500;
}

.summary-item-row .price {
  font-weight: 700;
}

.summary-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 14px 0;
}

.summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.summary-total-row span:first-child {
  font-size: 15px;
}

.summary-total-row .total-price {
  font-size: 20px;
  color: var(--color-accent);
}

/* Formulario */
.checkout-form {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.form-group input, .form-group textarea {
  background-color: rgba(0, 0, 0, 0.02);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  transition: all var(--transition-smooth);
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--color-primary);
  background-color: var(--color-surface);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-group textarea {
  min-height: 90px;
  resize: vertical;
}

.error-msg {
  font-size: 12px;
  color: var(--color-danger);
  font-weight: 500;
  margin-top: 2px;
}

/* Botones de Selección de Método de Pago */
.radio-group {
  display: flex;
  gap: 12px;
}

.radio-label {
  flex: 1;
  cursor: pointer;
}

.radio-label input {
  display: none;
}

.radio-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  text-align: center;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.01);
  transition: all var(--transition-smooth);
}

.radio-tile:hover {
  border-color: var(--color-primary-light);
  background-color: rgba(0, 0, 0, 0.02);
}

.radio-tile .radio-icon {
  font-size: 24px;
}

.radio-tile .radio-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.radio-label input:checked + .radio-tile {
  border-color: var(--color-accent);
  background-color: var(--color-accent-glow);
  box-shadow: 0 4px 12px rgba(var(--color-accent-h), var(--color-accent-s), var(--color-accent-l), 0.1);
}

.radio-label input:checked + .radio-tile .radio-text {
  color: var(--color-text-primary);
}

.pharmacy-alert-note {
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--color-warning);
  color: #d97706;
  padding: 14px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
}

.error-banner {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
  padding: 14px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 600;
}

/* Botón Enviar Pedido */
.submit-order-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--color-accent) 0%, hsl(var(--color-accent-h), var(--color-accent-s), 28%) 100%);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px var(--color-accent-glow);
  transition: all var(--transition-smooth);
}

.submit-order-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px var(--color-accent-glow);
}

.submit-order-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* View Success */
#view-success {
  background-color: var(--color-bg);
}

.success-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  height: 100vh;
}

.success-icon-container {
  margin-bottom: 30px;
}

/* Checkmark animado */
.checkmark {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: var(--color-accent);
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px var(--color-accent);
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--color-accent);
  fill: none;
  animation: stroke .6s cubic-bezier(0.650, 0.000, 0.450, 1.000) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke .3s cubic-bezier(0.650, 0.000, 0.450, 1.000) .8s forwards;
}

@keyframes scale {
  0%, 100% { transform: none; }
  50% { transform: scale3d(1.1, 1.1, 1); }
}

#success-order-id {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.success-sub {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: 40px;
  max-width: 300px;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 320px;
}

.whatsapp-btn {
  background: linear-gradient(135deg, #25D366 0%, #128c7e 100%);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.25);
  transition: all var(--transition-smooth);
}

.whatsapp-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.35);
}

.reset-btn {
  background-color: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  padding: 14px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.reset-btn:hover {
  border-color: var(--color-primary-light);
  color: var(--color-text-primary);
  background-color: rgba(0, 0, 0, 0.02);
}

/* Animaciones y utilidades globales */
.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .view, .bottom-sheet, .bottom-sheet-overlay, .theme-toggle-btn, .product-card, .add-btn, .floating-cart-btn, .submit-order-btn, .whatsapp-btn {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* ═══════════════════════════════════════════════════════
   DISEÑO ADICIONAL — REDISEÑO SÓLIDO PREMIUM
   ═══════════════════════════════════════════════════════ */

/* Vista de Lista Compacta */
.catalog-grid.list-layout {
  grid-template-columns: 1fr;
  gap: 12px;
}

.catalog-grid.list-layout .product-card {
  flex-direction: row;
  align-items: center;
  padding: 12px;
  height: auto;
}

.catalog-grid.list-layout .product-card .card-img-wrapper {
  width: 90px;
  height: 90px;
  aspect-ratio: 1;
  border-radius: 14px;
  flex-shrink: 0;
}

.catalog-grid.list-layout .product-card .card-info {
  padding: 0 14px;
  justify-content: center;
  flex: 1;
}

.catalog-grid.list-layout .product-card .product-name {
  height: auto;
  margin-bottom: 4px;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-height: 1.3;
}

.catalog-grid.list-layout .product-card .product-desc-tag {
  margin-bottom: 6px;
}

.catalog-grid.list-layout .product-card .card-footer {
  margin-top: 0;
  width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.catalog-grid.list-layout .product-card .card-price-row {
  width: auto;
}

.catalog-grid.list-layout .product-card .card-action-row {
  width: auto;
  flex-shrink: 0;
}

.catalog-grid.list-layout .product-card .product-card-desc {
  -webkit-line-clamp: 1;
  margin-bottom: 4px;
}

.catalog-grid.list-layout .product-card::before {
  display: none; /* Quita degradados internos en lista */
}

/* Barra de Búsqueda con Acciones Flotantes */
.search-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.search-tools-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.filter-toggle-btn, .view-layout-btn {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  height: 42px;
  padding: 0 12px;
  white-space: nowrap;
  transition: all var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.filter-toggle-btn:hover, .view-layout-btn:hover {
  border-color: var(--color-primary-light);
  color: var(--color-text-primary);
  transform: translateY(-1px);
}

.filter-toggle-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
}

@media (max-width: 480px) {
  .search-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .search-box {
    width: 100%;
    flex: 100%;
  }
  .search-tools-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .filter-toggle-btn, .view-layout-btn {
    width: 100%;
    justify-content: center;
    height: 38px;
    font-size: 12px;
  }
}

/* Panel de Filtros Rápidos (Tallas y Precios) */
.filter-panel {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-top: 10px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  max-height: 500px;
  opacity: 1;
}

.filter-panel.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  opacity: 0;
  border-color: transparent;
  pointer-events: none;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.size-filters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.size-btn {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.size-btn:hover {
  border-color: var(--color-primary-light);
  color: var(--color-text-primary);
}

.size-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
}

.price-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-range-inputs input {
  width: 90px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border 0.2s;
}

.price-range-inputs input:focus {
  border-color: var(--color-primary);
}

.range-divider {
  color: var(--color-text-secondary);
}

.clear-filters-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  margin-left: auto;
  transition: all 0.2s;
}

.clear-filters-btn:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* Modales Base (Overlay y Contenido) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(9, 13, 22, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  box-shadow: var(--shadow-float);
  width: 100%;
  max-width: 480px;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  position: relative;
}

.modal-overlay.open .modal-content {
  transform: scale(1);
}

.close-modal-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-size: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
}

.close-modal-btn:hover {
  background-color: var(--color-border);
  transform: scale(1.05);
}

/* Modal Detalle de Producto (PDP) - E-commerce */
.pdp-modal {
  max-width: 520px;
  border-radius: 24px;
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.pdp-body {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: calc(92vh - 20px);
  -webkit-overflow-scrolling: touch;
}

.pdp-gallery-col {
  position: relative;
  width: 100%;
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
}

.pdp-gallery-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .pdp-gallery-viewport {
  background-color: rgba(255, 255, 255, 0.02);
}

.pdp-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 5;
  user-select: none;
}

.gallery-nav-btn:hover {
  background: rgba(15, 23, 42, 0.85);
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav-btn.prev-btn {
  left: 10px;
}

.gallery-nav-btn.next-btn {
  right: 10px;
}

.pdp-thumbnails-strip {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  padding: 10px 14px;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.pdp-thumbnail {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--color-bg);
  opacity: 0.6;
  transition: all 0.2s;
  padding: 0;
  display: flex;
}

.pdp-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-thumbnail.active {
  opacity: 1;
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px var(--color-accent-glow);
  transform: scale(1.05);
}

.pdp-thumbnail:hover {
  opacity: 1;
}

.pdp-info-col {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
}

/* Breadcrumbs */
.pdp-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.pdp-breadcrumb-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary-light);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  transition: color 0.15s;
}

.pdp-breadcrumb-link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.pdp-breadcrumb-sep {
  opacity: 0.4;
}

.pdp-breadcrumb-current {
  font-weight: 600;
  color: var(--color-text-primary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdp-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.detail-urgency-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.35);
  animation: pulseUrgency 2s infinite ease-in-out;
}

[data-theme="dark"] .detail-urgency-badge {
  color: #fbbf24;
}

@keyframes pulseUrgency {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.pdp-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 10px 0 12px;
}

.pdp-price-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-secondary);
}

.pdp-price-wrap .detail-price {
  font-size: 26px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--color-primary);
}

[data-theme="dark"] .pdp-price-wrap .detail-price {
  color: var(--color-primary-light);
}

.detail-badge {
  display: inline-block;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.detail-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  display: block;
}

.detail-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  max-height: 120px;
  overflow-y: auto;
}

.detail-stock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.stock-label {
  color: var(--color-text-secondary);
}

.stock-status {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
}

.stock-status.in-stock {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.stock-status.low-stock {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.stock-status.out-of-stock {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.detail-divider {
  height: 1px;
  background-color: var(--color-border);
  margin-bottom: 16px;
}

/* Dual CTA */
.pdp-cta-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.pdp-primary-action-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.pdp-primary-action-row .quantity-selector {
  flex-shrink: 0;
}

.pdp-primary-action-row .add-to-cart-large-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
}

.quantity-selector {
  display: flex;
  align-items: center;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  height: 44px;
}

.quantity-selector .qty-btn {
  background: none;
  border: none;
  width: 36px;
  height: 100%;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  transition: background-color 0.2s;
}

.quantity-selector .qty-btn:hover {
  background-color: var(--color-border);
}

.quantity-selector .qty-text {
  padding: 0 12px;
  font-weight: 700;
  font-size: 15px;
  min-width: 30px;
  text-align: center;
  color: var(--color-text-primary);
}

.add-to-cart-large-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--color-accent) 0%, hsl(var(--color-accent-h), var(--color-accent-s), 28%) 100%);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--color-accent-glow);
  transition: all var(--transition-smooth);
  font-family: inherit;
}

.add-to-cart-large-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--color-accent-glow);
}

.add-to-cart-large-btn:disabled {
  background: var(--color-border);
  color: var(--color-text-secondary);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}



/* Modal Historial de Pedidos */
.orders-modal {
  max-width: 500px;
}

.orders-modal .modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.orders-modal .modal-body {
  padding: 20px 24px 28px;
  max-height: 70vh;
  overflow-y: auto;
}

.history-intro {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

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

.no-orders-msg {
  text-align: center;
  color: var(--color-text-secondary);
  padding: 30px;
  font-size: 14px;
  border: 1px dashed var(--color-border);
  border-radius: 12px;
}

.order-history-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s;
}

.order-history-card:hover {
  border-color: var(--color-primary-light);
}

.order-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.order-history-id {
  font-weight: 700;
  color: var(--color-text-primary);
  font-size: 13px;
}

.order-history-date {
  color: var(--color-text-secondary);
}

.order-history-details {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.order-history-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
  margin-top: 10px;
}

.order-history-total {
  font-weight: 800;
  color: var(--color-primary);
  font-size: 14px;
}

.order-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.order-status-badge.pending {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.order-status-badge.confirmed {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.order-status-badge.delivered {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.order-status-badge.cancelled {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ═══════════════════════════════════════════════════════
   DISEÑO CHECKOUT WIZARD
   ═══════════════════════════════════════════════════════ */
.wizard-progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  position: relative;
  padding: 0 10px;
}

.wizard-step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
  position: relative;
}

.wizard-step-indicator .step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.3s;
}

.wizard-step-indicator.active .step-num {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--color-accent-glow);
}

.wizard-step-indicator.completed .step-num {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.wizard-step-indicator .step-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wizard-step-indicator.active .step-label {
  color: var(--color-primary);
}

.wizard-progress-line {
  flex: 1;
  height: 2px;
  background-color: var(--color-border);
  margin-top: -16px; /* Alinear verticalmente con el círculo */
  position: relative;
}

.progress-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background-color: var(--color-accent);
  transition: width 0.3s ease;
}

.wizard-step-pane {
  display: none;
  animation: fadeInPane 0.25s ease-in-out forwards;
}

.wizard-step-pane.active {
  display: block;
}

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.wizard-actions-row {
  display: flex;
  align-items: center;
  margin-top: 28px;
  gap: 12px;
}

.wizard-btn-primary {
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.wizard-btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.wizard-btn-secondary {
  background-color: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.wizard-btn-secondary:hover {
  border-color: var(--color-text-primary);
  color: var(--color-text-primary);
}

/* Banner de Puntos de Fidelización */
.loyalty-points-banner {
  background-color: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.loyalty-points-banner .loyalty-icon {
  font-size: 18px;
}

.loyalty-points-banner .loyalty-text {
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
}

[data-theme="dark"] .loyalty-points-banner .loyalty-text {
  color: #818cf8;
}

.payment-instructions-box {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 16px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.instructions-header {
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.bank-qr-placeholder {
  border: 2px dashed var(--color-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-top: 12px;
}

.qr-placeholder-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 6px;
}

/* ═══════════════════════════════════════════════════════
   MEJORAS PARA PC / ESCRITORIO Y ADAPTACIÓN MULTI-NEGOCIO
   ═══════════════════════════════════════════════════════ */

/* Botón de Carrito en Cabecera (Desktop / Tablet) */
.header-cart-btn {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  height: 38px;
  padding: 0 14px;
  transition: all var(--transition-smooth);
}

.header-cart-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.header-cart-badge {
  background-color: var(--color-accent);
  color: #fff;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}

/* Modalidad de Entrega (Paso 2 del Checkout) */
.delivery-type-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.delivery-radio-label {
  cursor: pointer;
  position: relative;
  display: block;
}

.delivery-radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.delivery-radio-tile {
  background-color: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 14px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  transition: all var(--transition-smooth);
  height: 100%;
}

.delivery-radio-label input[type="radio"]:checked + .delivery-radio-tile {
  border-color: var(--color-primary);
  background-color: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.delivery-icon {
  font-size: 22px;
}

.delivery-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-primary);
  display: block;
}

.delivery-sub {
  font-size: 10px;
  color: var(--color-text-secondary);
  line-height: 1.2;
}

/* Banner de Retiro en Tienda */
.pickup-info-banner {
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}

.pickup-banner-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.pickup-address-text {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* Agendamiento de Citas / Horario */
.appointment-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

.appointment-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.appointment-field .field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.date-input, .time-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 13px;
  transition: all var(--transition-smooth);
}

.date-input:focus, .time-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

/* Selector de Variantes / Tallas en Modal de Detalle */
.detail-variant-container {
  margin: 14px 0;
}

.detail-variant-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  display: block;
  margin-bottom: 8px;
}

.variant-options-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-pill {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.variant-pill:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.variant-pill.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--color-accent-glow);
}

.variant-pill.pill-out-of-stock {
  opacity: 0.55;
  border-style: dashed;
  text-decoration: line-through;
  background-color: rgba(239, 68, 68, 0.05);
}

/* Notas de Cocina / Especiales en Detalle */
.detail-special-notes-container {
  margin: 14px 0;
}

.special-notes-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  display: block;
  margin-bottom: 6px;
}

.special-notes-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 13px;
  transition: all var(--transition-smooth);
}

.special-notes-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

/* Badges en ítems del Carrito */
.cart-item-variant-badge {
  display: inline-block;
  background-color: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  margin-top: 2px;
}

[data-theme="dark"] .cart-item-variant-badge {
  background-color: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
}

.cart-item-instructions-tag {
  display: block;
  font-size: 11px;
  color: var(--color-text-secondary);
  font-style: italic;
  margin-top: 2px;
}

/* Subtítulos en Resumen de Checkout */
.qty-name-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-item-variant {
  font-size: 11px;
  color: #7c3aed;
  font-weight: 600;
}

.summary-item-note {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Botón Copiar Resumen en Pantalla de Éxito */
.copy-order-btn {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-smooth);
}

.copy-order-btn:hover {
  border-color: var(--color-primary);
  background-color: var(--color-bg);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════
   OPTIMIZACIÓN RESPONSIVE PARA ESCRITORIO / PC (>= 992px)
   ═══════════════════════════════════════════════════════ */
@media (min-width: 992px) {
  /* Mostrar botón de carrito en la cabecera */
  .header-cart-btn {
    display: flex;
  }

  /* Ocultar botón flotante en PC para dejar espacio limpio */
  .floating-cart-btn {
    display: none !important;
  }

  /* Contenedor principal más amplio en monitores */
  #app {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 20px 60px 20px;
  }

  .app-header {
    padding: 36px 32px;
    border-radius: 28px;
    margin-bottom: 24px;
  }

  .store-title {
    font-size: 32px;
  }

  /* Grid de Productos en PC: 3 a 4 columnas elegantes */
  .catalog-grid.grid-layout {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
  }

  .product-card {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.12);
  }

  .product-card .card-img-wrapper {
    max-height: 200px;
    aspect-ratio: 1.1;
  }

  .product-card .card-placeholder-img {
    width: 64px;
    height: 64px;
    font-size: 26px;
    border-radius: 18px;
  }

  .product-card .card-info {
    padding: 16px;
  }

  .product-card .product-name {
    font-size: 15px;
    height: 44px;
    line-height: 1.45;
  }

  .product-card .product-price {
    font-size: 18px;
  }

  .product-card .add-btn {
    padding: 8px 16px;
    font-size: 13px;
    min-height: 38px;
    height: 38px;
  }

  .product-card .card-qty-wrap {
    height: 38px;
  }

  .product-card .card-qty-btn {
    height: 38px;
    width: 28px;
  }

  /* Carrito en PC: Drawer Lateral Derecho en lugar de Bottom Sheet */
  .bottom-sheet-overlay {
    display: flex;
    justify-content: flex-end;
  }

  .bottom-sheet {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto !important;
    width: 440px !important;
    max-width: 90vw;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 24px 0 0 24px !important;
    transform: translateX(100%) !important;
    box-shadow: -15px 0 45px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
  }

  .bottom-sheet-overlay.open .bottom-sheet {
    transform: translateX(0) !important;
  }

  .sheet-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  .cart-items-container {
    flex: 1;
    max-height: none;
    padding: 16px 20px;
  }

  /* Header en PC */
  .store-cover-banner {
    height: 150px;
    border-radius: 20px 20px 0 0;
  }

  .header-content-wrapper {
    padding: 0 28px;
    margin-top: -42px;
  }

  .store-avatar-container {
    width: 80px;
    height: 80px;
    border-radius: 22px;
    border-width: 4px;
  }

  .store-avatar-placeholder {
    font-size: 34px;
  }

  .store-contact-meta {
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }

  /* Modal PDP en PC: 2 columnas completas */
  .modal-content.product-modal.pdp-modal {
    max-width: 880px !important;
    width: 880px;
    border-radius: 28px;
    overflow: hidden;
  }

  .modal-content.product-modal.pdp-modal .pdp-body {
    display: grid !important;
    grid-template-columns: 390px 1fr !important;
    max-height: 85vh;
    overflow: hidden;
  }

  .modal-content.product-modal.pdp-modal .pdp-gallery-col {
    padding: 24px;
    background-color: var(--color-bg);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: flex-start;
  }

  .modal-content.product-modal.pdp-modal .pdp-gallery-viewport {
    border-radius: 16px;
    aspect-ratio: 1 / 1;
  }

  .modal-content.product-modal.pdp-modal .pdp-thumbnails-strip {
    background: transparent;
    border-top: none;
    padding: 0;
  }

  .modal-content.product-modal.pdp-modal .pdp-info-col {
    padding: 28px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    max-height: 85vh;
  }

  .modal-content.product-modal.pdp-modal .pdp-breadcrumb-current {
    max-width: 260px;
  }

  /* Modal de Historial de Pedidos en PC */
  .modal-content.orders-modal {
    max-width: 640px;
  }

  /* Vista Checkout en PC */
  .checkout-main {
    max-width: 680px;
    margin: 0 auto;
    background-color: var(--color-surface);
    padding: 32px 36px;
    border-radius: 24px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
  }
}

/* ==========================================================================
   Componente Anti-Bot CAPTCHA (Checkout Seguro)
   ========================================================================== */
.captcha-group {
  margin-top: 18px;
  margin-bottom: 6px;
}

.captcha-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--color-surface-hover, rgba(255, 255, 255, 0.04));
  border: 1.5px solid var(--color-border);
  padding: 8px 12px;
  border-radius: var(--radius-md, 12px);
  transition: border-color var(--transition-fast, 0.2s);
}

.captcha-card:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.captcha-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  user-select: none;
  flex-shrink: 0;
}

.captcha-icon {
  font-size: 16px;
}

.captcha-question {
  font-family: 'Outfit', 'Inter', monospace;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--color-primary-text, #6366f1);
}

.btn-captcha-refresh {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  line-height: 1;
  opacity: 0.7;
  transition: transform 0.2s, opacity 0.2s;
}

.btn-captcha-refresh:hover {
  opacity: 1;
  transform: rotate(45deg);
}

.captcha-input {
  flex: 1;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  outline: none;
  padding: 6px 4px;
  min-width: 80px;
}

.captcha-input::placeholder {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 13px;
}

/* ==========================================================================
   VISOR UNIVERSAL DE RECIBOS DIGITALES — VENDLYPOS (ESTÁNDAR SVFE)
   ========================================================================== */

.receipt-page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 14px 48px;
  position: relative;
  z-index: 10;
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
}

.receipt-actions-bar {
  width: 100%;
  max-width: 440px;
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  position: sticky;
  top: 14px;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.receipt-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.receipt-btn:active {
  transform: scale(0.97);
}

.receipt-btn-pdf {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.receipt-btn-pdf:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
}

.receipt-btn-wa {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

.receipt-btn-wa:hover {
  background: linear-gradient(135deg, #20ba59 0%, #0e7266 100%);
  transform: translateY(-1px);
}

.receipt-btn-print {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.receipt-btn-print:hover {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.2);
  transform: translateY(-1px);
}

/* Tarjeta Principal del Ticket (80mm) */
.receipt-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.1), 0 4px 16px -2px rgba(0, 0, 0, 0.04);
  padding: 24px 22px 30px;
  position: relative;
  overflow: hidden;
  animation: receiptFadeIn 0.35s ease-out;
}

@keyframes receiptFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 1. Encabezado del Emisor */
.receipt-header {
  text-align: center;
  margin-bottom: 12px;
}

.receipt-avatar-circle {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  margin: 0 auto 10px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
}

.receipt-store-title {
  font-family: 'Outfit', sans-serif;
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.receipt-store-meta {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}

.receipt-store-meta-line {
  margin-top: 2px;
}

.receipt-tax-row-inline {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
}

/* Separadores con muescas */
.receipt-cutout-divider {
  position: relative;
  margin: 12px -22px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.receipt-cutout-left,
.receipt-cutout-right {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-bg, #f8fafc);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
  position: relative;
  z-index: 2;
}

.receipt-cutout-left {
  margin-left: -9px;
}

.receipt-cutout-right {
  margin-right: -9px;
}

.receipt-cutout-line {
  flex: 1;
  border-top: 1px dashed #cbd5e1;
  margin: 0 4px;
}

/* 2. Sección de Datos de Emisión y Documento DTE */
.receipt-doc-meta-section {
  text-align: center;
}

.receipt-meta-datetime {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.receipt-doc-title-box {
  margin: 6px 0;
}

.receipt-doc-type {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

.receipt-doc-uuid {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  word-break: break-all;
  margin-top: 3px;
}

.receipt-fiscal-contingencia {
  font-size: 11px;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 5px 8px;
  margin: 6px 0;
  display: block;
}

.receipt-pos-operator-line {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  padding: 3px 0;
}

/* 3. Lista de Artículos */
.receipt-items-section {
  margin: 8px 0;
}

.receipt-items-list {
  display: flex;
  flex-direction: column;
}

.receipt-item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.receipt-item-row:last-child {
  border-bottom: none;
}

.receipt-item-details {
  flex: 1;
  padding-right: 10px;
}

.receipt-item-name {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.receipt-item-calc {
  font-size: 11.5px;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

.receipt-item-total {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  font-size: 13.5px;
}

.receipt-tax-indicator {
  font-size: 10px;
  color: #64748b;
  margin-left: 2px;
}

/* 4. Resumen de Totales y Liquidación */
.receipt-totals-box {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.receipt-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: #475569;
}

.receipt-total-line .val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #0f172a;
}

.receipt-total-highlight {
  margin-top: 4px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.receipt-total-highlight .label {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.receipt-total-highlight .amount {
  font-family: 'Outfit', 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: -0.5px;
}

.receipt-change-box {
  margin-top: 6px;
  padding: 8px 12px;
  background: #ecfdf5;
  border-radius: 10px;
  border: 1px solid #a7f3d0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #065f46;
}

.receipt-change-box .label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.receipt-change-box .change-amt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 800;
  color: #059669;
}

/* 5. Datos del Cliente / Receptor */
.receipt-customer-section {
  margin-top: 10px;
}

.receipt-section-subtitle {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #475569;
  text-align: center;
  margin-bottom: 6px;
}

.receipt-customer-details {
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.receipt-cust-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11.5px;
  gap: 6px;
}

.receipt-cust-line .lbl {
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.receipt-cust-line .val {
  font-weight: 600;
  color: #0f172a;
  text-align: right;
  word-break: break-all;
}

/* 6. Resolución y Control Fiscal */
.receipt-fiscal-box,
.receipt-resolution-section {
  margin-top: 10px;
}

.receipt-resolution-text {
  font-size: 10.5px;
  color: #64748b;
  text-align: center;
  line-height: 1.45;
}

.receipt-sello-line {
  word-break: break-all;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: #475569;
  margin-top: 3px;
}

.receipt-tax-legend {
  font-size: 9.5px;
  letter-spacing: 0.3px;
  color: #94a3b8;
  margin-top: 6px;
  font-weight: 600;
}

/* 7. Pie y Código QR al fondo */
.receipt-footer {
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}

.receipt-footer-msg {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.receipt-contact-line {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
}

.receipt-validation-title {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

.receipt-qr-wrapper {
  margin: 6px auto 10px;
}

.receipt-fiscal-qr {
  margin: 6px auto;
  display: flex;
  justify-content: center;
}

.receipt-fiscal-qr img,
.receipt-fiscal-qr canvas {
  max-width: 126px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  padding: 4px;
  background: #ffffff;
}

.receipt-fiscal-link {
  display: inline-block;
  font-size: 11px;
  color: #2563eb;
  font-weight: 600;
  text-decoration: underline;
  margin-top: 4px;
}

.receipt-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 4px 12px;
  border-radius: 9999px;
}

/* Estado Vacío / Sin Comprobante */
.receipt-empty-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.09);
  padding: 36px 24px;
  text-align: center;
  animation: receiptFadeIn 0.35s ease-out;
}

.receipt-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.receipt-empty-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.receipt-empty-desc {
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 20px;
}

.receipt-demo-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.receipt-btn-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #2563eb;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.receipt-btn-demo:hover {
  background: #1d4ed8;
}

.receipt-btn-demo-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.receipt-btn-demo-secondary:hover {
  background: #e2e8f0;
}

/* Toast de Notificación */
.receipt-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.receipt-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Estilos de Impresión Nativa (Térmica 80mm Oficial) */
@media print {
  @page {
    size: 80mm auto;
    margin: 0;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .receipt-page-wrapper {
    padding: 0 !important;
  }

  .receipt-actions-bar,
  .receipt-empty-card,
  .receipt-toast,
  .glow-sphere,
  .noscript-banner,
  .receipt-fiscal-link,
  .receipt-verified-badge {
    display: none !important;
  }

  .receipt-card {
    max-width: 100% !important;
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 2mm 1mm !important;
    margin: 0 !important;
    color: #000000 !important;
  }

  .receipt-card * {
    color: #000000 !important;
  }

  .receipt-cutout-left,
  .receipt-cutout-right {
    display: none !important;
  }

  .receipt-cutout-line {
    border-top: 1px dashed #000000 !important;
  }

  .receipt-avatar-circle {
    display: none !important;
  }

  .receipt-store-title {
    color: #000000 !important;
    font-size: 18px !important;
  }

  .receipt-doc-uuid {
    color: #000000 !important;
  }

  .receipt-total-highlight {
    border-top: 1px solid #000000 !important;
    border-bottom: 1px solid #000000 !important;
    border-left: none !important;
    border-right: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 4px 0 !important;
  }

  .receipt-total-highlight .amount {
    color: #000000 !important;
  }

  .receipt-change-box {
    border: none !important;
    background: transparent !important;
    padding: 3px 0 !important;
  }

  .receipt-change-box .change-amt {
    color: #000000 !important;
  }

  .receipt-customer-details {
    background: transparent !important;
    border: 1px dashed #000000 !important;
    border-radius: 0 !important;
    padding: 2mm !important;
  }

  .receipt-fiscal-contingencia {
    border: 1px solid #000000 !important;
    background: transparent !important;
    color: #000000 !important;
  }

  .receipt-fiscal-box,
  .receipt-resolution-section {
    page-break-inside: avoid !important;
  }

  .receipt-fiscal-qr {
    margin: 2mm auto !important;
  }

  .receipt-fiscal-qr img,
  .receipt-fiscal-qr canvas {
    max-width: 110px !important;
    height: auto !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}



