/**
 * Homepage Styles - La Gráfica Tenerife
 * Estilos específicos para la homepage
 */

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.8) 0%, rgba(114, 9, 183, 0.7) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: var(--space-3xl) 0;
}

.hero-text {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  color: var(--color-white);
}

.hero-title {
  font-size: var(--text-5xl);
  font-weight: 800;
  margin-bottom: var(--space-lg);
  line-height: 1.1;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-highlight {
  background: linear-gradient(90deg, var(--color-yellow), var(--color-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2xl);
  opacity: 0.95;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  text-align: center;
  color: var(--color-white);
  animation: bounce 2s infinite;
}

.hero-scroll-indicator span {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 2px;
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 10px); }
}

/* ============================================
   CMYK LAYERS (Hero Animation)
   ============================================ */

.cmyk-layers {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  /* overflow: hidden eliminado — .hero-section ya tiene el suyo;
     quitarlo evita que los blobs CMYK queden recortados */
}

.cmyk-layers .layer {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  mix-blend-mode: color-dodge;
  filter: blur(40px);
  opacity: 0.6;
}

.cmyk-layers .layer.cyan {
  width: 400px;
  height: 400px;
  background-color: var(--color-cyan);
  margin-left: -200px;
  margin-top: -300px;
}

.cmyk-layers .layer.magenta {
  width: 350px;
  height: 350px;
  background-color: var(--color-magenta);
  margin-left: 100px;
  margin-top: -150px;
}

.cmyk-layers .layer.yellow {
  width: 380px;
  height: 380px;
  background-color: var(--color-yellow);
  margin-left: -250px;
  margin-top: 50px;
}

/* ============================================
   SERVICES SECTION
   ============================================ */

.services-section {
  padding: var(--space-3xl) 0;
  background: var(--bg-secondary);
  scroll-margin-top: 80px;
}

.section-header {
  margin-bottom: var(--space-3xl);
  text-align: center;
}

.section-title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-md);
  color: var(--color-black);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--gray-700); /* era gray-600 (#6c757d, 4.48:1) → gray-700 (#495057, 7:1 WCAG AA) */
  max-width: 600px;
  margin: 0 auto;
}

.services-filters {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
}

.services-filters .filter-btn,
.portfolio-filters .filter-btn {
  padding: var(--space-sm) var(--space-lg);
  border: 2px solid var(--gray-300);
  background: var(--card-bg);
  color: var(--gray-700);
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.services-filters .filter-btn:hover,
.services-filters .filter-btn.active,
.portfolio-filters .filter-btn:hover,
.portfolio-filters .filter-btn.active {
  background: var(--color-cyan);
  border-color: var(--color-cyan);
  color: var(--color-white);
  transform: translateY(-2px);
}

/* Focus visible para accesibilidad */
.services-filters .filter-btn:focus-visible,
.portfolio-filters .filter-btn:focus-visible {
  outline: 3px solid var(--color-cyan);
  outline-offset: 2px;
}

.services-grid {
  display: block; /* Desactivamos Grid para que Isotope tome el control */
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 !important;
}

.grid-sizer,
.service-card {
  width: 33.3%;
  box-sizing: border-box;
}

.service-card {
  padding: 12px;
  margin: 0 !important;
  /* Transición de opacity para el scroll-reveal y el filter de Isotope */
  transition: opacity 0.4s ease;
}

.service-card-inner {
  background: var(--card-bg);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  min-height: 480px; /* Altura mínima para alinear botones; permite crecer en mobile */
  display: flex;
  flex-direction: column;
}

.service-card-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-magenta));
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.service-card-inner:hover::before {
  transform: scaleX(1);
}

.service-card-inner:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto var(--space-md);
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--color-white);
  flex-shrink: 0;
}

.service-name {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
  color: var(--color-black);
}

.service-desc {
  color: var(--gray-600);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.service-link {
  margin-top: auto; /* Empuja el link al fondo */
  color: var(--color-cyan);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  transition: gap var(--transition-base);
  /* Stretched link: ::after cubre toda la tarjeta (el padre posicionado es .service-card-inner) */
}

.service-link::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.service-link:hover {
  gap: var(--space-sm);
}

/* ============================================
   COTIZADOR SECTION
   ============================================ */

.cotizador-section {
  padding: var(--space-3xl) 0;
  background: var(--bg-primary);
}

.cotizador-wrapper {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-secondary);
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.cotizador-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
  position: relative;
}

.cotizador-steps::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gray-300);
  z-index: 1;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  position: relative;
  z-index: 2;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-300);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all var(--transition-base);
}

.step.active .step-number,
.step.completed .step-number {
  background: var(--color-cyan);
  color: var(--color-white);
}

.step-label {
  font-size: var(--text-sm);
  color: var(--gray-600);
  font-weight: 600;
}

.step.active .step-label {
  color: var(--color-cyan);
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
}

.form-step h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-xl);
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.product-card {
  cursor: pointer;
  display: block;
}

.product-card input {
  display: none;
}

.product-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-xs);
  padding: var(--space-xl) var(--space-md);
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  height: 100%;
}

/* Icono circular del cotizador — mismo estilo que .service-icon */
.cotiz-cat-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-sm);
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  flex-shrink: 0;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  box-shadow: 0 4px 14px rgba(0, 180, 216, 0.25);
}
.product-card:hover .cotiz-cat-icon,
.product-card input:checked + .product-card-inner .cotiz-cat-icon {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 180, 216, 0.4);
}

.product-card-inner i {
  font-size: 36px;
  color: var(--color-cyan);
  margin-bottom: var(--space-xs);
}

.product-card-inner strong {
  font-size: var(--text-lg);
  color: var(--color-black);
  margin-bottom: 2px;
}

.product-card-inner small {
  font-size: var(--text-sm);
  color: var(--gray-600);
  font-weight: 400;
}

.product-card:hover .product-card-inner {
  border-color: var(--color-cyan);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.product-card input:checked + .product-card-inner {
  background: var(--color-cyan);
  border-color: var(--color-cyan);
}

.product-card input:checked + .product-card-inner i,
.product-card input:checked + .product-card-inner strong,
.product-card input:checked + .product-card-inner small {
  color: var(--color-white);
}

.quantity-selector {
  text-align: center;
}

.quantity-selector label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  font-size: var(--text-lg);
}

.quantity-selector input {
  width: 120px;
  padding: var(--space-sm);
  font-size: var(--text-xl);
  text-align: center;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
}

.quantity-presets {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.qty-preset {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-white);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

.qty-preset:hover {
  background: var(--color-cyan);
  border-color: var(--color-cyan);
  color: var(--color-white);
}

.price-estimate {
  margin-top: var(--space-2xl);
  padding: var(--space-xl);
  background: var(--color-white);
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.estimate-label {
  font-size: var(--text-sm);
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-xs);
}

.price-range {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
}

.price-min, .price-max {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-black);
}

.price-min small, .price-max small {
  display: block;
  font-size: 0.5em;
  color: var(--gray-500);
  text-transform: uppercase;
  line-height: 1;
}

.price-min {
  color: var(--gray-900);
}

.price-max {
  color: var(--color-cyan);
}

.price-separator {
  color: var(--gray-300);
  font-size: 24px;
}

.price-note {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-bottom: var(--space-md);
  font-style: italic;
}

.tech-recommendation-box .tech-alert {
  animation: fadeIn 0.5s ease-out;
}

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

.qty-preset.active {
  background: var(--color-cyan);
  color: var(--color-white);
  border-color: var(--color-cyan);
}

/* ── Cotizador v2: Tier options (bolígrafos/llaveros) ── */
.tier-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.tier-option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  background: var(--card-bg);
}

.tier-option input[type="radio"] {
  accent-color: var(--color-cyan);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tier-option span {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.tier-option span small {
  color: var(--text-secondary);
  margin-left: 4px;
}

.tier-option.active,
.tier-option:hover {
  border-color: var(--color-cyan);
  background: rgba(0, 180, 216, 0.06);
}

/* ── Cotizador v2: Info boxes ── */
.cotiz-info-box {
  padding: 14px 16px;
  background: rgba(0, 180, 216, 0.07);
  border-left: 4px solid var(--color-cyan);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.cotiz-info-box--warning {
  background: rgba(255, 214, 10, 0.1);
  border-left-color: var(--color-yellow);
}

.cotiz-info-box small {
  color: var(--text-secondary);
}

/* ── Cotizador v2: Nota informativa bajo campos ── */
.cotiz-note {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: var(--space-sm);
  margin-bottom: 0;
}

.cotiz-note .fas {
  color: var(--color-cyan);
  margin-right: 4px;
}

/* ── Cotizador v2: Grid de categorías — más compacto ── */
#cotizador-step1 .product-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-md);
}

#cotizador-step1 .product-card-inner {
  padding: var(--space-md) var(--space-sm);
}

#cotizador-step1 .product-card-inner i {
  font-size: 28px;
}

.form-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2xl);
  gap: var(--space-md);
}

.form-navigation .btn {
  flex: 1;
}

/* ============================================
   PORTFOLIO SECTION
   ============================================ */

.portfolio-section {
  padding: var(--space-3xl) 0;
  scroll-margin-top: 80px;
}

.portfolio-filters {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
}

.portfolio-grid {
  display: block; /* Isotope toma el control del layout */
  position: relative; /* requerido por Isotope absolute positioning */
  width: 100%;
  max-width: 1200px;
  margin: 0 auto var(--space-2xl);
}

.portfolio-cta {
  margin-top: 10px;
}

/* Aviso legal al pie del cotizador */
.cotizador-disclaimer {
  margin-top: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: rgba(0, 180, 216, 0.06);
  border-left: 3px solid var(--color-cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--text-sm);
  color: var(--gray-600);
  line-height: 1.5;
}
.cotizador-disclaimer i {
  color: var(--color-cyan);
  margin-right: 6px;
}
[data-theme="dark"] .cotizador-disclaimer {
  background: rgba(0, 180, 216, 0.08);
  color: var(--text-secondary);
}

/* grid-sizer: define el ancho de COLUMNA para Isotope (sin padding) */
.portfolio-grid .grid-sizer {
  width: 33.333%;
}

/* ─── Items del portfolio (Home: Isotope) ─── */
.portfolio-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 4 / 3;
}

/* Wrapper interno */
.portfolio-item-inner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #1a1a1a;
}

/* ─── Portfolio PAGE: CSS Grid sin Isotope ─── */
.lg-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.lg-portfolio-grid .portfolio-item {
  position: relative; /* CSS Grid controla el layout */
  width: auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
}

.lg-portfolio-grid .portfolio-item.filter-hidden {
  display: none;
}

@media (max-width: 768px) {
  .lg-portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .lg-portfolio-grid {
    grid-template-columns: 1fr;
  }
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-slow);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.9), rgba(114, 9, 183, 0.9));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  transition: opacity var(--transition-base);
  color: var(--color-white);
  text-align: center;
}

.portfolio-item:hover img {
  transform: scale(1.08);
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-item-inner:hover img {
  transform: scale(1.08);
}

.portfolio-item-inner:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay h4 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

.portfolio-overlay p {
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
  opacity: 0.9;
}

.portfolio-link {
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-white);
  color: var(--color-cyan);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-base);
}

.portfolio-link:hover {
  background: var(--color-yellow);
  color: var(--color-black);
}

/* ============================================
   PROCESO SECTION
   ============================================ */

.proceso-section {
  padding: var(--space-3xl) 0;
  background: var(--color-black);
  color: var(--color-white);
}

.proceso-section .section-title,
.proceso-section .section-subtitle {
  color: var(--color-white);
}

.proceso-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
}

.proceso-step {
  text-align: center;
}

.step-icon {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-lg);
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

/* Renombrado de .step-number → .paso-badge para evitar conflicto con cotizador */
.paso-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 40px;
  height: 40px;
  background: var(--color-magenta);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-white);
}

.step-content h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-sm);
  color: var(--color-cyan);
}

.step-content p {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

/* ============================================
   TESTIMONIOS SECTION
   ============================================ */

.testimonios-section {
  padding: var(--space-3xl) 0;
  background: var(--bg-secondary);
}

.testimonios-slider {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.testimonio-card {
  background: var(--card-bg);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.testimonio-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.testimonio-stars {
  color: var(--color-yellow);
  font-size: 20px;
  margin-bottom: var(--space-md);
}

.testimonio-text {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--gray-700);
  margin-bottom: var(--space-lg);
  font-style: italic;
}

.testimonio-author strong {
  display: block;
  color: var(--color-black);
  margin-bottom: var(--space-xs);
}

.testimonio-author span {
  color: var(--gray-600);
  font-size: var(--text-sm);
}

/* Wrapper del plugin Trustindex — integración visual */
.testimonios-plugin-wrapper {
  margin-bottom: var(--space-2xl);
  /* Normalizar tipografía y colores del widget al design system */
  font-family: var(--font-body) !important;
}

/* Anular colores del widget para respetar brand colors */
.testimonios-plugin-wrapper .ti-widget a,
.testimonios-plugin-wrapper .ti-widget {
  font-family: var(--font-body) !important;
}

/* ============================================
   FAQ SECTION
   ============================================ */

.faq-section {
  padding: var(--space-3xl) 0;
}

.faq-accordion {
  max-width: 800px;
  margin: 0 auto;
}

/* Eliminado bloque redundante de .service-card */

.faq-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: var(--space-lg);
  background: transparent;
  border: none;
  text-align: left;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-black);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-base);
}

.faq-question:hover {
  color: var(--color-cyan);
}

.faq-question i {
  transition: transform var(--transition-base);
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer p {
  padding: 0 var(--space-lg) var(--space-lg);
  color: var(--gray-700);
  line-height: 1.6;
}

/* ============================================
   CTA FINAL SECTION
   ============================================ */

.cta-final-section {
  padding: var(--space-3xl) 0;
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  color: var(--color-white);
}

.cta-title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-md);
}

.cta-subtitle {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2xl);
  opacity: 0.95;
}

.cta-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet (hasta 1024px) - Mantenemos 3 columnas para aprovechar el espacio */
@media (max-width: 1024px) {
  .service-card {
    width: 33.3%;
  }

  /* Portfolio: JS gestiona columnas vía offsetWidth */
}

/* Mobile (hasta 768px) */
@media (max-width: 768px) {
  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

  .hero-cta-group {
    flex-direction: column;
  }

  .service-card {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  /* Portfolio: ancho gestionado por JS en resize */

  .cotizador-wrapper {
    padding: var(--space-lg);
  }

  /* Cotizador steps: ocultar labels en móvil para ahorrar espacio */
  .cotizador-steps .step-label {
    font-size: 0.65rem;
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: var(--text-sm);
  }

  .service-options {
    grid-template-columns: 1fr;
  }

  .proceso-timeline {
    grid-template-columns: 1fr;
  }

  .cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .cta-buttons .btn {
    width: 100%;
  }
}


/* ============================================
   DARK MODE — Overrides homepage
   Secciones que usan colores hardcoded o var(--color-black)
   y necesitan override explícito para el modo oscuro.
   ============================================ */

/* Textos hardcoded a var(--color-black) — override para dark mode */
[data-theme="dark"] .service-name {
  color: var(--text-heading) !important;
}
[data-theme="dark"] .service-desc {
  color: var(--text-secondary);
}
[data-theme="dark"] .product-card-inner strong {
  color: var(--text-heading) !important;
}
[data-theme="dark"] .price-min,
[data-theme="dark"] .price-max {
  color: var(--text-heading) !important;
}
[data-theme="dark"] .testimonio-author strong {
  color: var(--text-heading) !important;
}

/* Tarjetas de servicio — borde sutil en dark (no agresivo) */
[data-theme="dark"] .service-card-inner {
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

/* ─── Dark mode: Página de portfolio ─── */
.portfolio-gallery-section {
  background: var(--bg-primary);
  transition: background 0.3s;
}
[data-theme="dark"] .portfolio-gallery-section {
  background: var(--bg-primary);
}
[data-theme="dark"] .portfolio-hero {
  background: var(--bg-secondary) !important;
}
[data-theme="dark"] .portfolio-hero h1 {
  /* cmyk-text se mantiene, no necesita override */
}
[data-theme="dark"] .portfolio-hero p {
  color: var(--text-secondary);
}

/* ─── Dark mode: Sección Portfolio home ("Nuestro Trabajo") ─── */
[data-theme="dark"] .portfolio-section {
  background: var(--bg-primary);
}
[data-theme="dark"] .portfolio-section .section-title,
[data-theme="dark"] .portfolio-section .section-subtitle {
  color: var(--text-heading);
}
[data-theme="dark"] .portfolio-filters .filter-btn,
[data-theme="dark"] .services-filters .filter-btn {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--card-bg);
}
[data-theme="dark"] .portfolio-filters .filter-btn.active,
[data-theme="dark"] .portfolio-filters .filter-btn:hover,
[data-theme="dark"] .services-filters .filter-btn.active,
[data-theme="dark"] .services-filters .filter-btn:hover {
  border-color: var(--color-cyan);
  background: var(--color-cyan);
  color: var(--color-white);
}

/* FAQ — texto hardcoded a var(--color-black) */
[data-theme="dark"] .faq-section {
  background: var(--bg-primary);
}
[data-theme="dark"] .faq-section .section-title,
[data-theme="dark"] .faq-section .section-subtitle {
  color: var(--text-heading);
}
[data-theme="dark"] .faq-item {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
[data-theme="dark"] .faq-question {
  color: var(--text-heading);
}
[data-theme="dark"] .faq-answer p {
  color: var(--text-secondary);
}

/* Cotizador — fondos y textos hardcoded */
[data-theme="dark"] .cotizador-section {
  background: var(--bg-secondary);
}
[data-theme="dark"] .cotizador-wrapper {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
[data-theme="dark"] .cotizador-wrapper h2,
[data-theme="dark"] .cotizador-wrapper h3,
[data-theme="dark"] .cotizador-wrapper label {
  color: var(--text-heading);
}
[data-theme="dark"] .cotizador-wrapper p,
[data-theme="dark"] .cotizador-wrapper .step-description {
  color: var(--text-primary);
}

/* Tarjetas de categoría del cotizador en dark mode */
[data-theme="dark"] .product-card-inner {
  background: var(--card-bg);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .product-card-inner small {
  color: var(--text-secondary);
}
[data-theme="dark"] .product-card:hover .product-card-inner {
  border-color: rgba(0, 180, 216, 0.4);
  background: rgba(0, 180, 216, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .product-card input:checked + .product-card-inner {
  background: var(--color-cyan);
  border-color: var(--color-cyan);
}
[data-theme="dark"] .product-card input:checked + .product-card-inner strong,
[data-theme="dark"] .product-card input:checked + .product-card-inner small {
  color: #fff;
}
/* Inputs, selects y áreas de config en dark */
[data-theme="dark"] .cotizador-wrapper select,
[data-theme="dark"] .cotizador-wrapper input[type="number"],
[data-theme="dark"] .cotizador-wrapper input[type="text"] {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .cotiz-info-box {
  background: rgba(0, 180, 216, 0.1);
  border-color: rgba(0, 180, 216, 0.3);
  color: var(--text-primary);
}
[data-theme="dark"] .cotiz-info-box--warning {
  background: rgba(255, 190, 11, 0.1);
  border-color: rgba(255, 190, 11, 0.3);
  color: var(--text-primary);
}
[data-theme="dark"] .qty-preset {
  background: var(--bg-primary);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}
[data-theme="dark"] .qty-preset.active {
  background: var(--color-cyan);
  border-color: var(--color-cyan);
  color: #fff;
}
[data-theme="dark"] .tier-option {
  background: var(--bg-primary);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}
[data-theme="dark"] .tier-option:has(input:checked) {
  background: rgba(0, 180, 216, 0.12);
  border-color: var(--color-cyan);
}

/* ============================================
   SCROLL ANIMATIONS - IntersectionObserver
   Scoped a #homepage para no afectar otras páginas.
   CSS carga antes que JS, así los elementos empiezan
   ocultos sin depender del timing de AOS.
   ============================================ */

#homepage [data-aos],
#homepage .lg-animate {
    opacity: 0;
    transform: translateY(55px);
    transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

#homepage [data-aos].anim-visible,
#homepage .lg-animate.anim-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
