/**
 * Alfaler Theme — Main Stylesheet
 * Design System: industrial internacional, sobria, acento cálido
 */

/* ========== RESET BASE ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--alf-font-body, 'Inter', sans-serif);
  font-size: var(--alf-body, 1rem);
  line-height: var(--alf-lh-body, 1.6);
  color: var(--alf-ink, #1E2528);
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--alf-navy, #0B3C49);
  text-decoration: none;
  transition: color var(--alf-transition, 150ms ease);
}
a:hover, a:focus {
  color: var(--alf-amber, #F2A33C);
}
a:focus-visible {
  outline: 2px solid var(--alf-amber, #F2A33C);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ========== TIPOGRAFÍA ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--alf-font-head, 'Space Grotesk', sans-serif);
  line-height: var(--alf-lh-head, 1.15);
  font-weight: 600;
  color: var(--alf-ink, #1E2528);
}

h1 { font-size: var(--alf-h1, clamp(2rem, 4vw, 3.25rem)); }
h2 { font-size: var(--alf-h2, clamp(1.5rem, 3vw, 2.25rem)); }
h3 { font-size: var(--alf-h3, clamp(1.25rem, 2vw, 1.625rem)); }
h4 { font-size: var(--alf-h4, 1.25rem); }

p { margin-bottom: 1rem; }

/* ========== UTILIDADES ========== */
.alf-contenedor {
  width: 100%;
  max-width: var(--alf-contenedor-max, 1240px);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--alf-section-pad-x, clamp(1rem, 4vw, 2rem));
  padding-right: var(--alf-section-pad-x, clamp(1rem, 4vw, 2rem));
}

.alf-seccion {
  padding-top: var(--alf-section-pad-y, clamp(3rem, 6vw, 7.5rem));
  padding-bottom: var(--alf-section-pad-y, clamp(3rem, 6vw, 7.5rem));
}

.alf-fondo-ivory { background-color: var(--alf-ivory, #FAF7F2); }
.alf-fondo-navy { background-color: var(--alf-navy, #0B3C49); color: #fff; }
.alf-fondo-navy h1, .alf-fondo-navy h2, .alf-fondo-navy h3, .alf-fondo-navy p { color: #fff; }

.alf-texto-centrado { text-align: center; }
.alf-texto-izquierda { text-align: left; }

/* ========== BOTONES ========== */
.alf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--alf-font-head, 'Space Grotesk', sans-serif);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  border-radius: var(--alf-radius-btn, 8px);
  border: none;
  cursor: pointer;
  transition: all var(--alf-transition, 150ms ease);
  text-decoration: none;
  min-height: 48px;
}

.alf-btn--primario {
  background-color: var(--alf-amber, #F2A33C);
  color: var(--alf-ink, #1E2528);
}
.alf-btn--primario:hover, .alf-btn--primario:focus {
  filter: brightness(0.96);
  box-shadow: var(--alf-shadow-hover, 0 12px 32px rgba(11,60,73,.12));
  color: var(--alf-ink, #1E2528);
}

.alf-btn--secundario {
  background-color: transparent;
  color: var(--alf-navy, #0B3C49);
  border: 1.5px solid var(--alf-navy, #0B3C49);
}
.alf-btn--secundario:hover, .alf-btn--secundario:focus {
  background-color: var(--alf-navy, #0B3C49);
  color: #fff;
}

.alf-btn--terciario {
  background-color: transparent;
  color: var(--alf-navy, #0B3C49);
  padding-left: 0;
  padding-right: 0;
}
.alf-btn--terciario::after {
  content: '→';
  margin-left: 0.25rem;
  transition: transform var(--alf-transition, 150ms ease);
}
.alf-btn--terciario:hover::after {
  transform: translateX(4px);
}

/* ========== HEADER ========== */
.alf-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--alf-gray-200, #E8E6E1);
}
.alf-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.alf-logo img {
  height: 44px;
  width: auto;
}

.alf-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}
.alf-nav a {
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--alf-ink, #1E2528);
}
.alf-nav a:hover, .alf-nav a:focus {
  color: var(--alf-amber, #F2A33C);
}

.alf-header__cta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ========== HERO ========== */
.alf-hero {
  position: relative;
  overflow: hidden;
}
.alf-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.alf-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.alf-hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 60, 73, 0.70);
  z-index: 1;
}
.alf-hero__content {
  position: relative;
  z-index: 2;
  padding-top: clamp(4rem, 10vw, 8rem);
  padding-bottom: clamp(4rem, 10vw, 8rem);
  color: #fff;
  text-align: center;
}
.alf-hero__content h1 {
  color: #fff;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.alf-hero__content p {
  color: rgba(255,255,255,0.85);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.125rem;
}
.alf-hero__ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ========== PRODUCTO HERO ========== */
.alf-producto-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.alf-producto-hero__media img {
  border-radius: var(--alf-radius-img, 16px);
  width: 100%;
}
.alf-producto-hero__placeholder {
  aspect-ratio: 4/3;
  background: var(--alf-gray-100, #F5F4F1);
  border-radius: var(--alf-radius-img, 16px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.alf-producto-hero__placeholder span {
  font-family: var(--alf-font-head, 'Space Grotesk', sans-serif);
  font-size: 1.5rem;
  color: var(--alf-gray-400, #B5B3AD);
}

/* ========== GRID CATEGORÍAS ========== */
.alf-grid-categorias {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--alf-grid-gap, 1.5rem);
}

/* ========== CARDS ========== */
.alf-card {
  background: #fff;
  border-radius: var(--alf-radius-card, 10px);
  border: 1px solid var(--alf-gray-200, #E8E6E1);
  overflow: hidden;
  transition: all var(--alf-transition, 150ms ease);
}
.alf-card:hover {
  box-shadow: var(--alf-shadow, 0 8px 24px rgba(11,60,73,.08));
  border-color: var(--alf-amber, #F2A33C);
}
.alf-card__img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--alf-gray-100, #F5F4F1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.alf-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--alf-transition-slow, 250ms ease);
}
.alf-card:hover .alf-card__img img {
  transform: scale(1.03);
}
.alf-card__body {
  padding: 1.25rem;
}
.alf-card__title {
  font-family: var(--alf-font-head, 'Space Grotesk', sans-serif);
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}
.alf-card__code {
  font-size: var(--alf-caption, 0.875rem);
  color: var(--alf-gray-500, #8A8F94);
  margin-bottom: 0.75rem;
}
.alf-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.alf-chip {
  font-size: var(--alf-small, 0.75rem);
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  background: var(--alf-gray-100, #F5F4F1);
  border-radius: 4px;
  color: var(--alf-gray-700, #4A5257);
}

/* ========== TABLA DE ESPECS ========== */
.alf-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--alf-caption, 0.875rem);
}
.alf-specs-table thead th {
  background: var(--alf-navy, #0B3C49);
  color: #fff;
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
}
.alf-specs-table tbody tr:nth-child(even) {
  background: var(--alf-gray-100, #F5F4F1);
}
.alf-specs-table tbody td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--alf-gray-200, #E8E6E1);
}

/* ========== FAQ ACORDEÓN ========== */
.alf-faq__item {
  border-bottom: 1px solid var(--alf-gray-200, #E8E6E1);
}
.alf-faq__question {
  width: 100%;
  text-align: left;
  padding: 1.25rem 0;
  background: none;
  border: none;
  font-family: var(--alf-font-head, 'Space Grotesk', sans-serif);
  font-weight: 600;
  font-size: 1.0625rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--alf-ink, #1E2528);
}
.alf-faq__question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--alf-amber, #F2A33C);
  transition: transform var(--alf-transition, 150ms ease);
}
.alf-faq__question[aria-expanded="true"]::after {
  content: '−';
}
.alf-faq__answer {
  padding-bottom: 1.25rem;
  color: var(--alf-gray-700, #4A5257);
  line-height: 1.7;
}
.alf-faq__answer[hidden] {
  display: none;
}

/* ========== BREADCRUMBS ========== */
.alf-breadcrumbs {
  font-size: var(--alf-caption, 0.875rem);
  color: var(--alf-gray-500, #8A8F94);
  margin-bottom: 1.5rem;
}
.alf-breadcrumbs a {
  color: var(--alf-gray-600, #6A6F74);
}
.alf-breadcrumbs .bc-sep {
  margin: 0 0.5rem;
  color: var(--alf-gray-400, #B5B3AD);
}

/* ========== FOOTER ========== */
.alf-footer {
  background: var(--alf-navy, #0B3C49);
  color: rgba(255,255,255,0.75);
  padding-top: 4rem;
  padding-bottom: 2rem;
}
.alf-footer a {
  color: rgba(255,255,255,0.75);
}
.alf-footer a:hover {
  color: var(--alf-amber, #F2A33C);
}
.alf-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}
.alf-footer__title {
  font-family: var(--alf-font-head, 'Space Grotesk', sans-serif);
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1rem;
}
.alf-footer__links {
  list-style: none;
}
.alf-footer__links li {
  margin-bottom: 0.5rem;
}
.alf-footer__legal {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: var(--alf-small, 0.75rem);
  color: rgba(255,255,255,0.5);
}

/* ========== CTA FINAL ========== */
.alf-cta-final {
  text-align: center;
}
.alf-cta-final__buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.alf-cta-final__promesa {
  font-size: var(--alf-caption, 0.875rem);
  color: var(--alf-gray-500, #8A8F94);
  margin-top: 0.75rem;
}

/* ========== FORMULARIOS ========== */
.alf-form label {
  display: block;
  font-weight: 500;
  font-size: var(--alf-caption, 0.875rem);
  margin-bottom: 0.375rem;
  color: var(--alf-ink, #1E2528);
}
.alf-form input,
.alf-form textarea,
.alf-form select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--alf-gray-300, #D8D6D1);
  border-radius: var(--alf-radius-btn, 8px);
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  transition: border-color var(--alf-transition, 150ms ease);
}
.alf-form input:focus,
.alf-form textarea:focus,
.alf-form select:focus {
  outline: none;
  border-color: var(--alf-amber, #F2A33C);
}
.alf-form__row {
  margin-bottom: 1rem;
}

/* ========== NOTIFICACIONES TDS ========== */
.alf-tds-notice {
  padding: 1rem 1.25rem;
  border-radius: var(--alf-radius-btn, 8px);
  margin-bottom: 1rem;
  font-size: var(--alf-caption, 0.875rem);
  line-height: 1.5;
}
.alf-tds-notice--exito {
  background: rgba(46, 139, 87, 0.08);
  border: 1px solid var(--alf-success, #2E8B57);
  color: #1a5c38;
}
.alf-tds-notice--error {
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid var(--alf-error, #C0392B);
  color: #8b241a;
}

/* ========== BOTÓN FLOTANTE WHATSAPP ========== */
.alf-whatsapp-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 102;
  width: 56px;
  height: 56px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  transition: all var(--alf-transition, 150ms ease);
}
.alf-whatsapp-btn:hover,
.alf-whatsapp-btn:focus {
  background: #1DA851;
  transform: scale(1.05);
  color: #fff;
}

/* ========== ANIMACIONES DE ENTRADA ========== */
.alf-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 300ms ease, transform 300ms ease;
}
.alf-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .alf-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ========== LAZY LOADING ========== */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 300ms ease;
}
img[loading="lazy"].loaded,
img[loading="lazy"][src] {
  opacity: 1;
}

/* ========== SCREEN READER ========== */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== MENÚ HAMBURGUESA ========== */
.alf-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.alf-menu-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--alf-navy, #0B3C49);
  border-radius: 2px;
  transition: all 200ms ease;
}
.alf-menu-toggle[aria-expanded="true"] .alf-menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.alf-menu-toggle[aria-expanded="true"] .alf-menu-toggle__bar:nth-child(2) {
  opacity: 0;
}
.alf-menu-toggle[aria-expanded="true"] .alf-menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========== BARRA INFERIOR MÓVIL ========== */
.alf-mobile-bar {
  display: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .alf-header__inner {
    height: 64px;
  }
  .alf-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    padding: 2rem;
    transform: translateX(100%);
    transition: transform 250ms ease;
    z-index: 99;
    overflow-y: auto;
  }
  .alf-nav.is-open {
    transform: translateX(0);
  }
  .alf-nav ul {
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
  }
  .alf-nav a {
    font-size: 1.25rem;
    padding: 0.5rem 0;
    display: block;
    min-height: 44px;
  }
  .alf-hide-mobile {
    display: none !important;
  }
  .alf-producto-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .alf-hero__content h1 {
    display: none !important;
  }
  .alf-hero__content h1 {
    font-size: 1.75rem;
  }
  .alf-grid-categorias {
    grid-template-columns: 1fr;
  }
  .alf-footer__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .alf-menu-toggle {
    display: flex;
  }
  .alf-mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 101;
    background: #fff;
    border-top: 1px solid var(--alf-gray-200, #E8E6E1);
    padding: 0.5rem 1rem;
    gap: 0.75rem;
    box-shadow: 0 -4px 16px rgba(11,60,73,0.06);
  }
  .alf-mobile-bar a {
    flex: 1;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9375rem;
  }
  .alf-mobile-bar .alf-btn--whatsapp {
    background: #25D366;
    color: #fff;
    border-radius: var(--alf-radius-btn, 8px);
  }
  .alf-mobile-bar .alf-btn--whatsapp:hover {
    background: #1DA851;
    color: #fff;
  }
  body {
    padding-bottom: 70px;
  }
  .alf-whatsapp-btn {
    display: none;
  }
  .alf-btn {
    min-height: 48px;
    min-width: 48px;
  }
}

@media (max-width: 480px) {
  .alf-hero__content {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  .alf-hero__content h1 {
    font-size: 1.5rem;
  }
  .alf-hero__content p {
    font-size: 1rem;
  }
  .alf-btn {
    width: 100%;
  }
  .alf-cta-final__buttons {
    flex-direction: column;
  }
  .alf-cta-final__buttons .alf-btn {
    width: 100%;
  }
  .alf-specs-table {
    font-size: 0.8125rem;
  }
  .alf-specs-table thead th,
  .alf-specs-table tbody td {
    padding: 0.5rem 0.625rem;
  }
}
