@import url('https://fonts.googleapis.com/css2?family=Jacques+Francois&family=Poppins:wght@400;500;600;700&family=Raleway:wght@300;400;600;700;800&display=swap');

:root {
  /* Paleta Oficial heltex.mx */
  --bg: #f5f8fb;                /* rgb(245, 248, 251) */
  --surface: #ffffff;
  --surface-alt: #eaf6fc;
  --ice-blue: #a8e5ff;          /* rgb(168, 229, 255) - Bloque 50 Años Investigación */
  --input-tint: #dcf5ff;        /* rgb(220, 245, 255) */
  --primary: #005f87;           /* rgb(0, 95, 135) - Azul Marino Científico Heltex */
  --primary-dark: #00425e;
  --primary-light: #008ac4;     /* rgb(0, 138, 196) */
  --accent: #009fe3;            /* rgb(0, 159, 227) */
  --footer-blue: #3899d4;       /* rgb(56, 153, 212) - Footer Oficial heltex.mx */
  --hope-lime: #aeff00;         /* rgb(174, 255, 0) - Acento "de vida" en Hero heltex.mx */
  --emerald: #008361;           /* --color-success-dark en heltex.mx */
  --emerald-light: #00b090;     /* --color-success en heltex.mx */
  --emerald-bg: #def4f0;
  --amber: #d97706;
  --amber-bg: #fff8e2;
  --red: #d63163;
  --red-bg: #ffe8ef;
  --text: #1d1e20;              /* --color-dark en heltex.mx */
  --text-muted: #52606d;
  --border: #cfe4f2;
  --radius: 16px;
  --shadow: 0 10px 28px rgba(0, 95, 135, 0.09);
  --font-heading: 'Raleway', sans-serif;
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, .brand-title, .card-title {
  font-family: var(--font-heading);
}

/* Topbar Oficial Heltex */
.topbar {
  background: linear-gradient(135deg, #004a6b 0%, #005f87 55%, #008ac4 100%);
  color: #fff;
  padding: 0.75rem 1.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 66, 94, 0.22);
  border-bottom: 1px solid rgba(168, 229, 255, 0.22);
}

.topbar-inner {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-logo-img {
  height: 54px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.brand-title {
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.15;
}

.brand-title span {
  font-weight: 300;
  color: var(--hope-lime);
}

.brand-subtitle {
  font-size: 0.74rem;
  color: #d8f3ff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hope-lime);
  display: inline-block;
  box-shadow: 0 0 8px var(--hope-lime);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.nav-btn {
  font-family: var(--font-body);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.nav-btn.active {
  background: #ffffff;
  color: var(--primary);
  border-color: #ffffff;
  font-weight: 600;
}

.nav-btn.cart-btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--ice-blue);
  font-weight: 600;
}

.nav-btn.cart-btn:hover {
  background: #0088c6;
}

.badge-count {
  background: var(--hope-lime);
  color: #003852;
  font-weight: 700;
  padding: 0.06rem 0.48rem;
  border-radius: 999px;
  font-size: 0.74rem;
}

/* Main container */
.container {
  max-width: 1380px;
  width: 100%;
  margin: 1.5rem auto 2.5rem;
  padding: 0 1.25rem;
  flex: 1;
}

/* Hero Banner Oficial Heltex ("Una Esperanza de Vida / Ingeniería Genética") */
.store-hero {
  position: relative;
  background:
    linear-gradient(115deg, rgba(0, 66, 94, 0.92) 0%, rgba(0, 95, 135, 0.86) 52%, rgba(0, 159, 227, 0.72) 100%),
    url('assets/heltex/hero-main.png') center/cover no-repeat;
  color: #fff;
  border-radius: 22px;
  padding: 2.35rem 2.5rem;
  margin-bottom: 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  box-shadow: 0 16px 38px rgba(0, 95, 135, 0.18);
  overflow: hidden;
}

.hero-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ice-blue);
  margin-bottom: 0.35rem;
}

.store-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1.18;
  margin-bottom: 0.55rem;
  letter-spacing: 0.02em;
}

.store-hero h1 .light-hope {
  font-weight: 300;
  color: var(--hope-lime);
  text-transform: uppercase;
}

.store-hero p {
  color: #e6f6ff;
  max-width: 700px;
  font-size: 0.95rem;
  font-weight: 400;
}

.hero-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.pill {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 500;
}

.hero-side-box {
  background: rgba(0, 56, 82, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(168, 229, 255, 0.35);
  border-radius: 18px;
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 270px;
}

.hero-bactum-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  opacity: 0.95;
}

/* Banda "50 Años de Investigación Científica" estilo heltex.mx */
.research-strip {
  background: linear-gradient(90deg, var(--ice-blue) 0%, #d4f3ff 60%, #eaf8ff 100%);
  border: 1px solid #8bd8fc;
  border-radius: 18px;
  padding: 1rem 1.4rem;
  margin-bottom: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.research-strip-title {
  font-family: var(--font-heading);
  color: var(--primary);
  font-size: 1.05rem;
  line-height: 1.25;
}

.research-strip-title strong {
  font-weight: 800;
  letter-spacing: 0.03em;
}

.research-strip-title span {
  font-weight: 300;
}

.treatment-chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.treatment-chip {
  font-family: var(--font-heading);
  background: rgba(255, 255, 255, 0.85);
  color: var(--primary);
  border: 1px solid rgba(0, 95, 135, 0.22);
  padding: 0.34rem 0.82rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
}

.treatment-chip:hover,
.treatment-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Filters bar */
.filters-bar {
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  gap: 0.85rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
  box-shadow: 0 4px 14px rgba(0, 95, 135, 0.04);
}

.input,
.select,
textarea {
  font-family: var(--font-body);
  padding: 0.62rem 0.9rem;
  border-radius: 10px;
  border: 1px solid #b9d6e8;
  font-size: 0.9rem;
  background: #fdfeff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.input:focus,
.select:focus,
textarea:focus {
  background: #ffffff;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(0, 159, 227, 0.15);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 1.35rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 95, 135, 0.05);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.product-img-wrap {
  height: 215px;
  background: linear-gradient(145deg, #004a6b 0%, #0077a8 55%, #7ec8a3 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.product-img-wrap img.bottle-shot {
  object-fit: contain;
  padding: 0.35rem;
}

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

.sku-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 66, 94, 0.9);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
}

.stock-tag {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.product-body {
  padding: 1.15rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category {
  font-family: var(--font-heading);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-light);
  font-weight: 700;
  margin-bottom: 0.28rem;
}

.product-title {
  font-family: var(--font-heading);
  font-size: 1.06rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--primary-dark);
  line-height: 1.3;
}

.product-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 0.95rem;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  gap: 0.5rem;
}

.price-tag {
  font-family: var(--font-heading);
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--primary);
}

.price-unit {
  font-size: 0.73rem;
  color: var(--text-muted);
  display: block;
  font-weight: 500;
}

/* Botones Píldora Estilo Oficial heltex.mx */
.btn {
  font-family: var(--font-body);
  padding: 0.58rem 1.2rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.18s ease;
}

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

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

.btn-mp {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 159, 227, 0.28);
}

.btn-mp:hover {
  background: var(--primary-light);
}

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

.btn-success:hover {
  background: #006b4f;
}

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

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--border);
}

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

.btn-sm {
  padding: 0.36rem 0.8rem;
  font-size: 0.78rem;
}

/* Cards & Panels */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.35rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

/* Admin Subnav */
.admin-tabs {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
  background: var(--surface);
  padding: 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.admin-tab {
  font-family: var(--font-body);
  padding: 0.58rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-tab.active {
  background: var(--primary);
  color: #fff;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--primary-light);
}

.kpi-card.emerald {
  border-left-color: var(--emerald);
}

.kpi-card.amber {
  border-left-color: var(--amber);
}

.kpi-card.red {
  border-left-color: var(--red);
}

.kpi-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-top: 0.25rem;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface-alt);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:hover td {
  background: #f2f9fd;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
}

.badge-green {
  background: var(--emerald-bg);
  color: #00664b;
}

.badge-amber {
  background: var(--amber-bg);
  color: #92400e;
}

.badge-red {
  background: var(--red-bg);
  color: #9f1239;
}

.badge-blue {
  background: #dcf5ff;
  color: var(--primary);
}

/* Forms Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

/* Login Box */
.login-container {
  max-width: 460px;
  margin: 2.5rem auto;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 42, 61, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal-box {
  background: var(--surface);
  border-radius: 20px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 24px 55px rgba(0, 42, 61, 0.32);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.toast {
  background: var(--primary);
  color: #fff;
  padding: 0.85rem 1.2rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 66, 94, 0.28);
  font-size: 0.86rem;
  font-weight: 500;
  border-left: 4px solid var(--hope-lime);
  max-width: 390px;
}

.hidden {
  display: none !important;
}

/* Bar chart visual */
.bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  font-size: 0.84rem;
}

.bar-label {
  width: 210px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 12px;
  background: #dcebf5;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.bar-fill.danger {
  background: linear-gradient(90deg, #f59e0b, var(--red));
}

/* Footer Institucional Oficial heltex.mx (rgb(56, 153, 212)) */
.heltex-footer {
  background: var(--footer-blue);
  color: #ffffff;
  padding: 2.4rem 1.5rem 1.6rem;
  margin-top: auto;
  border-top: 4px solid var(--primary);
}

.heltex-footer-inner {
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.75rem;
  align-items: start;
}

.heltex-footer-heading {
  font-family: var(--font-heading);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.heltex-footer p {
  font-size: 0.84rem;
  line-height: 1.65;
  color: #ffffff;
}

.heltex-footer-bottom {
  max-width: 1380px;
  margin: 1.6rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.92);
}

@media (max-width: 768px) {
  .topbar {
    padding: 0.75rem 1rem;
  }
  .store-hero {
    padding: 1.6rem 1.35rem;
  }
  .store-hero h1 {
    font-size: 1.6rem;
  }
  .admin-tabs {
    border-radius: 16px;
  }
}

/* Buscador Predictivo Instantáneo (Typeahead desde 3 caracteres) */
.typeahead-wrap {
  position: relative;
  min-width: 280px;
  flex: 1;
}

.typeahead-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid var(--primary-light);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 66, 94, 0.2);
  z-index: 150;
  max-height: 340px;
  overflow-y: auto;
}

.typeahead-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.14s ease;
}

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

.typeahead-item:hover {
  background: var(--surface-alt);
}

.typeahead-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
  background: linear-gradient(135deg, #004a6b, #008ac4);
  padding: 2px;
  flex-shrink: 0;
}
