/* ============================================================
   LAPEN Córdoba · Diseño Profesional Minimalista Moderno
   Paleta de marca refinada con mejor contraste y profundidad
   ============================================================ */
:root {
  /* Colores de Marca */
  --brand: #9d1b1f;          /* rojo LAPEN CÓRDOBA refinado */
  --brand-600: #800000;
  --brand-700: #6b0000;
  --brand-800: #570000;
  --brand-soft: #fef5f5;
  --brand-tint: #fbe8e8;
  --brand-light: #fff5f5;
  --gold: #d4a574;            /* acento cálido dorado */
  --gold-dark: #b98a2e;
  
  /* Neutrales refinados */
  --ink: #1a1a1a;
  --ink-2: #525252;
  --ink-3: #737373;
  --ink-muted: #767676;
  --ink-light: #a3a3a3;
  --line: #e5e5e5;
  --line-dark: #d4d4d4;
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-warm: #fef9f3;
  --bg-grey: #f5f5f5;

  /* Shared layout and rhythm */
  --container-width: 1200px;
  --container-gutter: 32px;
  --reading-width: 68ch;
  --section-space: 6.25rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-11: 2.75rem;
  --space-12: 3rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  
  /* Bordes y sombras mejoradas */
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-1: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-2: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-3: 0 12px 32px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --shadow-4: 0 20px 48px rgba(0,0,0,.16), 0 8px 16px rgba(0,0,0,.08);
  
  /* Animaciones */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================================
   BASE STYLES
   ============================================================ */
* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

html { 
  scroll-behavior: smooth; 
  scrollbar-gutter: stable;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1;
  overflow-x: hidden;
}

a { 
  color: var(--brand); 
  text-decoration: none; 
  transition: color var(--transition-fast);
}

a:hover { 
  color: var(--brand-600); 
}

img { 
  max-width: 100%; 
  display: block; 
  height: auto;
}

.container { 
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto; 
  padding: 0 var(--container-gutter);
}

.reading-width { max-width: var(--reading-width); }
.icon {
  display: inline-block;
  flex: 0 0 auto;
  color: currentColor;
  vertical-align: middle;
}
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.brand-mark {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.card-placeholder {
  display: grid;
  place-items: center;
  background: var(--brand-soft);
}
.card-placeholder .brand-mark { width: 76px; height: 76px; }
.department-mark { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; }
.department-mark .brand-mark { width: 52px; height: 52px; }
.page-title {
  margin: 0 0 1.25rem;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.site-main { flex: 1 0 auto; padding-block-end: var(--space-8); }

.flash-container { margin-block: var(--space-6); }

.muted { 
  color: var(--ink-2); 
}

/* Animaciones de entrada */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.animate-in {
  animation: fadeIn .22s ease-out both;
}

.animate-scale {
  animation: fadeInScale .22s ease-out both;
}

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

/* ============================================================
   HEADER - Diseño flotante minimalista
   ============================================================ */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky; 
  top: 0; 
  z-index: 100;
  transition: all var(--transition-base);
}

.site-header:hover {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-1);
}

.nav {
  display: flex; 
  align-items: center; 
  gap: var(--space-6);
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto; 
  padding: var(--space-3) var(--container-gutter);
  flex-wrap: nowrap;
}

.brand { 
  display: flex; 
  align-items: center; 
  gap: var(--space-3);
  margin-right: auto;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.brand:hover {
  transform: translateY(-1px);
}

.brand img { 
  height: 48px; 
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
  transition: filter var(--transition-fast);
}

.brand:hover img {
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
}

.brand .brand-name { 
  font-weight: 700; 
  font-size: 1.1rem; 
  letter-spacing: 0;
  color: var(--ink); 
  line-height: 1.2; 
  white-space: nowrap;
}

.brand .brand-name small { 
  display: block; 
  font-weight: 500; 
  font-size: 0.7rem; 
  color: var(--ink-3);
  letter-spacing: 0.02em; 
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-links { 
  display: flex; 
  align-items: center; 
  gap: var(--space-1);
}

.nav-links > a,
.nav-links > .dropdown > .drop-btn,
.nav-links .user-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  position: relative;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-links > a::after,
.nav-links > .dropdown > .drop-btn::after {
  content: '';
  position: absolute;
  bottom: var(--space-1);
  left: var(--space-3);
  right: var(--space-3);
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform var(--transition-fast);
}

.nav-links > a:hover,
.nav-links > .dropdown > .drop-btn:hover,
.nav-links .user-menu-btn:hover,
.nav-links > a:focus-visible,
.nav-links > .dropdown > .drop-btn:focus-visible,
.nav-links .user-menu-btn:focus-visible {
  color: var(--brand);
}

.nav-links > a:hover::after,
.nav-links > .dropdown > .drop-btn:hover::after,
.nav-links > a:focus-visible::after,
.nav-links > .dropdown > .drop-btn:focus-visible::after {
  transform: scaleX(1);
}

.nav-links > a.nav-active,
.nav-links > .dropdown.nav-active > .drop-btn,
.nav-links .user-menu.open > .user-menu-btn {
  color: var(--brand);
}
.nav-links > a.nav-active::after,
.nav-links > .dropdown.nav-active > .drop-btn::after {
  transform: scaleX(1);
}

.nav-links a.btn-admin {
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  color: #fff; 
  border-radius: 12px;
  padding: 10px 20px; 
  font-weight: 700;
  box-shadow: var(--shadow-1);
  border: none;
}

/* Hamburger icon */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger-line {
  display: block;
  width: 100%;
  height: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.3s;
}

/* Separator and login in nav */
.nav-separator {
  width: 1px;
  height: 24px;
  background: var(--line-dark);
  margin: 0 4px;
}
.nav-login-link {
  color: var(--ink-2) !important;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 16px;
  border-radius: 10px;
  transition: all var(--transition-fast);
  position: relative;
}
.nav-login-link:hover {
  background: var(--brand-light);
  color: var(--brand) !important;
}

/* ============================================================
   USER MENU (hamburger dropdown)
   ============================================================ */
.user-menu {
  position: relative;
}
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.user-name-desktop {
  font-size: var(--text-sm);
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
}
.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  border: 1px solid var(--line);
  padding: 8px 0;
  z-index: 1000;
  animation: fadeIn .2s var(--transition-base);
}
.user-menu.open .user-dropdown {
  display: block;
}
.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.user-avatar-lg {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.user-dropdown-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--ink);
}
.user-dropdown-email {
  font-size: .8rem;
  color: var(--ink-3);
}
.user-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.user-dropdown-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-muted);
  padding: 8px 16px 4px;
}
.user-dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: .9rem;
  color: var(--ink) !important;
  text-decoration: none !important;
  transition: all var(--transition-fast);
}
.user-dropdown-link:hover {
  background: var(--brand-light);
  color: var(--brand) !important;
}
.user-dropdown-logout {
  color: var(--danger) !important;
}
.user-dropdown-logout:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}
.user-role-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand);
  margin-top: 2px;
}
.user-login-form {
  padding: 0 16px;
}
.user-login-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .88rem;
  background: var(--bg);
  margin-bottom: 8px;
  outline: none;
  transition: border-color var(--transition-fast);
}
.user-login-form input:focus {
  border-color: var(--brand);
}
.user-login-form .btn {
  padding: 10px 16px;
  font-size: .88rem;
}

.nav-links a.btn-admin:hover {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}

.nav-links a.btn-admin::after {
  display: none;
}

.cart-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px; 
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  color: #fff;
  border-radius: 999px; 
  font-size: 0.7rem; 
  padding: 2px 7px;
  min-width: 20px;
  height: 20px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(157, 27, 31, 0.3);
  animation: fadeInScale .22s ease-out both;
}

/* ============================================================
   DROPDOWN - Mejorado con animaciones
   ============================================================ */
.dropdown { 
  position: relative; 
}

.dropdown .drop-btn { appearance: none; }

.nav-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition-fast);
}

.dropdown.is-open > .drop-btn .nav-chevron,
.user-menu.open > .user-menu-btn .nav-chevron { transform: rotate(225deg) translate(-1px, -1px); }

.dropdown-menu {
  display: none; 
  position: absolute; 
  top: calc(100% + 4px);
  left: 0; 
  min-width: 220px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-3);
  padding: 8px; 
  z-index: 200;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

/* pseudo-elemento puente: evita que el mouse pierda hover al cruzar la gap */
.dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 12px;
  background: transparent;
}

.dropdown:hover .dropdown-menu, 
.dropdown.is-open .dropdown-menu { 
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-menu a { 
  display: block; 
  color: var(--ink-2) !important; 
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: 600; 
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.dropdown-menu a:hover { 
  background: var(--brand-light);
  color: var(--brand) !important;
  transform: translateX(4px);
}

/* ============================================================
   HERO - Banner principal con slideshow de fondo
   ============================================================ */
.hero {
  position: relative;
  color: #fff;
  overflow: hidden;
  padding: 140px 0 160px;
  text-align: center;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Slideshow de fondo --- */
.hero-slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  transform: scale(1.04);
  transition: opacity 1.2s ease-in-out, transform 8s ease-out;
  will-change: opacity, transform;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}
#heroSlideshow .hero-slide:first-child.active {
  transition: none;
}
.hero-slide picture,
.hero-slide picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-slide picture img { object-fit: cover; }

/* Fallback gradient si no hay imágenes */
.hero-slideshow:empty {
  background: linear-gradient(135deg, #1a0404 0%, var(--brand-800) 30%, var(--brand) 70%, var(--brand-600) 100%);
}

/* --- Overlay oscuro sobre las fotos --- */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom, rgba(10, 0, 0, 0.55) 0%, rgba(100, 0, 0, 0.45) 50%, rgba(10, 0, 0, 0.65) 100%);
}

/* Sin imágenes: overlay con gradiente sólido de marca */
.hero-slideshow:not(:has(.hero-slide img)) ~ .hero-overlay {
  background: linear-gradient(135deg, #1a0404 0%, var(--brand-800) 30%, var(--brand) 70%, var(--brand-600) 100%);
  opacity: 1;
}

/* --- Contenido sobre el overlay --- */
.hero .container {
  position: relative;
  z-index: 2;
  max-width: 900px;
  width: 100%;
}

/* --- Badge sobre el título --- */
.hero-badges {
  margin-bottom: 18px;
  animation: fadeIn .22s ease-out .04s both;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 999px;
}

/* --- Título --- */
.hero h1 {
  font-size: clamp(2.2rem, 6vw, var(--hero-title-size, 3.8rem));
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  line-height: 1.1;
  animation: fadeIn .22s ease-out .08s both;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

/* --- Párrafo --- */
.hero p {
  font-size: 1.15rem;
  max-width: 680px;
  margin: 0 auto 40px;
  opacity: 0.9;
  line-height: 1.75;
  animation: fadeIn .22s ease-out .12s both;
  font-weight: 400;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

/* --- Botones CTA --- */
.hero-cta {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeIn .22s ease-out both;
}

.hero-cta .btn {
  min-width: 44px;
}

/* --- Indicadores (dots) --- */
.hero-dots {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

.hero-dot.active {
  background: #fff;
  width: 24px;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .hero {
    padding: 100px 20px 120px;
    min-height: 480px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 8vw, calc(var(--hero-title-size, 3.8rem) * 0.68));
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

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

/* ============================================================
   BOTONES - Sistema de botones mejorado
   ============================================================ */
.btn {
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700; 
  font-size: .9rem;
  line-height: 1.2;
  letter-spacing: 0;
  border: 1px solid var(--line-dark);
  background: transparent;
  color: var(--ink);
  cursor: pointer; 
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
  text-align: center;
}

.btn-primary,
.btn-green,
.btn-red,
.btn-light {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.btn-primary:hover,
.btn-green:hover,
.btn-red:hover,
.btn-light:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
  box-shadow: var(--shadow-1);
}

.btn-outline,
.btn-danger {
  background: transparent;
  border-color: var(--line-dark);
  color: var(--ink);
}

.btn-outline-light {
  background: transparent;
  border-color: rgba(255,255,255,.82);
  color: #fff;
}

.btn-outline:hover,
.btn-danger:hover {
  background: var(--bg-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.btn-outline-light:hover { background: #fff; border-color: #fff; color: var(--brand); }

.btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 2px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-sm { padding: 10px 18px; font-size: .9rem; }
.btn-block { 
  width: 100%; 
}

.button-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

/* ============================================================
   SECCIONES - Layout mejorado
   ============================================================ */
.section { 
  padding: var(--section-space) 0;
  position: relative;
}

.section-alt { 
  background: linear-gradient(to bottom, var(--bg-soft), var(--bg));
  position: relative;
}

.section-alt::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line), transparent);
}

.section-warm { 
  background: linear-gradient(135deg, var(--bg-warm) 0%, rgba(254, 249, 243, 0.4) 100%);
}

.section-title { 
  font-size: clamp(1.8rem, 4vw, 2.5rem); 
  font-weight: 800; 
  letter-spacing: -0.03em;
  text-align: center; 
  color: var(--ink); 
  margin-bottom: 14px;
  line-height: 1.2;
}

.section-sub { 
  text-align: center; 
  color: var(--ink-2); 
  max-width: 680px; 
  margin: 0 auto 48px;
  font-size: 1.08rem;
  line-height: 1.65;
  font-weight: 400;
}

/* ============================================================
   CARDS - Sistema de tarjetas mejorado con profundidad
   ============================================================ */
.grid {
  display: grid; 
  gap: 28px;
  align-items: stretch;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.gallery-grid-7 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-grid-7 > :last-child { grid-column: 2; }

.card {
  background: #fff; 
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex; 
  flex-direction: column; 
  overflow: hidden;
  transition: all var(--transition-base);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--radius-lg);
  padding: 2px;
  background: linear-gradient(135deg, transparent, rgba(157, 27, 31, 0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-3);
  transform: translateY(-6px);
  border-color: var(--brand-tint);
}

.card:hover::before {
  opacity: 1;
}

.card-img { 
  height: 230px; 
  object-fit: cover; 
  width: 100%; 
  background: linear-gradient(135deg, var(--bg-grey), var(--bg-soft));
  transition: transform var(--transition-slow);
}

.image-unavailable { background: var(--bg-grey); color: transparent; }

.card:hover .card-img {
  transform: scale(1.05);
}

.card-body { 
  padding: 24px 26px 26px;
  flex: 1; 
  display: flex; 
  flex-direction: column; 
}

.card-cat {
  align-self: flex-start; 
  background: linear-gradient(135deg, var(--brand-tint), var(--brand-soft));
  color: var(--brand-700);
  font-size: 0.72rem; 
  font-weight: 800; 
  padding: 5px 12px;
  border-radius: 8px;
  text-transform: uppercase; 
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  border: 1px solid var(--brand-tint);
}

.card h3 { 
  font-size: 1.15rem; 
  font-weight: 700; 
  margin-bottom: 10px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.card h3 a { 
  color: var(--ink);
  transition: color var(--transition-fast);
}

.card h3 a:hover { 
  color: var(--brand); 
}

.card .excerpt { 
  color: var(--ink-2); 
  font-size: 0.92rem; 
  flex: 1;
  line-height: 1.6;
}

.card .meta { 
  color: var(--ink-3); 
  font-size: 0.82rem; 
  margin-top: 16px;
  display: flex; 
  gap: 14px; 
  flex-wrap: wrap;
  font-weight: 500;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: 14px;
  font-weight: 700;
  color: var(--brand);
}
.card-footer > .btn { flex: 0 0 auto; white-space: nowrap; }

/* ============================================================
   GALERÍA - Grid mejorado con overlays
   ============================================================ */
.gallery-item { 
  border-radius: var(--radius); 
  overflow: hidden; 
  border: 1px solid var(--line);
  position: relative;
  aspect-ratio: 4/3;
  background: var(--bg-grey);
  transition: all var(--transition-base);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.gallery-zoom {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #fff;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after,
.gallery-item:hover .gallery-zoom,
.gallery-item:focus-visible .gallery-zoom {
  opacity: 1;
}

.gallery-item img { 
  height: 100%;
  width: 100%; 
  object-fit: cover; 
  transition: transform var(--transition-slow);
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-3);
  z-index: 1;
}

.gallery-item:hover img { 
  transform: scale(1.1);
}

/* ============================================================
   PROSE - Contenido de texto enriquecido
   ============================================================ */
.prose { 
  max-width: var(--reading-width);
  margin: 0;
  color: var(--ink-2);
  font-size: var(--text-lg);
  line-height: 1.75;
  text-align: left;
}

.prose h2 { 
  color: var(--ink); 
  margin: 32px 0 16px;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.prose h3 {
  color: var(--ink);
  margin: 24px 0 12px;
  font-weight: 700;
  font-size: 1.3rem;
}

.prose p { 
  margin-bottom: 18px; 
}

.prose img { 
  border-radius: var(--radius);
  margin: 24px 0;
  box-shadow: var(--shadow-2);
}

.prose ul, .prose ol { 
  padding-left: 28px; 
  margin-bottom: 18px; 
}

.prose li { 
  margin-bottom: 8px; 
}

.prose a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  transition: all var(--transition-fast);
}

.prose a:hover {
  color: var(--brand-600);
  text-decoration-thickness: 3px;
}

/* ============================================================
   FORMULARIOS - Diseño moderno con mejor UX
   ============================================================ */
.form-card { 
  max-width: 680px; 
  margin: 0 auto; 
  background: #fff; 
  padding: 36px 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr);
  align-items: stretch;
  gap: 24px;
  max-width: 1040px;
  margin: 0 auto var(--space-10);
}
.contact-form { width: 100%; max-width: none; margin: 0; }
.contact-details {
  padding: 28px;
  background: var(--brand-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}
.contact-details h2 { margin: 0 0 22px; font-size: 1.15rem; }
.contact-detail-list { display: grid; gap: 18px; }
.contact-detail-list > a,
.contact-detail-list > div { display: flex; align-items: flex-start; gap: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.contact-detail-list .icon { color: var(--brand); margin-top: 3px; }
.contact-layout-single { grid-template-columns: minmax(0, 680px); justify-content: center; }
.contact-title, .contact-intro { text-align: center; }
.home-about-copy { max-width: var(--reading-width); margin-inline: auto; }
.home-rental-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.home-rental-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.donation-cta .btn-primary { background: #fff; border-color: #fff; color: var(--brand); }
.donation-cta .btn-primary:hover { background: var(--brand-light); border-color: var(--brand-light); color: var(--brand-800); }

.program-detail { margin-top: 14px; margin-bottom: var(--space-10); }
.program-detail-header { margin-bottom: 28px; }
.program-detail-header .page-title { margin: 8px 0 10px; }
.program-detail-header .meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-3); font-size: .9rem; }
.program-detail-header .meta span { display: inline-flex; align-items: center; gap: 6px; }
.program-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); align-items: start; gap: 32px; }
.program-detail-main { min-width: 0; }
.program-detail-sidebar { display: grid; gap: 14px; }
.program-price-box { padding: 22px; background: var(--brand-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.program-price { color: var(--brand-700); font-size: 1.6rem; font-weight: 800; overflow-wrap: anywhere; }
.program-capacity { margin-top: 4px; color: var(--ink-3); font-size: .85rem; }
.program-enroll-button { width: 100%; }
.program-registration-closed { justify-self: start; padding: 10px 18px; }
.program-payment-plans { margin-top: 32px; }
.program-payment-plans h2 { margin-bottom: 8px; font-size: 1.35rem; }
.program-payment-plans .plans { margin-top: 16px; }
.program-payment-plans .plan .muted { font-size: .85rem; }

.enrollment-shell { max-width: 860px; padding-block: 36px 48px; }
.enrollment-meta { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 24px; color: var(--ink-3); }
.enrollment-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
.enrollment-progress li,
.enrollment-progress li > a {
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  color: var(--ink-3);
  text-align: center;
  text-decoration: none;
}
.enrollment-progress li > span,
.enrollment-progress li > a > span {
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 1;
  border: 2px solid var(--line-dark);
  border-radius: 50%;
  font-weight: 700;
}
.enrollment-progress li strong { max-width: 100%; font-size: .75rem; line-height: 1.25; overflow-wrap: anywhere; }
.enrollment-progress li.is-current { color: var(--brand-700); }
.enrollment-progress li.is-current > span,
.enrollment-progress li.is-current > a > span { border-color: var(--brand); background: var(--brand); color: #fff; }
.enrollment-progress li.is-complete > span,
.enrollment-progress li.is-complete > a > span { border-color: var(--green-600, #23844d); color: var(--green-700, #17683b); }
.enrollment-form,
.enrollment-card {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-1);
}
.enrollment-form h2,
.enrollment-card h2 { margin: 0 0 16px; font-size: 1.25rem; }
.enrollment-plans { min-width: 0; margin: 0; padding: 0; border: 0; }
.enrollment-plans legend { margin-bottom: 8px; font-size: 1.05rem; font-weight: 700; }
.enrollment-plan-summary { margin: 16px 0; padding: 14px; background: var(--brand-soft); border-radius: var(--radius-sm); font-weight: 700; }
.enrollment-consent { display: flex; align-items: flex-start; gap: 12px; line-height: 1.55; }
.enrollment-consent input { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 2px; accent-color: var(--brand); }
.enrollment-privacy { margin: 10px 0 20px; font-size: .85rem; }
.enrollment-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.enrollment-alert,
.enrollment-success { padding: 16px; border: 1px solid #d5e7db; border-left: 4px solid #2d8050; border-radius: var(--radius-sm); background: #f3faf5; color: var(--ink); }
.enrollment-alert { border-color: #eed9b0; border-left-color: #b66b16; background: #fff9ee; }
.enrollment-alert p { margin: 6px 0 0; }
.enrollment-card { display: grid; gap: 14px; }
.enrollment-card > p { margin: 0; }
.enrollment-upload-form { display: grid; gap: 16px; min-width: 0; }
.enrollment-payment-list { display: grid; gap: 12px; }
.enrollment-payment-item { min-width: 0; padding: 16px; border: 1px solid var(--line); background: #fff; }
.enrollment-payment-item h3 { margin: 0 0 8px; font-size: 1rem; }
.enrollment-payment-item p { margin: 0 0 10px; }
.enrollment-payment-item .enrollment-upload-form { margin-top: 12px; }
.enrollment-upload-form > label,
.enrollment-upload-form .form-group > label { font-weight: 700; }
.enrollment-upload-form input[type="file"] { display: block; width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line-dark); border-radius: var(--radius-sm); background: #fff; }
.document-preview { display: grid; gap: 10px; }
.document-preview-item { display: grid; justify-items: start; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.document-preview-item img { max-width: min(100%, 360px); max-height: 300px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.enrollment-back { justify-self: start; }
.enrollment-number { font-size: 2rem; font-weight: 800; color: var(--brand-700); }
.enrollment-payment-state { font-weight: 700; }
.enrollment-replace-links { display: flex; flex-wrap: wrap; gap: 16px; }
.registration-document-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.registration-document-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.registration-document-list li > :first-child { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .enrollment-shell { padding-block: 24px 36px; }
  .enrollment-progress { gap: 3px; }
  .enrollment-progress li strong { font-size: .68rem; }
  .enrollment-form,
  .enrollment-card { padding: 20px 16px; }
  .enrollment-form .form-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .registration-document-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .registration-document-list li .btn { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 900px) {
  .contact-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .program-detail-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

.form-group { 
  margin-bottom: 22px; 
}

.form-group label { 
  display: block; 
  font-weight: 600; 
  margin-bottom: 8px;
  font-size: 0.92rem; 
  color: var(--ink);
  letter-spacing: -0.01em;
}

.form-group input, 
.form-group textarea, 
.form-group select {
  width: 100%; 
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-family: inherit; 
  font-size: 0.95rem; 
  background: #fff; 
  color: var(--ink);
  transition: all var(--transition-fast);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
  border-color: var(--line-dark);
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
  outline: none; 
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light);
  background: var(--brand-light);
}

.form-group textarea { 
  min-height: 160px; 
  resize: vertical; 
  line-height: 1.6;
}

.form-row { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 18px; 
}

/* ============================================================
   FOOTER - Diseño elegante y moderno
   ============================================================ */
.site-footer { 
  background: linear-gradient(135deg, #0d0202 0%, var(--brand-800) 50%, var(--brand-700) 100%);
  color: rgba(255, 255, 255, 0.85);
  padding: var(--space-12) 0 var(--space-8);
  text-align: center;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent);
}

.site-footer .footer-brand { 
  display: inline-flex; 
  align-items: center; 
  gap: var(--space-3);
  font-weight: 700; 
  color: #fff; 
  font-size: 1.1rem;
  margin-bottom: 18px;
  font-family: inherit; 
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.site-footer .footer-brand:hover {
  transform: translateY(-2px);
}

.site-footer .footer-brand img { 
  height: 44px; 
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.site-footer p {
  margin-bottom: var(--space-5);
  font-size: var(--text-base);
  opacity: 0.9;
}

.site-footer .footer-contact a { color: inherit; }
.site-footer .footer-contact a:hover { color: #fff; text-decoration: underline; }

.site-footer .social {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.site-footer .social a { 
  color: rgba(255, 255, 255, 0.75) !important;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.site-footer .social svg { width: 20px; height: 20px; flex: 0 0 auto; fill: currentColor; }

.site-footer .social a:hover { 
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.site-footer .copy { 
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.82rem; 
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.02em;
}

/* ============================================================
   FLASH MESSAGES - Notificaciones mejoradas
   ============================================================ */
.flash { 
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-weight: 600; 
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeInScale .22s ease-out both;
  border: 2px solid;
}

.flash::before {
  font-size: 1.2rem;
}

.flash.success { 
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  color: #166534;
  border-color: #bbf7d0;
}

.flash.success::before {
  content: '✓';
}

.flash.error { 
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  color: #991b1b;
  border-color: #fecaca;
}

.flash.error::before {
  content: '✕';
}

/* ============================================================
   POST DETALLE - Vista de artículo mejorada
   ============================================================ */
.post-single { 
  max-width: 820px; 
  margin: 0 auto; 
}

.post-single img.cover { 
  width: 100%; 
  max-height: 460px; 
  object-fit: cover; 
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  box-shadow: var(--shadow-2);
}

.post-single h1 { 
  font-size: clamp(1.9rem, 4.5vw, 2.8rem); 
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.2;
}

.post-single .byline { 
  color: var(--ink-3); 
  margin-bottom: 28px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.badge { 
  display: inline-block; 
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.75rem; 
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge.published { 
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #166534;
  border: 1px solid #86efac;
}

.badge.draft { 
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fcd34d;
}

/* ============================================================
   PROMO BANNER - Banner promocional destacado
   ============================================================ */
.promo {
  background: linear-gradient(135deg, #0d0202 0%, var(--brand-800) 35%, var(--brand) 72%, var(--brand-600) 100%);
  color: #fff; 
  padding: 56px 32px;
  position: relative;
  overflow: hidden;
}

.promo .container { 
  max-width: 960px;
  position: relative;
  z-index: 1;
}

.promo .pill { 
  display: inline-block; 
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.74rem; 
  font-weight: 800;
  text-transform: uppercase; 
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.3);
}

.promo h2 { 
  font-size: clamp(1.6rem, 4vw, 2.4rem); 
  margin-bottom: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.promo p { 
  opacity: 0.92;
  max-width: 680px; 
  margin-bottom: 24px;
  font-size: 1.08rem;
  line-height: 1.7;
}

.promo .meta { 
  font-size: 0.92rem; 
  opacity: 0.88;
  margin-bottom: 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-weight: 500;
}

/* ============================================================
   FEATURE LIST - Lista de características
   ============================================================ */
.feature-list { 
  list-style: none; 
  display: grid; 
  gap: 14px; 
}

.feature-list li { 
  display: flex; 
  gap: 12px; 
  align-items: flex-start;
  padding: 12px;
  border-radius: 10px;
  transition: all var(--transition-fast);
}

.feature-list li:hover {
  background: var(--brand-light);
  transform: translateX(4px);
}

.feature-list .ico { 
  flex: 0 0 32px;
  text-align: center;
  font-size: 1.2rem;
}

/* ============================================================
   PLANES DE PAGO - Cards mejoradas
   ============================================================ */
.plans { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); 
  gap: 20px; 
}

.plan {
  background: linear-gradient(135deg, #fff, var(--bg-soft));
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition-base);
  cursor: pointer; 
  display: block;
  position: relative;
  overflow: hidden;
}

.plan::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.plan:hover, .plan.selected { 
  border-color: var(--brand);
  box-shadow: var(--shadow-2);
  transform: translateY(-4px);
}

.plan:hover::before,
.plan.selected::before {
  transform: scaleX(1);
}

.plan input[type=radio] { 
  margin-right: 10px;
  accent-color: var(--brand);
  width: 18px;
  height: 18px;
}

.plan .plan-price { 
  font-size: 1.6rem; 
  font-weight: 800; 
  color: var(--brand); 
  margin: 12px 0;
  letter-spacing: -0.02em;
}

.plan .plan-label { 
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

/* ============================================================
   LIBRERÍA - Carrito y productos
   ============================================================ */
.cart-line { 
  display: flex; 
  align-items: center; 
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  transition: background var(--transition-fast);
}

.cart-line:hover {
  background: var(--bg-soft);
  padding-left: 12px;
  padding-right: 12px;
  margin-left: -12px;
  margin-right: -12px;
  border-radius: 12px;
}

.cart-line .thumb { 
  width: 80px; 
  height: 80px; 
  object-fit: cover; 
  border-radius: 12px;
  background: var(--bg-grey);
  box-shadow: var(--shadow-1);
}

.cart-line .grow { 
  flex: 1; 
}

.shop-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
  gap: 24px; 
}

.shop-card { 
  background: #fff; 
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden; 
  display: flex; 
  flex-direction: column; 
  transition: all var(--transition-base);
}

.shop-card:hover { 
  box-shadow: var(--shadow-3);
  transform: translateY(-4px);
  border-color: var(--brand-tint);
}

.shop-card .img { 
  height: 240px; 
  object-fit: cover; 
  width: 100%; 
  background: linear-gradient(135deg, var(--bg-grey), var(--bg-soft));
  transition: transform var(--transition-slow);
}

.shop-card:hover .img {
  transform: scale(1.05);
}

.shop-card .body { 
  padding: 20px; 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
}

.shop-card .body form { margin-top: auto !important; padding-top: 10px; }

.shop-card .cat { 
  font-size: 0.7rem; 
  text-transform: uppercase; 
  letter-spacing: 0.08em;
  color: var(--brand); 
  font-weight: 800;
  margin-bottom: 8px;
  display: inline-block;
}

.shop-card h3 { 
  font-size: 1.05rem; 
  font-weight: 700; 
  margin-bottom: 8px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.shop-card .price { 
  font-weight: 800; 
  color: var(--brand); 
  font-size: 1.3rem;
  margin-top: auto;
  letter-spacing: -0.02em;
}

.category-bar { 
  display: flex; 
  gap: 10px; 
  flex-wrap: wrap; 
  margin-bottom: 32px; 
}

.category-bar a { 
  background: #fff; 
  border: 2px solid var(--line);
  color: var(--ink-2); 
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700; 
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.category-bar a:hover { 
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-1);
}

.category-bar a.active { 
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(157, 27, 31, 0.3);
}

.qty-input { 
  width: 80px; 
  padding: 10px; 
  border: 2px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  transition: all var(--transition-fast);
}

.qty-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light);
}

/* ============================================================
   RESULTADO DE PAGO
   ============================================================ */
.result-box { 
  max-width: 520px; 
  margin: 80px auto;
  text-align: center; 
  background: #fff; 
  border: 1px solid var(--line);
  padding: 50px 40px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
  animation: fadeInScale .22s ease-out both;
}

.result-box .big { 
  font-size: 4rem; 
  margin-bottom: 16px;
  animation: fadeInScale .22s ease-out .08s both;
}

/* ============================================================
   PÁGINA INTERIOR GENÉRICA
   ============================================================ */
.page-head { 
  padding: 56px 32px 12px;
  text-align: center; 
}

.page-head h1 { 
  font-size: clamp(1.8rem, 4vw, 2.6rem); 
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--ink);
}

/* ============================================================
   RESPONSIVE - Optimización móvil mejorada
   ============================================================ */
.menu-toggle { 
  display: none; 
  background: none; 
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.menu-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}

.menu-toggle:focus-visible,
.nav-links a:focus-visible,
.nav-links button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .nav { flex-wrap: wrap; }

  .menu-toggle { 
    display: flex;
    order: 3; 
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
  }
  
  .nav-links {
    order: 4; 
    width: 100%; 
    display: none; 
    flex-direction: column; 
    align-items: stretch;
    gap: var(--space-1);
    padding: var(--space-3) 0;
    border-top: 1px solid var(--line);
    animation: fadeIn .22s ease-out both;
  }
  
  .nav-links.open { 
    display: flex; 
  }
  
  .nav-links > a,
  .nav-links > .dropdown > .drop-btn,
  .nav-links .user-menu-btn {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding: var(--space-2) var(--space-3);
    text-align: left;
  }

  .nav-links > a::after,
  .nav-links > .dropdown > .drop-btn::after {
    bottom: 2px;
    left: var(--space-3);
    right: auto;
    width: 48px;
  }

  .nav-links > .dropdown > .drop-btn .nav-chevron,
  .nav-links .user-menu-btn .nav-chevron {
    margin-left: auto;
  }

  .nav-separator {
    width: 100%;
    height: 1px;
    margin: 8px 0;
  }

  .nav-login-link {
    padding: 14px 18px;
    border-radius: 10px;
  }

  /* User menu mobile */
  .user-menu {
    width: 100%;
  }
  .user-menu-btn {
    width: 100%;
    justify-content: flex-start;
  }
  .user-dropdown {
    position: static;
    width: 100%;
    box-shadow: none;
    border: none;
    border-radius: 10px;
    background: var(--bg-soft);
    margin-top: 4px;
  }
  
  .dropdown { 
    width: 100%; 
  }
  
  .dropdown-menu { 
    position: static; 
    transform: none;
    display: none; 
    box-shadow: none;
    border: none; 
    padding: 0 0 0 16px;
    background: transparent;
    margin-top: 6px;
  }
  
  .dropdown.open .dropdown-menu,
  .dropdown.is-open .dropdown-menu { 
    display: block;
    opacity: 1;
  }
  
  .dropdown .drop-btn { 
    width: 100%; 
  }
}

@media (min-width: 1101px) and (max-width: 1600px) {
  .brand .brand-name small { display: none; }
  .nav { gap: var(--space-2); padding-inline: 20px; }
  .nav-links > a,
  .nav-links > .dropdown > .drop-btn,
  .nav-links .user-menu-btn { padding-inline: 8px; }
}

@media (max-width: 640px) {
  :root {
    --container-gutter: 20px;
    --section-space: 4rem;
  }
  
  .hero { 
    padding: var(--space-12) 0 var(--space-12);
  }

  .home-rental-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  
  .hero h1 {
    font-size: clamp(1.8rem, 8vw, calc(var(--hero-title-size, 3.8rem) * 0.68));
  }
  
  .hero p {
    font-size: 1.05rem;
  }
  
  .form-row { 
    grid-template-columns: 1fr; 
  }
  
  .form-card {
    padding: 28px 24px;
  }
  
  .grid-3, 
  .grid-4 { 
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 20px; 
  }
  
  .card-img { 
    height: 200px; 
  }
  
  .cart-line { 
    flex-wrap: wrap; 
  }
  
  .brand img { 
    height: 42px; 
  }
  
  .nav {
    padding: var(--space-2) var(--container-gutter);
  }
  
  .shop-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 16px;
  }

  .button-group { flex-direction: column; align-items: stretch; }
  .button-group > .btn { width: 100%; }
  
  .shop-card .img {
    height: 200px;
  }
  
  .site-footer {
    padding: var(--space-10) 0 var(--space-8);
  }
  
  .site-footer .social {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .gallery-grid-7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid-7 > :last-child { grid-column: 1 / -1; width: calc(50% - 10px); justify-self: center; }
  
  .plans {
    grid-template-columns: 1fr;
  }
  
  .category-bar {
    gap: 8px;
  }
  
  .category-bar a {
    font-size: 0.82rem;
    padding: 8px 14px;
  }
}

/* ============================================================
   UTILIDADES Y ESTADOS ADICIONALES
   ============================================================ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
}

.empty .big {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 44px 20px;
  border: 1px dashed var(--line-dark);
  border-radius: var(--radius);
  color: var(--ink-2);
  text-align: center;
}

.empty-state > .icon { color: var(--brand); }
.empty-state p { margin: 0; font-weight: 600; }

/* Loading state */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Hover lift effect para elementos interactivos */
.lift {
  transition: transform var(--transition-fast);
}

.lift:hover {
  transform: translateY(-4px);
}

/* Glassmorphism effect */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Scroll to top indicator */
.scroll-indicator {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: var(--brand);
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-3);
  transition: all var(--transition-fast);
  z-index: 50;
}

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

/* ============================================================
   ASISTENTE IA - Chat Widget flotante
   ============================================================ */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 20px rgba(157, 27, 31, 0.35);
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.chat-fab-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  transition: transform 0.3s;
}
.chat-fab:hover {
  box-shadow: 0 6px 28px rgba(157, 27, 31, 0.45);
}
.chat-fab.open {
  background: var(--brand-700);
}
.chat-fab.open .chat-fab-logo {
  opacity: 0;
  transform: scale(0.5) rotate(90deg);
}
.chat-fab.open::after {
  content: '✕';
  position: absolute;
  font-size: 1.4rem;
  color: #fff;
  font-weight: 300;
}

.chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
  display: none;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  border: 1px solid var(--line);
}
.chat-window.open {
  display: flex;
  animation: chatSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
  background: var(--brand);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.chat-header-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}
.chat-header-info {
  flex: 1;
  min-width: 0;
}
.chat-header-info strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}
.chat-header-info small {
  opacity: 0.8;
  font-size: 0.8rem;
}
.chat-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.chat-close:hover {
  background: rgba(255,255,255,0.3);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
  animation: msgFade 0.25s ease;
}
@keyframes msgFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--bg-grey);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.chat-msg.bot a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
}
.chat-msg.bot a.chat-destino {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 14px;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
}
.chat-msg.error {
  align-self: flex-start;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.85rem;
}

.chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-grey);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}
.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-light);
  animation: typingDot 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 12px;
}
.chat-quick-btn {
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid var(--brand-tint);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.chat-quick-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.chat-input-area {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  background: #fff;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  max-height: 80px;
}
.chat-input:focus {
  border-color: var(--brand);
}
.chat-send {
  background: var(--brand);
  color: #fff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background 0.2s;
}
.chat-send:hover {
  background: var(--brand-700);
}
.chat-send:disabled {
  background: var(--ink-light);
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .chat-fab {
    position: static;
    margin: 16px 20px 20px auto;
    width: 54px;
    height: 54px;
  }
}

@media (max-width: 480px) {
  .chat-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    max-width: 100vw;
  }
}