/* ==========================================================================
   OrigenXport B2B Marketplace - Gourmet Multi-brand Wholesale Catalog CSS
   Paleta Oficial: #E5CDA7 · #93B288 · #D8EAD5 · #373131 · #472130
   Atmósfera Luminosa, Tono Claro Imperante y Diseño Gourmet B2B
   ========================================================================== */

:root {
  /* --- PALETA OFICIAL --- */
  --pal-sand: #E5CDA7;           /* Arena dorada / Champagne cálido */
  --pal-sand-light: #F7EFE1;     /* Arena marfil suave */
  --pal-sand-dark: #C9AD81;      /* Arena dorada tostada */

  --pal-sage: #93B288;           /* Verde salvia / Oliva suave */
  --pal-sage-dark: #76976A;      /* Verde salvia profundo para botones/hover */
  --pal-sage-light: #B8D1B0;     /* Salvia pastel */

  --pal-mint-light: #D8EAD5;     /* Verde menta suave (Tono claro imperante) */
  --pal-mint-subtle: #EDF6EB;    /* Verde bruma muy claro */

  --pal-charcoal: #373131;       /* Carbón café oscuro (Texto principal & alto contraste) */
  --pal-charcoal-light: #5A5252;  /* Carbón secundario legible */
  --pal-charcoal-muted: #7E7474;  /* Carbón atenuado / metadatos */

  --pal-wine: #472130;           /* Vino tinto noble / Burdeos gourmet */
  --pal-wine-hover: #5F2C41;     /* Vino iluminado hover */
  --pal-wine-soft: rgba(71, 33, 48, 0.08); /* Tinte vino sutil */

  /* --- SISTEMA DE SUPERFICIES Y FONDOS CLAROS --- */
  --bg-dark: #F5F8F4;            /* Fondo base claro */
  --bg-surface: #FFFFFF;         /* Superficie pura para tarjetas y modales */
  --bg-card: #FFFFFF;
  --bg-card-hover: #FAFCF9;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-glass-strong: rgba(255, 255, 255, 0.98);

  /* --- BORDES REFINADOS --- */
  --panel-border: rgba(147, 178, 136, 0.32);
  --panel-border-hover: var(--pal-sage);
  --panel-border-gold: rgba(201, 173, 129, 0.7);
  --panel-border-wine: rgba(71, 33, 48, 0.28);

  /* --- COLORES DE ACCIÓN --- */
  --color-gold: var(--pal-sand-dark);
  --color-gold-light: var(--pal-sand);
  --color-emerald: var(--pal-sage);
  --color-emerald-dark: var(--pal-sage-dark);
  --color-wine: var(--pal-wine);
  --color-sapphire: #5B88A5;
  --color-ruby: #C0392B;

  /* --- TIPOGRAFÍA (MÁXIMA LEGIBILIDAD EN FONDO CLARO) --- */
  --text-primary: var(--pal-charcoal);
  --text-secondary: var(--pal-charcoal-light);
  --text-muted: var(--pal-charcoal-muted);
  --text-gold: var(--pal-wine);
  --text-inverse: #FFFFFF;

  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* --- SOMBRAS SUAVES Y ELEGANTES --- */
  --shadow-sm: 0 2px 8px rgba(55, 49, 49, 0.05);
  --shadow-md: 0 8px 24px rgba(55, 49, 49, 0.08);
  --shadow-lg: 0 16px 40px rgba(55, 49, 49, 0.12);
  --shadow-glow-emerald: 0 0 20px rgba(147, 178, 136, 0.35);
  --shadow-glow-gold: 0 0 25px rgba(229, 205, 167, 0.5);
  --shadow-glow-wine: 0 0 20px rgba(71, 33, 48, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #F6F9F5;
  background-image: 
    radial-gradient(circle at 10% 12%, rgba(216, 234, 213, 0.75) 0%, transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(229, 205, 167, 0.5) 0%, transparent 40%),
    radial-gradient(circle at 50% 85%, rgba(216, 234, 213, 0.6) 0%, transparent 50%),
    linear-gradient(180deg, #F9FAF7 0%, #EEF4ED 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- CONTENEDORES Y REGLAS BASE --- */
.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  border-color: rgba(147, 178, 136, 0.5);
  box-shadow: var(--shadow-md);
}

/* --- HEADER B2B --- */
.b2b-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 2px 14px rgba(55, 49, 49, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  gap: 1.5rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.brand-logo {
  height: 38px;
  width: auto;
  display: block;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(229, 205, 167, 0.28);
  border: 1px solid var(--pal-sand-dark);
  color: var(--pal-wine);
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-badge::before {
  content: "•";
  color: var(--pal-sage);
  font-size: 1.2rem;
  line-height: 0;
}

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

/* Botón Solicitud de Pedido (Estilo Gourmet Ejecutivo) */
.btn-order-drawer {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--pal-wine), var(--pal-wine-hover));
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(71, 33, 48, 0.28);
  transition: all 0.25s ease;
}

.btn-order-drawer:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(71, 33, 48, 0.38);
}

.cart-count-badge {
  background: var(--pal-sand);
  color: var(--pal-wine);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 800;
}

.btn-admin-link {
  background: rgba(147, 178, 136, 0.12);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-admin-link:hover {
  color: var(--pal-wine);
  background: var(--pal-mint-light);
  border-color: var(--pal-sage);
}

.btn-logout-buyer {
  background: transparent;
  border: 1px solid rgba(71, 33, 48, 0.3);
  color: var(--pal-wine);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout-buyer:hover {
  background: rgba(71, 33, 48, 0.08);
}

/* Selector de Idiomas Bilingüe ES / EN */
.lang-switch-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(229, 205, 167, 0.25);
  border: 1px solid var(--pal-sand-dark);
  border-radius: var(--radius-full);
  padding: 3px 6px;
  box-shadow: 0 1px 4px rgba(55, 49, 49, 0.05);
}

.lang-switch-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 4px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.04em;
}

.lang-switch-btn:hover {
  color: var(--pal-wine);
}

.lang-switch-btn.active {
  background: var(--pal-wine);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(71, 33, 48, 0.25);
}

.lang-switch-divider {
  color: var(--pal-sand-dark);
  font-size: 0.75rem;
  user-select: none;
  opacity: 0.6;
}

/* --- HERO B2B MARKETPLACE --- */
.marketplace-hero {
  padding: 2.5rem 0 1.5rem 0;
  position: relative;
}

.hero-banner {
  padding: 2.5rem;
  background: linear-gradient(135deg, #FFFFFF 0%, rgba(216, 234, 213, 0.5) 50%, rgba(229, 205, 167, 0.32) 100%);
  border: 1px solid rgba(147, 178, 136, 0.35);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(55, 49, 49, 0.06);
}

.hero-banner::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(229, 205, 167, 0.45) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pal-wine);
  background: rgba(71, 33, 48, 0.07);
  border: 1px solid rgba(71, 33, 48, 0.18);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.85rem;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--pal-charcoal);
  line-height: 1.22;
}

.hero-title span {
  color: var(--pal-wine);
  background: linear-gradient(90deg, var(--pal-wine) 0%, #683047 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 780px;
  line-height: 1.6;
}

.hero-stats-row {
  display: flex;
  gap: 2rem;
  margin-top: 1.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(147, 178, 136, 0.25);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  font-size: 1.6rem;
  background: rgba(216, 234, 213, 0.5);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid rgba(147, 178, 136, 0.3);
}

.stat-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pal-charcoal);
}

.stat-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --- BARRA DE CONTROL & FILTROS --- */
.controls-section {
  margin: 1.5rem 0 2rem 0;
}

.controls-card {
  padding: 1.25rem 1.5rem;
  background: #FFFFFF;
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-sm);
}

.controls-top-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.search-box-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 480px;
}

.search-input {
  width: 100%;
  background: var(--pal-mint-subtle);
  border: 1px solid rgba(147, 178, 136, 0.4);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 40px;
  color: var(--pal-charcoal);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  background: #FFFFFF;
  border-color: var(--pal-sage);
  box-shadow: 0 0 0 3px rgba(147, 178, 136, 0.2);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.producer-select-dropdown {
  background: var(--pal-mint-subtle);
  border: 1px solid rgba(147, 178, 136, 0.4);
  color: var(--pal-charcoal);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  max-width: 100%;
}

.producer-select-dropdown:focus {
  border-color: var(--pal-sage);
}

.producer-select-dropdown option {
  background: #FFFFFF;
  color: var(--pal-charcoal);
}

.view-toggle-group {
  display: flex;
  gap: 4px;
  align-items: center;
}

.view-btn {
  background: rgba(147, 178, 136, 0.12);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.view-btn:hover {
  background: var(--pal-mint-light);
  color: var(--pal-charcoal);
}

.view-btn.active {
  background: var(--pal-wine);
  color: #FFFFFF;
  font-weight: 700;
  border-color: var(--pal-wine);
  box-shadow: 0 2px 8px rgba(71, 33, 48, 0.25);
}

/* Categorías Tabs */
.categories-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.categories-filter-row::-webkit-scrollbar {
  height: 4px;
}

.categories-filter-row::-webkit-scrollbar-track {
  background: rgba(216, 234, 213, 0.3);
  border-radius: 4px;
}

.categories-filter-row::-webkit-scrollbar-thumb {
  background: rgba(147, 178, 136, 0.45);
  border-radius: 4px;
}

.cat-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(216, 234, 213, 0.45);
  border: 1px solid rgba(147, 178, 136, 0.35);
  color: var(--pal-charcoal);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.cat-pill-btn:hover {
  background: var(--pal-mint-light);
  color: var(--pal-wine);
  border-color: var(--pal-sage);
}

.cat-pill-btn.active {
  background: linear-gradient(135deg, var(--pal-wine), var(--pal-wine-hover));
  border-color: var(--pal-wine);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(71, 33, 48, 0.2);
}

/* --- PRODUCTORES BANNER / STRIP --- */
.producers-strip {
  margin-bottom: 2rem;
}

.producers-strip-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pal-wine);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.producers-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.producer-mini-card {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.producer-mini-card:hover {
  transform: translateY(-2px);
  border-color: var(--pal-sage);
  background: var(--pal-mint-subtle);
  box-shadow: var(--shadow-md);
}

.producer-mini-card.active {
  border-color: var(--pal-wine);
  background: rgba(229, 205, 167, 0.32);
  box-shadow: 0 4px 14px rgba(71, 33, 48, 0.12);
}

.producer-mini-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.producer-mini-info h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--pal-charcoal);
  line-height: 1.2;
}

.producer-mini-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- GRID DE PRODUCTOS B2B --- */
.products-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

/* Tarjeta de Producto B2B */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--pal-sage);
}

.product-card-media {
  position: relative;
  width: 100%;
  height: 220px;
  background: #F4F8F3;
  overflow: hidden;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.product-badges-layer {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.producer-tag {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(71, 33, 48, 0.2);
  color: var(--pal-wine);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(55, 49, 49, 0.08);
}

.featured-star-badge {
  background: linear-gradient(135deg, var(--pal-sand), #D6B88B);
  color: var(--pal-charcoal);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(55, 49, 49, 0.1);
}

.sku-pill {
  position: absolute;
  bottom: 10px;
  left: 12px;
  background: rgba(55, 49, 49, 0.85);
  color: #FAF8F5;
  font-size: 0.72rem;
  font-family: monospace;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(229, 205, 167, 0.3);
}

.product-card-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pal-sage-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.product-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pal-charcoal);
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.product-format-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Selector de Formatos / Presentaciones */
.format-selector-wrapper {
  margin-bottom: 12px;
  background: rgba(229, 205, 167, 0.22);
  border: 1px solid rgba(201, 173, 129, 0.45);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.format-selector-wrapper label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pal-charcoal);
  margin-bottom: 5px;
  font-weight: 800;
}

.product-format-select {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid rgba(201, 173, 129, 0.7);
  color: var(--pal-charcoal);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.product-format-select:focus,
.product-format-select:hover {
  border-color: var(--pal-wine);
  box-shadow: 0 0 0 2px rgba(71, 33, 48, 0.15);
}

.product-format-select option {
  background: #FFFFFF;
  color: var(--pal-charcoal);
  padding: 8px;
}

/* Caja de Precio B2B */
.b2b-price-box {
  background: linear-gradient(135deg, rgba(216, 234, 213, 0.4) 0%, rgba(229, 205, 167, 0.25) 100%);
  border: 1px solid rgba(147, 178, 136, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 1rem;
}

.price-main-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.price-unit-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.price-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--pal-wine);
  letter-spacing: -0.02em;
}

.price-value small {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Especificaciones Técnicas (Peso, Cajas, MOQ) */
.specs-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(147, 178, 136, 0.25);
  font-size: 0.78rem;
}

.spec-cell {
  display: flex;
  flex-direction: column;
}

.spec-cell .label {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.spec-cell .val {
  color: var(--pal-charcoal);
  font-weight: 700;
}

/* Calculador B2B de Cajas */
.order-calculator-block {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(147, 178, 136, 0.25);
}

.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.stepper-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.box-stepper {
  display: flex;
  align-items: center;
  background: var(--pal-mint-subtle);
  border: 1px solid rgba(147, 178, 136, 0.4);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.stepper-btn {
  background: transparent;
  border: none;
  color: var(--pal-charcoal);
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.stepper-btn:hover {
  background: var(--pal-mint-light);
  color: var(--pal-wine);
}

.box-input {
  width: 50px;
  height: 34px;
  background: #FFFFFF;
  border: none;
  border-left: 1px solid rgba(147, 178, 136, 0.4);
  border-right: 1px solid rgba(147, 178, 136, 0.4);
  color: var(--pal-charcoal);
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  outline: none;
}

/* Resultados en Vivo del Cálculo */
.live-calc-feedback {
  background: rgba(216, 234, 213, 0.55);
  border: 1px dashed var(--pal-sage);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.78rem;
  margin-bottom: 12px;
  color: var(--pal-charcoal);
  line-height: 1.4;
}

.live-calc-feedback .highlight {
  font-weight: 700;
  color: var(--pal-wine);
}

.btn-add-order {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--pal-sage), var(--pal-sage-dark));
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(147, 178, 136, 0.4);
  transition: all 0.25s ease;
}

.btn-add-order:hover {
  background: linear-gradient(135deg, var(--pal-sage-dark), #66875B);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(147, 178, 136, 0.5);
}

.btn-add-order:active {
  transform: translateY(0);
}

.btn-view-details {
  background: transparent;
  border: none;
  color: var(--pal-wine);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-top: 8px;
  text-decoration: underline;
  transition: color 0.2s;
}

.btn-view-details:hover {
  color: var(--pal-charcoal);
}

.btn-pdf-sheet {
  background: rgba(71, 33, 48, 0.08);
  border: 1.5px solid var(--pal-wine);
  color: var(--pal-wine);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
}

.btn-pdf-sheet:hover {
  background: var(--pal-wine);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(71, 33, 48, 0.3);
  transform: translateY(-2px);
}

/* --- VISTA TABLA RÁPIDA MAYORISTA (QUICK ORDER TABLE) --- */
.quick-order-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
  margin-bottom: 4rem;
}

.b2b-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.b2b-table th {
  background: #EEF4ED;
  padding: 14px 16px;
  color: var(--pal-wine);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--panel-border);
}

.b2b-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(147, 178, 136, 0.15);
  vertical-align: middle;
  color: var(--pal-charcoal);
}

.b2b-table tr:hover td {
  background: rgba(216, 234, 213, 0.2);
}

/* --- CAJÓN LATERAL DE RESUMEN DE PEDIDO (ORDER DRAWER) --- */
.order-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(55, 49, 49, 0.5);
  backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.order-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.order-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 580px;
  height: 100vh;
  background: #FFFFFF;
  border-left: 1px solid var(--panel-border);
  box-shadow: -10px 0 40px rgba(55, 49, 49, 0.18);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.order-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F6F9F5;
}

.drawer-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--pal-charcoal);
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--pal-charcoal);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.drawer-close-btn:hover {
  color: var(--pal-wine);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: #FFFFFF;
}

.cart-producer-group {
  margin-bottom: 1.5rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #FAFCF9;
}

.producer-group-header {
  background: rgba(216, 234, 213, 0.5);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
}

.producer-group-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--pal-wine);
  display: flex;
  align-items: center;
  gap: 8px;
}

.producer-group-subtotal {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.cart-item-row {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(147, 178, 136, 0.15);
}

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

.cart-item-thumb {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--panel-border);
}

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

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--pal-charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cart-item-calc {
  font-size: 0.8rem;
  color: var(--pal-sage-dark);
  font-weight: 700;
  margin-top: 3px;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.btn-remove-item {
  background: transparent;
  border: none;
  color: var(--color-ruby);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.btn-remove-item:hover {
  opacity: 1;
}

/* Totales del Carrito */
.drawer-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--panel-border);
  background: #F6F9F5;
}

.totals-summary-box {
  background: #FFFFFF;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.total-row.grand-total {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--pal-charcoal);
  border-top: 1px solid rgba(147, 178, 136, 0.3);
  padding-top: 8px;
  margin-top: 8px;
  margin-bottom: 0;
}

.grand-total .val {
  color: var(--pal-wine);
}

.order-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.btn-drawer-action {
  padding: 11px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-pdf-export {
  background: rgba(229, 205, 167, 0.35);
  border: 1px solid var(--pal-sand-dark);
  color: var(--pal-charcoal);
}

.btn-pdf-export:hover {
  background: var(--pal-sand);
  color: var(--pal-wine);
}

.btn-whatsapp-send {
  background: var(--pal-sage);
  border: 1px solid var(--pal-sage-dark);
  color: #FFFFFF;
}

.btn-whatsapp-send:hover {
  background: var(--pal-sage-dark);
}

.btn-submit-formal-inquiry {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--pal-wine), var(--pal-wine-hover));
  color: #FFFFFF;
  font-size: 0.95rem;
  padding: 13px;
  box-shadow: 0 4px 15px rgba(71, 33, 48, 0.28);
}

.btn-submit-formal-inquiry:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(71, 33, 48, 0.38);
}

/* --- MODAL DE ACCESO / PUERTA B2B DE COMPRADOR --- */
.b2b-gate-overlay {
  position: fixed;
  inset: 0;
  background: #EEF4ED;
  background-image: 
    radial-gradient(circle at 15% 25%, rgba(216, 234, 213, 0.9) 0%, transparent 50%),
    radial-gradient(circle at 85% 75%, rgba(229, 205, 167, 0.6) 0%, transparent 50%),
    linear-gradient(180deg, #F9FAF7 0%, #EEF4ED 100%);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.b2b-gate-card {
  max-width: 460px;
  width: 100%;
  padding: 2.5rem 2rem;
  text-align: center;
  border: 2px solid var(--pal-sand);
  background: #FFFFFF;
  box-shadow: 0 20px 50px rgba(55, 49, 49, 0.12), 0 0 30px rgba(229, 205, 167, 0.3);
  border-radius: var(--radius-lg);
  position: relative;
}

.gate-logo {
  height: 48px;
  margin-bottom: 1.5rem;
}

.gate-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--pal-charcoal);
  margin-bottom: 0.5rem;
}

.gate-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.8rem;
  line-height: 1.5;
}

.gate-form-group {
  margin-bottom: 1.2rem;
  text-align: left;
}

.gate-input {
  width: 100%;
  padding: 14px;
  background: var(--pal-mint-subtle);
  border: 1px solid rgba(147, 178, 136, 0.5);
  border-radius: var(--radius-md);
  color: var(--pal-charcoal);
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  text-align: center;
  letter-spacing: 0.1em;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gate-input:focus {
  border-color: var(--pal-wine);
  box-shadow: 0 0 0 3px rgba(71, 33, 48, 0.12);
  background: #FFFFFF;
}

.btn-gate-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--pal-wine), var(--pal-wine-hover));
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(71, 33, 48, 0.28);
  transition: all 0.2s;
}

.btn-gate-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(71, 33, 48, 0.38);
}

.gate-error-msg {
  color: var(--color-ruby);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 1rem;
  display: none;
}

.gate-help-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  line-height: 1.4;
}

.gate-help-text a {
  color: var(--pal-wine);
  font-weight: 700;
  text-decoration: underline;
}

/* --- MODALES GENERALES (PRODUCT DETAILS & INQUIRY) --- */
.b2b-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(55, 49, 49, 0.55);
  backdrop-filter: blur(8px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.b2b-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.b2b-modal-box {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  box-shadow: 0 20px 50px rgba(55, 49, 49, 0.16);
  color: var(--pal-charcoal);
}

.modal-close-x {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: transparent;
  border: none;
  color: var(--pal-charcoal);
  font-size: 1.6rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close-x:hover {
  color: var(--pal-wine);
}

/* Toast Notificaciones */
.b2b-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--pal-wine);
  border: 1px solid var(--pal-sand);
  color: #FFFFFF;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(55, 49, 49, 0.25);
  z-index: 2500;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 600;
}

.b2b-toast.active {
  transform: translateY(0);
  opacity: 1;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 920px) {
  .controls-top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    margin-bottom: 1rem;
  }

  .search-box-wrapper {
    max-width: 100%;
    width: 100%;
    min-width: 0;
  }

  .view-controls {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .producer-select-dropdown {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-banner {
    padding: 1.5rem 1.25rem;
  }

  .controls-section {
    margin: 1rem 0 1.5rem 0;
  }

  .controls-card {
    padding: 1.1rem 1rem;
    border-radius: var(--radius-md);
  }

  .products-grid-container {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .order-drawer {
    max-width: 100%;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .header-nav-actions {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .btn-order-drawer {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .hero-stats-row {
    gap: 1rem;
  }
}

@media (max-width: 540px) {
  .container {
    padding: 0 0.75rem;
  }

  .controls-card {
    padding: 0.85rem 0.75rem;
  }

  .controls-top-row {
    gap: 0.65rem;
    margin-bottom: 0.75rem;
  }

  .search-input {
    font-size: 0.88rem;
    padding: 9px 12px 9px 36px;
  }

  .search-icon {
    left: 12px;
    font-size: 0.9rem;
  }

  .view-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
  }

  .producer-select-dropdown {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.86rem;
  }

  .view-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 6px;
  }

  .view-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.82rem;
    text-align: center;
  }

  .categories-filter-row {
    gap: 6px;
    padding: 2px 0 6px 0;
  }

  .cat-pill-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
    gap: 6px;
  }

  .producers-carousel {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
