/* ==========================================================================
   Fresco — sistema de diseño
   B2B mexicano: profesional, visual, mobile-first. Verdes frescos,
   neutros cálidos, acentos de tierra — sin caer en "landing casera".
   ========================================================================== */

:root {
  --color-bg: #faf8f3;
  --color-surface: #ffffff;
  --color-surface-alt: #f3efe4;
  --color-text: #1f2a1e;
  --color-text-muted: #5b6b58;
  --color-text-faint: #8a9587;

  --color-primary: #2f6b3c;
  --color-primary-dark: #234f2c;
  --color-primary-light: #eaf3ea;
  --color-accent: #e07a3f;
  --color-accent-dark: #c2632c;

  --color-best-bg: #eaf3ea;
  --color-best-text: #1e5b2c;
  --color-border: #e4dfd3;
  --color-border-strong: #d3ccba;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(31, 42, 30, 0.06), 0 1px 1px rgba(31, 42, 30, 0.04);
  --shadow-md: 0 8px 20px rgba(31, 42, 30, 0.09), 0 2px 6px rgba(31, 42, 30, 0.05);
  --shadow-lg: 0 20px 44px rgba(31, 42, 30, 0.16);

  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;

  --transition-fast: 150ms ease;
  --transition-base: 220ms cubic-bezier(0.4, 0, 0.2, 1);

  --nav-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Mostrado/ocultado por modo (ver body.mode-business / body.mode-admin en app.js) */
body.mode-business .admin-only {
  display: none !important;
}

/* ==========================================================================
   Navegación
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(250, 248, 243, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--color-primary-dark);
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 0;
  flex-shrink: 0;
}

.nav__brand svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
}

.nav__hamburger {
  display: none;
  border: none;
  background: none;
  padding: 8px;
  margin: -8px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
}

.nav__hamburger svg {
  width: 24px;
  height: 24px;
}

.nav__hamburger:hover {
  background: var(--color-surface-alt);
}

.nav__panel {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
}

.nav__links {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.nav__link {
  border: none;
  background: none;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  min-height: 40px;
}

.nav__link:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.nav__link.is-active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.nav__cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.mode-toggle {
  display: flex;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  margin-left: 14px;
  flex-shrink: 0;
}

.mode-toggle__option {
  border: none;
  background: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.mode-toggle__option.is-active {
  background: var(--color-primary-dark);
  color: #fff;
}

@media (max-width: 860px) {
  .nav__hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav__panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: 10px 16px 18px;
  }

  .nav__panel.is-open {
    display: flex;
  }

  .nav__links {
    flex-direction: column;
    gap: 2px;
  }

  .nav__link {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
  }

  .mode-toggle {
    margin: 14px 0 0;
    width: 100%;
  }

  .mode-toggle__option {
    flex: 1;
    padding: 10px 14px;
  }
}

/* ==========================================================================
   Secciones / transición
   ========================================================================== */

.section {
  display: none;
  padding: 40px 0 72px;
  animation: fadeIn var(--transition-base);
}

.section.is-active {
  display: block;
}

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

.section-header {
  max-width: 640px;
  margin: 0 auto 32px;
  text-align: center;
}

.section-header h2 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.section-header p {
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 10px;
}

/* ==========================================================================
   Botones
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 13px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast);
  white-space: nowrap;
  min-height: 44px;
}

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

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary-dark);
  border: 1.5px solid var(--color-border-strong);
}

.btn-secondary:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-primary);
}

.btn-accent {
  background: var(--color-accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--color-accent-dark);
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 6px 10px;
  font-weight: 600;
  min-height: auto;
}

.btn-ghost:hover {
  color: var(--color-accent-dark);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.84rem;
  min-height: 38px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Landing — Hero
   ========================================================================== */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 40px 20px 28px;
  background-image: linear-gradient(180deg, rgba(250, 248, 243, 0.88), rgba(250, 248, 243, 0.97)),
    url("assets/images/hero-background.jpg");
  background-size: cover;
  background-position: center;
  background-color: var(--color-bg);
}

.hero__side-image {
  flex: 0 0 200px;
  width: 200px;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: var(--color-surface-alt);
}

.hero__content {
  flex: 1;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
}

.hero .highlight {
  color: var(--color-primary);
}

.hero__subhead {
  max-width: 580px;
  margin: 0 auto 28px;
  font-size: 1.05rem;
  color: var(--color-text-muted);
}

.hero__ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__suppliers {
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--color-text-faint);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .hero__side-image {
    display: none;
  }
}

/* ==========================================================================
   Landing — pasos (Compara → Calcula → Elige → Recibe)
   ========================================================================== */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.step-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.step-card__num {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.step-card__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.step-card__icon svg {
  width: 20px;
  height: 20px;
}

.step-card h3 {
  font-size: 1.02rem;
  margin-bottom: 6px;
}

.step-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* ==========================================================================
   Landing — Lo que viene
   ========================================================================== */

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

.future-card {
  background: var(--color-surface-alt);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
}

.future-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--color-border);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.future-card__icon svg {
  width: 19px;
  height: 19px;
}

.future-card h3 {
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.future-card p {
  font-size: 0.87rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.badge-soon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  background: #fff;
  border: 1px solid var(--color-border);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ==========================================================================
   Tarjeta genérica de sección
   ========================================================================== */

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

/* ==========================================================================
   Comparador — tabla (solo lectura)
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

table.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: var(--color-surface);
}

.compare-table th,
.compare-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}

.compare-table thead th {
  background: var(--color-surface-alt);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: 700;
  position: sticky;
  top: 0;
}

.compare-table tbody tr {
  cursor: pointer;
  transition: background var(--transition-fast);
}

.compare-table tbody tr:hover {
  background: #fbfaf6;
}

.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-table .cell-product {
  font-weight: 700;
}

.compare-table .cell-category {
  color: var(--color-text-faint);
  font-size: 0.82rem;
}

.price-cell {
  position: relative;
}

.price-cell.is-best {
  background: var(--color-best-bg);
}

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

.price-cell__value {
  font-weight: 700;
}

.best-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-best-text);
  background: #dcefdd;
  padding: 3px 8px;
  border-radius: 999px;
}

/* ==========================================================================
   Calculadora
   ========================================================================== */

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

.calc-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

table.calc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.calc-table th,
.calc-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  vertical-align: middle;
}

.calc-table thead th {
  background: var(--color-surface-alt);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: 700;
}

.calc-table tbody tr:last-child td {
  border-bottom: none;
}

.calc-table .cell-product {
  font-weight: 700;
}

.calc-table .cell-subtotal {
  font-weight: 800;
  white-space: nowrap;
}

.qty-input {
  width: 76px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border-strong);
  font-family: inherit;
  font-size: 0.92rem;
  background: #fff;
  color: var(--color-text);
}

.qty-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.provider-price {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 11px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  min-width: 92px;
}

.provider-price:hover {
  border-color: var(--color-border-strong);
}

.provider-price.is-effective {
  border-color: var(--color-primary);
  background: var(--color-best-bg);
}

.provider-price__name {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
}

.provider-price__value {
  font-weight: 800;
  font-size: 0.88rem;
}

/* ==========================================================================
   Panel de orden (sidebar en escritorio / bottom sheet en móvil)
   ========================================================================== */

.order-panel {
  position: sticky;
  top: calc(var(--nav-height) + 16px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - var(--nav-height) - 32px);
  overflow-y: auto;
}

.order-panel__title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.order-panel__summary {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-panel__summary-count {
  font-weight: 700;
  font-size: 0.9rem;
}

.order-panel__summary-total {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-primary-dark);
}

.order-panel__toggle {
  display: none;
  border: none;
  background: var(--color-surface-alt);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.order-panel.is-expanded .order-panel__toggle {
  transform: rotate(180deg);
}

.order-panel__lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.order-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.86rem;
}

.order-line:last-child {
  border-bottom: none;
}

.order-line__name {
  font-weight: 700;
}

.order-line__meta {
  color: var(--color-text-faint);
  font-size: 0.78rem;
}

.order-line__amount {
  font-weight: 700;
  white-space: nowrap;
}

.order-panel__total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 12px;
  border-top: 1.5px solid var(--color-border);
  margin-bottom: 6px;
}

.order-panel__total-label {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.order-panel__total-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-primary-dark);
}

.order-panel__link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  padding: 8px;
}

@media (max-width: 700px) {
  .calc-layout {
    grid-template-columns: 1fr;
    padding-bottom: 96px;
  }

  .calc-table thead {
    display: none;
  }

  .calc-table,
  .calc-table tbody,
  .calc-table tr,
  .calc-table td {
    display: block;
    width: 100%;
  }

  .calc-table {
    min-width: 0;
  }

  .calc-table tr {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    padding: 12px 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
  }

  .calc-table td {
    border: none;
    padding: 0;
    width: auto;
  }

  .calc-table .cell-product {
    flex: 1 1 100%;
  }

  .calc-table .cell-qty,
  .calc-table .cell-subtotal {
    flex: 1 1 auto;
  }

  .calc-table .cell-subtotal {
    text-align: right;
    margin-left: auto;
  }

  .calc-table .cell-provider {
    flex: 1 1 45%;
    padding-top: 4px;
  }

  .order-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 150;
    border-radius: 18px 18px 0 0;
    max-height: 72vh;
    box-shadow: var(--shadow-lg);
  }

  .order-panel__title {
    display: none;
  }

  .order-panel__summary {
    display: flex;
    cursor: pointer;
  }

  .order-panel__toggle {
    display: inline-flex;
  }

  .order-panel__lines,
  .order-panel__total-row,
  .order-panel__link {
    display: none;
  }

  .order-panel.is-expanded .order-panel__lines,
  .order-panel.is-expanded .order-panel__total-row,
  .order-panel.is-expanded .order-panel__link {
    display: flex;
  }

  .order-panel.is-expanded .order-panel__total-row {
    display: flex;
  }

  .order-panel__lines {
    overflow-y: auto;
    max-height: 34vh;
    margin-top: 14px;
  }
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Mi orden
   ========================================================================== */

table.orden-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.orden-table th,
.orden-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}

.orden-table thead th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
}

.orden-table tbody tr:last-child td {
  border-bottom: none;
}

.orden-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.summary-tile {
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--color-border);
}

.summary-tile--total {
  background: var(--color-surface-alt);
}

.summary-tile--savings {
  background: linear-gradient(135deg, #eaf3ea, #f2ead9);
  border-color: #cfe6d1;
}

.summary-tile__label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.summary-tile__value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--color-text);
}

.summary-tile--savings .summary-tile__value {
  color: var(--color-primary-dark);
}

.summary-tile__note {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.orden-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 600px) {
  .orden-actions .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-primary-dark);
  color: #fff;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: 400;
  max-width: calc(100vw - 40px);
  text-align: center;
}

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

/* ==========================================================================
   Chatbot (mock, sin funcionalidad real)
   ========================================================================== */

.chatbot {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
}

.chatbot__fab {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--color-primary-dark);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.chatbot__fab:hover {
  transform: scale(1.05);
}

.chatbot__fab svg {
  width: 24px;
  height: 24px;
}

.chatbot__panel {
  position: absolute;
  bottom: 66px;
  right: 0;
  width: 320px;
  max-width: calc(100vw - 40px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chatbot__panel[hidden] {
  display: none;
}

.chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--color-primary-dark);
  color: #fff;
  font-weight: 700;
  font-size: 0.94rem;
}

.chatbot__close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.chatbot__messages {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.chatbot__bubble {
  background: var(--color-surface-alt);
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  font-size: 0.86rem;
  line-height: 1.4;
  max-width: 92%;
}

.chatbot__input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--color-border);
}

.chatbot__input-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border-strong);
  font-family: inherit;
  font-size: 0.86rem;
  background: var(--color-surface-alt);
  color: var(--color-text-faint);
  min-width: 0;
}

@media (max-width: 600px) {
  .chatbot {
    right: 14px;
    bottom: 14px;
  }

  .chatbot__panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
    max-height: 70vh;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  text-align: center;
  color: var(--color-text-faint);
  font-size: 0.82rem;
}

/* ==========================================================================
   Responsive general
   ========================================================================== */

@media (max-width: 900px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .future-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .steps {
    grid-template-columns: 1fr;
  }

  .future-grid {
    grid-template-columns: 1fr;
  }

  .orden-summary {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }
}
