/* Distribuidor CMS — mobile-first. Base rules target phones; min-width queries enhance. */
:root {
  --brand: #0b5ea8;
  --brand-dark: #08407a;
  --brand-subtle: #eaf2fb;
  --accent: #f5b21b;
  --ink: #1c2b3c;
  --muted: #566475;
  --border-light: #e3ebf4;
  --shadow-sm: 0 2px 8px rgba(8, 40, 80, 0.05);
  --shadow-md: 0 8px 24px rgba(8, 40, 80, 0.08);
  --shadow-lg: 0 16px 36px rgba(8, 40, 80, 0.12);
  --nav-h: 56px;        /* updated from main.js with the real navbar height */
  --bar-h: 64px;        /* mobile bottom action bar */
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 64px); }
body {
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
  background-color: #ffffff;
}
h1, h2, h3, h4, .navbar-brand, .btn, .chip, .cat-label { font-family: "Archivo", "Figtree", system-ui, sans-serif; }
h1, h2 { letter-spacing: -.01em; }
a { color: var(--brand); }
.text-muted { color: var(--muted) !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip-link { position: absolute; left: .5rem; top: -4rem; z-index: 2000; background: #fff; padding: .6rem 1rem; border-radius: .5rem; transition: top .15s; }
.skip-link:focus { top: .5rem; }

/* Buttons: 44px minimum touch target */
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-weight: 700; border-radius: .6rem; }
.btn-lg { min-height: 52px; padding-inline: 1.5rem; }
.btn-cta { background: var(--accent); color: #12243a; border: 0; box-shadow: 0 2px 6px rgba(245, 178, 27, .3); }
.btn-cta:hover, .btn-cta:focus-visible { background: #ffc43d; color: #12243a; }
.btn-brand { background: var(--brand); color: #fff; border: 0; }
.btn-brand:hover { background: var(--brand-dark); color: #fff; }
.btn-outline-brand { border: 1.5px solid var(--brand); color: var(--brand); background: transparent; }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }

/* Navbar */
.navbar-cms { background: var(--brand); box-shadow: 0 2px 12px rgba(8, 40, 80, .18); }
.navbar-cms .navbar-brand { color: #fff; font-weight: 800; font-size: 1.15rem; }
.navbar-cms .nav-link { color: rgba(255,255,255,.9); font-weight: 600; padding: .85rem 0; }
.navbar-cms .nav-link:hover, .navbar-cms .nav-link.active { color: var(--accent); }
.navbar-cms .navbar-toggler { border-color: rgba(255,255,255,.4); min-width: 44px; min-height: 44px; }
.navbar-cms .navbar-toggler-icon { filter: invert(1); }
.navbar-cms .navbar-nav .btn { width: 100%; margin-bottom: .5rem; }

/* Hero */
.hero-light { background: linear-gradient(125deg, var(--brand-dark) 0%, var(--brand) 100%); color: #fff; }
.hero-title { font-weight: 800; line-height: 1.1; color: #fff; font-size: clamp(2rem, 7vw, 3.2rem); text-wrap: balance; }

/* Hero Photo Wrapper & Badge */
.hero-photo-wrap { position: relative; border-radius: 1.25rem; overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-photo { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 1.25rem; border: 4px solid rgba(255, 255, 255, 0.95); }
.hero-badge {
  position: absolute; bottom: 1rem; left: 1rem; right: auto;
  background: rgba(8, 40, 80, 0.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; padding: .45rem .85rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: .45rem; border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}
.hero-badge i { color: var(--accent); font-size: 1rem; }

/* Status pill indicator */
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.open-status {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .4rem .9rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff; font-size: .88rem; font-weight: 600; margin-bottom: 1.25rem;
}
.open-status .dot { flex: 0 0 .65rem; height: .65rem; border-radius: 50%; background: #94a3b8; }
.open-status.is-open .dot { background: #4ade80; animation: pulse-dot 2s infinite ease-out; }
.open-status-dark {
  background: var(--brand-subtle); border-color: #d1e2f3; color: var(--brand-dark);
}
.open-status-dark .dot { background: #94a3b8; }
.open-status-dark.is-open .dot { background: #16a34a; box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.2); }

/* Trust Strip / Client segments */
.trust-strip { background: #f8fafc; border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.trust-tag {
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  font-size: .9rem; font-weight: 600; color: #415164;
  padding: .5rem .75rem; background: #fff; border-radius: 999px; border: 1px solid #e2e8f0;
}
.trust-tag i { color: var(--brand); font-size: 1.1rem; }

/* Page Header */
.page-header { background: linear-gradient(125deg, var(--brand-dark) 0%, var(--brand) 100%); }
.page-header h1 { font-weight: 800; }
.cta { background: linear-gradient(125deg, var(--brand-dark) 0%, var(--brand) 100%); }

.section-title { font-weight: 800; color: var(--brand-dark); font-size: clamp(1.5rem, 5vw, 2.1rem); }

/* Benefit cards on homepage */
.benefit-card {
  background: #fff; border: 1px solid var(--border-light); border-radius: 1rem;
  padding: 1.5rem; height: 100%; box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.benefit-icon {
  width: 48px; height: 48px; border-radius: .75rem;
  background: var(--brand-subtle); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  margin-bottom: 1rem;
}

/* Home category cards */
.cat-card {
  position: relative; border-radius: 1.1rem; overflow: hidden; aspect-ratio: 1;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  background: #f8fafc;
}
.cat-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.cat-label {
  position: absolute; inset: auto 0 0 0; padding: 2.2rem .85rem .85rem;
  color: #fff; font-weight: 700; font-size: .95rem; line-height: 1.25;
  background: linear-gradient(to top, rgba(8,40,80,0.95) 0%, rgba(8,40,80,0.6) 55%, transparent 100%);
  display: flex; align-items: flex-end; justify-content: space-between; gap: .4rem;
}
.cat-label i { font-size: 1.05rem; transition: transform .25s ease; flex-shrink: 0; }

/* Products: live search input */
.catalog-search-wrap {
  position: relative; max-width: 600px; margin: 0 auto;
}
.catalog-search-wrap i.bi-search {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 1.1rem; pointer-events: none;
}
.catalog-search-input {
  padding-left: 2.75rem; padding-right: 2.5rem; height: 48px;
  border-radius: 999px; border: 1.5px solid #c9d8e8; background: #fff;
  font-size: .95rem; font-weight: 500; box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.catalog-search-input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11, 94, 168, .15); outline: none;
}
.btn-clear-search {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: #94a3b8; font-size: 1.15rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
}
.btn-clear-search:hover { color: var(--ink); }

/* Products: one-row scrollable chips under the navbar */
.cat-nav { position: sticky; top: var(--nav-h); z-index: 1010; box-shadow: 0 2px 10px rgba(8,40,80,.06); }
.cat-nav-wrapper { position: relative; }
.chip-row {
  position: relative; display: flex; flex-wrap: nowrap; gap: .5rem;
  padding-block: .65rem; overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap;
  min-height: 38px; display: inline-flex; align-items: center;
  padding: 0 1rem; border-radius: 999px; border: 1.5px solid #d1e2f3;
  color: var(--brand-dark); background: #fff; font-weight: 600; font-size: .88rem; text-decoration: none;
  transition: all .2s ease;
}
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(11, 94, 168, .25); }

/* Category Section Banners */
.section-banner { position: relative; border-radius: 1.1rem; overflow: hidden; background-size: cover; background-position: center; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.section-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(8,64,122,.95) 30%, rgba(8,64,122,.65)); }
.section-banner-inner { position: relative; color: #fff; padding: 1.5rem 1.25rem; max-width: 640px; }
.section-banner-inner h2 { font-size: 1.45rem; font-weight: 800; }
.section-banner-inner p { font-size: .95rem; }

/* Product Cards */
.product-card {
  border: 1px solid var(--border-light); border-radius: 1rem;
  overflow: hidden; background: #fff; box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.product-card .card-img-top {
  aspect-ratio: 1; object-fit: cover; background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
}
.product-card .card-body { padding: .85rem; }
.product-card .card-title { line-height: 1.25; font-weight: 700; color: var(--ink); }
.product-card .card-body p { line-height: 1.35; }

/* Search empty state */
.search-no-results {
  background: var(--brand-subtle); border: 1px dashed #b9d3ee;
  border-radius: 1rem; padding: 2.5rem 1.5rem; text-align: center;
}

/* Contact Page Cards & Actions */
.info-card {
  background: #fff; border: 1px solid var(--border-light);
  border-radius: 1.2rem; box-shadow: var(--shadow-sm);
}
.info-row { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: 1.25rem; }
.info-icon-bubble {
  width: 40px; height: 40px; border-radius: .65rem;
  background: var(--brand-subtle); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.map-frame {
  border-radius: 1.2rem; overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.map-frame.ratio-21x9 { --bs-aspect-ratio: 80%; }

/* Copy address feedback badge */
.copy-badge-feedback {
  font-size: .8rem; font-weight: 600; color: #16a34a; background: #dcfce7;
  padding: .2rem .55rem; border-radius: .4rem; display: inline-flex;
  align-items: center; gap: .3rem; transition: opacity .2s;
}

/* Footer */
.footer-cms { background: #08213b; color: #cfdbe8; }
.footer-cms a { color: #cfdbe8; text-decoration: none; display: inline-block; padding: .3rem 0; }
.footer-cms a:hover { color: var(--accent); }
.footer-cms h2 { color: #fff; font-size: 1.05rem; font-weight: 700; }

/* Mobile bottom action bar (call) */
.action-bar {
  position: fixed; inset: auto 0 0 0; z-index: 1050; height: calc(var(--bar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: 1fr; gap: .5rem; padding-inline: .75rem; padding-top: .5rem;
  background: #fff; border-top: 1px solid #dbe5ef; box-shadow: 0 -4px 16px rgba(8,40,80,.1);
}
.action-bar a { display: flex; align-items: center; justify-content: center; gap: .5rem; border-radius: .65rem; font-weight: 700; text-decoration: none; color: #fff; font-family: "Archivo", sans-serif; }
.action-call { background: var(--accent); color: #12243a !important; box-shadow: 0 2px 8px rgba(245, 178, 27, .3); }

@media (min-width: 576px) {
  .section-banner-inner h2 { font-size: 1.65rem; }
  .product-card .card-body { padding: 1.1rem; }
}

@media (min-width: 768px) {
  .section-banner-inner { padding: 2.25rem 2.5rem; }
  .section-banner-inner h2 { font-size: 2.1rem; }
  .cat-label { font-size: 1.05rem; padding: 2.2rem 1rem .9rem; }
  .map-frame.ratio-21x9 { --bs-aspect-ratio: 42.857%; }
}

@media (min-width: 992px) {
  body { padding-bottom: 0; }
  :root { --nav-h: 72px; }
  .navbar-cms .nav-link { padding: .5rem .75rem; }
  .navbar-cms .navbar-nav .btn { width: auto; margin-bottom: 0; }
  .chip-row { justify-content: center; overflow: visible; }
}

/* Back to top (products page): above the mobile action bar */
.to-top {
  position: fixed; right: 14px; z-index: 1040;
  bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + 12px);
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #c9d8e8; background: #fff; color: var(--brand-dark); font-size: 1.25rem;
  box-shadow: 0 4px 14px rgba(8,40,80,.2);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
@media (min-width: 992px) { .to-top { bottom: 20px; right: 20px; } }

/* Hover motion only where hover exists (not on touch) */
@media (hover: hover) {
  .btn-cta { transition: background .2s, transform .2s, box-shadow .2s; }
  .btn-cta:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245, 178, 27, .4); }
  .benefit-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cbddec; }
  .product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: #cbddec; }
  .cat-card:hover img { transform: scale(1.06); }
  .cat-card:hover .cat-label i { transform: translateX(4px); }
  .chip:hover { border-color: var(--brand); color: var(--brand); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; animation: none !important; }
}
