/* =========================================================
   EnvoFresh — hoja de estilos principal
   Empaques y envases para alimentos — Venezuela
   ========================================================= */

:root {
  /* Colores de marca (tomados del logo oficial) */
  --verde: #1E9B3A;
  --verde-oscuro: #0F6B26;
  --verde-lima: #8DC63F;
  --negro: #171717;
  --blanco: #ffffff;
  --gris-100: #f7f8f6;
  --gris-200: #eef1ec;
  --gris-400: #b9c2b7;
  --gris-600: #6b756a;
  --gris-800: #333a32;

  --radio-sm: 10px;
  --radio-md: 18px;
  --radio-lg: 28px;
  --sombra: 0 10px 30px -12px rgba(15, 40, 20, 0.25);
  --sombra-sm: 0 4px 14px -6px rgba(15, 40, 20, 0.2);

  --fuente: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --header-h: 76px;
}

/* ---------- Reset base ---------- */
* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--fuente);
  color: var(--negro);
  background: var(--blanco);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

:focus-visible {
  outline: 3px solid var(--verde-lima);
  outline-offset: 2px;
  border-radius: 4px;
}

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

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

.section-head {
  max-width: 640px;
  margin: 0 auto 44px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 800;
  color: var(--negro);
}
.section-head p {
  margin-top: 12px;
  color: var(--gris-600);
  font-size: 1.05rem;
}

section { padding: 84px 0; }
.section-alt { background: var(--gris-100); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 2px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--verde);
  color: var(--blanco);
  box-shadow: var(--sombra-sm);
}
.btn-primary:hover { background: var(--verde-oscuro); }
.btn-outline {
  background: transparent;
  border-color: var(--blanco);
  color: var(--blanco);
}
.btn-outline:hover { background: rgba(255,255,255,0.15); }
.btn-dark-outline {
  background: transparent;
  border-color: var(--negro);
  color: var(--negro);
}
.btn-dark-outline:hover { background: var(--negro); color: var(--blanco); }
.btn-sm { padding: 10px 18px; font-size: 0.88rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--gris-200);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.logo-link { flex-shrink: 0; }
.logo-link img { height: 40px; width: auto; }

.main-nav ul {
  display: flex;
  gap: 30px;
}
.main-nav a {
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--gris-800);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.main-nav a:hover { color: var(--verde); border-color: var(--verde-lima); }

/* El CTA dentro del nav solo se muestra en el menú móvil */
.main-nav .nav-cta { display: none; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: none;
  background: var(--gris-100);
  border-radius: var(--radio-sm);
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--negro);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 140% at 15% 0%, #2bb04a 0%, var(--verde) 45%, var(--verde-oscuro) 100%);
  color: var(--blanco);
  padding: 64px 0 90px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: 60%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(141, 198, 63, 0.35), transparent 70%);
  pointer-events: none;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-copy .eyebrow { color: var(--verde-lima); }
.hero-copy h1 {
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}
.hero-copy h1 .accent { color: var(--verde-lima); }
.hero-copy p.lead {
  margin-top: 20px;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

/* Photo collage */
.hero-visual {
  position: relative;
  min-height: 380px;
}
.hero-photo {
  position: absolute;
  border-radius: var(--radio-lg);
  overflow: hidden;
  box-shadow: var(--sombra);
  border: 4px solid rgba(255,255,255,0.25);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo--main {
  width: 66%;
  aspect-ratio: 4 / 5;
  top: 0;
  right: 0;
}
.hero-photo--main img { object-position: 50% 58%; }
.hero-photo--sm1 {
  width: 46%;
  aspect-ratio: 1 / 1;
  left: 0;
  bottom: 6%;
  transform: rotate(-4deg);
}
.hero-photo--sm1 img { object-position: 50% 62%; }
.hero-photo--sm2 {
  width: 34%;
  aspect-ratio: 1 / 1;
  left: 30%;
  top: -4%;
  transform: rotate(5deg);
}
.hero-photo--sm2 img { object-position: 50% 48%; }

.hero-badge {
  position: absolute;
  left: 2%;
  top: 40%;
  background: var(--blanco);
  color: var(--negro);
  border-radius: var(--radio-md);
  padding: 14px 18px;
  box-shadow: var(--sombra);
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
}
.hero-badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--verde-lima);
  flex-shrink: 0;
}

/* ---------- Trust bar ---------- */
.trust-bar {
  background: var(--negro);
  color: var(--blanco);
  padding: 30px 0;
}
.trust-bar .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}
.trust-item strong {
  display: block;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 800;
  color: var(--verde-lima);
}
.trust-item span {
  font-size: 0.86rem;
  color: rgba(255,255,255,0.75);
}

/* ---------- Líneas ---------- */
.lineas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.linea-card {
  position: relative;
  border-radius: var(--radio-md);
  overflow: hidden;
  background: var(--gris-800);
  aspect-ratio: 3 / 3.4;
  box-shadow: var(--sombra-sm);
  border: none;
  padding: 0;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.linea-card:hover, .linea-card:focus-visible { transform: translateY(-4px); box-shadow: var(--sombra); }
.linea-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.78;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.linea-card:hover img { transform: scale(1.06); opacity: 0.62; }
.linea-card .fallback-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--verde), var(--verde-oscuro));
}
.linea-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.15) 55%, rgba(0,0,0,0) 100%);
}
.linea-card-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px;
  color: var(--blanco);
  z-index: 1;
}
.linea-card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}
.linea-card-body span {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--verde-lima);
  background: rgba(0,0,0,0.35);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------- Catálogo ---------- */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.search-box {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}
.search-box input {
  width: 100%;
  padding: 13px 18px 13px 42px;
  border-radius: 999px;
  border: 1.5px solid var(--gris-200);
  background: var(--blanco);
  font-size: 0.96rem;
}
.search-box input:focus { border-color: var(--verde); }
.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--gris-600);
}
.result-count {
  font-size: 0.88rem;
  color: var(--gris-600);
  font-weight: 500;
  white-space: nowrap;
}

/* Fila de chips: una sola línea con scroll horizontal y fades laterales */
.chip-row-wrap {
  position: relative;
  margin-bottom: 32px;
}
.chip-row-wrap::before,
.chip-row-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34px;
  pointer-events: none;
  z-index: 2;
  opacity: 1;
  transition: opacity 0.2s ease;
}
.chip-row-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--gris-100), rgba(247, 248, 246, 0));
}
.chip-row-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--gris-100), rgba(247, 248, 246, 0));
}
.chip-row-wrap--hide-left::before { opacity: 0; }
.chip-row-wrap--hide-right::after { opacity: 0; }

.chip-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 2px;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row-wrap--fits .chip-row { justify-content: center; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1.5px solid var(--gris-200);
  background: var(--blanco);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gris-800);
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}
.chip:hover { border-color: var(--verde); }
.chip:active { transform: translateY(1px); }
.chip.active {
  background: var(--verde);
  border-color: var(--verde);
  color: var(--blanco);
  box-shadow: var(--sombra-sm);
}
.chip-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gris-100);
  color: var(--gris-600);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}
.chip.active .chip-count {
  background: rgba(255, 255, 255, 0.28);
  color: var(--blanco);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.product-card {
  background: var(--blanco);
  border: 1px solid var(--gris-200);
  border-radius: var(--radio-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--sombra-sm); }
.product-photo {
  aspect-ratio: 1 / 1;
  background: var(--gris-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-photo img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.product-photo.no-photo {
  background: linear-gradient(160deg, var(--gris-100), var(--gris-200));
}
.product-photo.no-photo img {
  width: 46%;
  height: 46%;
  object-fit: contain;
  opacity: 0.28;
  padding: 0;
  filter: grayscale(1);
}
.product-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.product-linea-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--verde);
}
.product-body h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--negro);
}
.product-serial {
  font-size: 0.78rem;
  color: var(--gris-600);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.product-specs {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--gris-200);
  font-size: 0.82rem;
  color: var(--gris-800);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.product-specs .spec-row strong { color: var(--gris-600); font-weight: 600; }

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--gris-600);
  grid-column: 1 / -1;
}
.no-results strong { display: block; font-size: 1.2rem; color: var(--negro); margin-bottom: 8px; }
.no-results .btn { margin-top: 10px; }

.catalog-loadmore {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}

/* ---------- Nosotros ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.about-copy p { color: var(--gris-800); font-size: 1.05rem; }
.about-copy p + p { margin-top: 16px; }
.about-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 20px;
}
.value-card {
  background: var(--blanco);
  border-radius: var(--radio-md);
  padding: 22px 18px;
  box-shadow: var(--sombra-sm);
  text-align: center;
}
.value-card .value-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--verde-lima), var(--verde));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blanco);
}
.value-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.value-card p { font-size: 0.86rem; color: var(--gris-600); }

/* ---------- Contacto ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.contact-card {
  background: var(--blanco);
  border-radius: var(--radio-lg);
  padding: 36px 30px;
  box-shadow: var(--sombra-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--gris-200);
}
.contact-card .icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radio-sm);
  background: linear-gradient(160deg, var(--verde), var(--verde-oscuro));
  color: var(--blanco);
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-card h3 { font-size: 1.15rem; font-weight: 700; }
.contact-card p { color: var(--gris-600); }
.contact-card .contact-link { font-weight: 700; color: var(--verde); font-size: 1.05rem; }
.contact-note {
  margin-top: 26px;
  text-align: center;
  color: var(--gris-600);
  font-size: 0.95rem;
}
.contact-note strong { color: var(--negro); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--verde-oscuro);
  color: rgba(255,255,255,0.85);
  padding: 56px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
.footer-logo img {
  height: 34px;
  filter: brightness(0) invert(1);
  margin-bottom: 14px;
}
.footer-grid p { font-size: 0.92rem; color: rgba(255,255,255,0.7); max-width: 32ch; }
.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--verde-lima);
  margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col a, .footer-col span { font-size: 0.92rem; color: rgba(255,255,255,0.82); }
.footer-col a:hover { color: var(--verde-lima); }
.footer-bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
}
/* Enlace discreto al panel de administración, junto al © del footer */
.footer-copy {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-admin-link:hover,
.footer-admin-link:focus-visible { color: var(--verde-lima); }
.footer-admin-link svg { flex-shrink: 0; }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1080px) {
  .lineas-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { min-height: 320px; order: -1; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  section { padding: 60px 0; }
  .main-nav { display: none; }
  .header-actions .btn-primary-desktop { display: none; }
  .hamburger { display: flex; }

  .main-nav.mobile-open {
    display: block;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--blanco);
    border-bottom: 1px solid var(--gris-200);
    box-shadow: var(--sombra-sm);
    padding: 10px 0;
  }
  .main-nav.mobile-open ul { flex-direction: column; gap: 0; }
  .main-nav.mobile-open a {
    display: block;
    padding: 14px 24px;
    border-bottom: 1px solid var(--gris-100);
  }
  .main-nav.mobile-open .nav-cta {
    display: inline-flex;
    margin: 10px 24px 0;
  }

  .trust-bar .container { grid-template-columns: repeat(2, 1fr); gap: 26px; }
  .lineas-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .about-values { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .catalog-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .search-box { max-width: none; }
  .result-count { text-align: right; }
  .chip-row-wrap { margin-left: -24px; margin-right: -24px; }
  .chip-row { padding-left: 24px; padding-right: 24px; }
  .chip-row-wrap::before { left: 24px; }
  .chip-row-wrap::after { right: 24px; }
}

@media (max-width: 480px) {
  .lineas-grid { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .hero-copy p.lead { max-width: none; }
  .hero-badge { display: none; }
}

/* =========================================================
   Panel de administración — datos de contacto opcionales
   (WhatsApp / Teléfono / Dirección), inyectados por js/app.js
   solo cuando existen en site_settings. Reglas nuevas, no
   modifican las reglas de tarjetas de producto de arriba.
   ========================================================= */
.contact-extra {
  max-width: 640px;
  margin: 22px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
.contact-extra-item {
  color: var(--gris-600);
  font-size: 0.95rem;
}
.contact-extra-item strong { color: var(--negro); }
.contact-extra-item a { color: var(--verde); font-weight: 600; }
.contact-extra-item a:hover { text-decoration: underline; }

@media (max-width: 360px) {
  .hero-copy h1 { font-size: 1.9rem; }
  .lineas-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .container { padding: 0 16px; }
  .chip-row-wrap { margin-left: -16px; margin-right: -16px; }
  .chip-row { padding-left: 16px; padding-right: 16px; }
  .chip-row-wrap::before { left: 16px; }
  .chip-row-wrap::after { right: 16px; }
}
