/* ============================================================
   Main Landing & Catalog Styles - Gestión24 WaaS
   ============================================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Los controles de formulario no heredan la tipografía por defecto: sin esto los <button> usan Arial. */
button, input, select, textarea {
  font: inherit;
}

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

body {
  background-color: var(--color-bg, #050C16);
  color: var(--color-text, #E2E8F0);
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, sans-serif);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Gradient Highlights */
.text-gradient {
  background: linear-gradient(135deg, #00E5CC 0%, #38BDF8 50%, #2563EB 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline;
}

/* --- Header / Navbar --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(10, 22, 40, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
  padding: 0.85rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-logo {
  height: 32px;
  width: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn-text-desktop {
  display: inline;
}

.btn-text-mobile {
  display: none;
}

.btn-link-parent {
  color: var(--color-muted, #94A3B8);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0 0.75rem;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-md, 10px);
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-link-parent:hover {
  color: var(--color-cyan, #00E5CC);
}

.btn-whatsapp-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: #25D366;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0 0.95rem;
  height: 40px;
  box-sizing: border-box;
  border-radius: var(--radius-md, 10px);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-whatsapp-header:hover {
  background: rgba(37, 211, 102, 0.22);
  transform: translateY(-1px);
}

/* --- Hero Section --- */
.hero {
  padding: 4.5rem 0 3.5rem;
  position: relative;
  text-align: center;
  background: radial-gradient(circle at 50% -20%, #0d2847 0%, rgba(5, 12, 22, 0) 70%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-cyan, #00E5CC);
  background: rgba(0, 229, 204, 0.1);
  border: 1px solid rgba(0, 229, 204, 0.3);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full, 9999px);
  margin-bottom: 1.5rem;
  box-shadow: 0 0 20px rgba(0, 229, 204, 0.15);
}

.hero-title {
  font-family: var(--font-display, inherit);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--color-white, #FFFFFF);
  line-height: 1.15;
  margin-bottom: 1.25rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--color-muted, #94A3B8);
  max-width: 720px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* Benefits Strip */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
}

.benefit-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--color-text, #E2E8F0);
  font-weight: 500;
}

.benefit-item i {
  color: var(--color-cyan, #00E5CC);
  font-size: 1.1rem;
}

/* --- Catalog Filter & Search Toolbar --- */
.catalog-toolbar {
  padding: 1.5rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

.search-input-wrap {
  width: 100%;
  max-width: 480px;
  position: relative;
}

.search-input-wrap i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted, #94A3B8);
  font-size: 0.95rem;
}

.search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  background: var(--color-card, #0A1628);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-full, 9999px);
  color: var(--color-white, #FFFFFF);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-cyan, #00E5CC);
  box-shadow: 0 0 0 3px rgba(0, 229, 204, 0.2);
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.pill-btn {
  background: var(--color-card, #0A1628);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  color: var(--color-muted, #94A3B8);
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-white, #FFFFFF);
  border-color: rgba(255, 255, 255, 0.2);
}

.pill-btn.is-active {
  background: rgba(0, 229, 204, 0.15);
  color: var(--color-cyan, #00E5CC);
  border-color: rgba(0, 229, 204, 0.4);
  box-shadow: 0 0 15px rgba(0, 229, 204, 0.2);
}

/* --- Templates Grid --- */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  padding-bottom: 5rem;
}

.template-card {
  background: var(--color-card, #0A1628);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
  position: relative;
}

.template-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-border-hover, rgba(0, 229, 204, 0.35));
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 229, 204, 0.12);
}

.card-thumb-wrap {
  width: 100%;
  height: 210px;
  background: #091220;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.template-card:hover .card-thumb {
  transform: scale(1.04);
}

.card-badge-popular {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full, 9999px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.card-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-cyan, #00E5CC);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-title {
  font-family: var(--font-display, inherit);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white, #FFFFFF);
  line-height: 1.3;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--color-muted, #94A3B8);
  line-height: 1.5;
}

.card-features {
  list-style: none;
  margin: 0.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.85rem;
}

.card-features li {
  font-size: 0.8125rem;
  color: var(--color-text, #E2E8F0);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-features li i {
  color: var(--color-cyan, #00E5CC);
  font-size: 0.75rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

.btn-card-demo {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md, 10px);
  background: transparent;
  border: 1px solid var(--color-border-light, rgba(255, 255, 255, 0.16));
  color: var(--color-white, #FFFFFF);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-card-demo:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-cyan, #00E5CC);
  color: var(--color-cyan, #00E5CC);
}

.btn-card-order {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md, 10px);
  background: var(--color-blue, #2563EB);
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 700;
  /* Mismo borde que .btn-card-demo para que ambos botones de la tarjeta midan lo mismo. */
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: var(--shadow-blue);
  transition: all 0.2s ease;
}

.btn-card-order:hover {
  background: var(--color-blue-hover, #1D4ED8);
  transform: translateY(-1px);
}

/* Empty State */
.catalog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-muted, #94A3B8);
}

.catalog-empty i {
  font-size: 2.5rem;
  color: var(--color-cyan, #00E5CC);
  margin-bottom: 1rem;
}

/* --- How it Works Section --- */
.how-it-works {
  padding: 5rem 0;
  background: #0A1628;
  border-top: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
  border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
}

.section-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-cyan, #00E5CC);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  display: block;
}

.section-title {
  font-family: var(--font-display, inherit);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: var(--color-white, #FFFFFF);
  line-height: 1.2;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.step-card {
  background: var(--color-surface, #0F1F38);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 16px);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.step-number {
  font-family: var(--font-display, inherit);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-cyan, #00E5CC);
  background: rgba(0, 229, 204, 0.12);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-white, #FFFFFF);
}

.step-text {
  font-size: 0.9rem;
  color: var(--color-muted, #94A3B8);
  line-height: 1.6;
}

/* --- Footer --- */
.site-footer {
  padding: 3rem 0;
  background: #050C16;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-dark-muted, #64748B);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.footer-logo {
  height: 24px;
  width: auto;
  opacity: 0.7;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--color-muted, #94A3B8);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--color-cyan, #00E5CC);
}

/* ============================================================
   Responsive Design & Mobile Optimization
   ============================================================ */

@media (max-width: 768px) {
  /* Container Padding */
  .container {
    padding: 0 1rem;
  }

  /* 1. Header en Móvil */
  .site-header {
    padding: 0.55rem 0;
  }

  .header-logo {
    height: 25px;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .btn-text-desktop {
    display: none;
  }

  .btn-text-mobile {
    display: inline;
  }

  .btn-link-parent {
    font-size: 0.8rem;
    padding: 0 0.75rem;
    height: 44px;
    min-width: 44px;
    gap: 0.35rem;
    border-radius: 8px;
    box-sizing: border-box;
  }

  .btn-whatsapp-header {
    font-size: 0.8rem;
    padding: 0 0.85rem;
    height: 44px;
    min-width: 44px;
    gap: 0.35rem;
    border-radius: 8px;
    box-sizing: border-box;
  }

  /* 2. Hero Compacto para mostrar la primera plantilla Above-the-fold */
  .hero {
    padding: 1.15rem 0 0.5rem;
    background: radial-gradient(circle at 50% -10%, #0d2847 0%, rgba(5, 12, 22, 0) 65%);
  }

  .hero-badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.65rem;
    margin-bottom: 0.45rem;
    gap: 0.3rem;
  }

  .hero-title {
    font-size: clamp(1.35rem, 5.2vw, 1.85rem);
    margin-bottom: 0.35rem;
    line-height: 1.2;
  }

  .hero-subtitle {
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0 auto 0.45rem;
    max-width: 480px;
    color: var(--color-muted, #94A3B8);
  }

  /* 3. Strip de Beneficios: Carrusel horizontal de micro-pills */
  .benefits-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.45rem;
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    padding-bottom: 0.25rem;
    justify-content: flex-start;
    scrollbar-width: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .benefits-grid::-webkit-scrollbar {
    display: none;
  }

  .benefit-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 9999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    gap: 0.35rem;
    white-space: nowrap;
  }

  .benefit-item i {
    font-size: 0.8rem;
  }

  /* 4. Toolbar del Catálogo Ultra-compacta */
  .catalog-toolbar {
    padding: 0.55rem 0 0.75rem;
    gap: 0.45rem;
  }

  .search-input-wrap {
    max-width: 100%;
  }

  .search-input {
    padding: 0.45rem 0.85rem 0.45rem 2.2rem;
    font-size: 0.82rem;
    height: 38px;
  }

  .search-input-wrap i {
    left: 0.8rem;
    font-size: 0.85rem;
  }

  .category-pills {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
    padding-bottom: 3px;
  }

  .pill-btn {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    white-space: nowrap;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  /* 5. Grid y Tarjetas de Plantillas */
  .templates-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding-bottom: 3.5rem;
  }

  .card-thumb-wrap {
    height: 180px;
  }

  .card-body {
    padding: 1.1rem;
  }

  .card-title {
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
  }

  .card-desc {
    font-size: 0.825rem;
    margin-bottom: 0.75rem;
    line-height: 1.45;
  }

  .card-features {
    margin-bottom: 0.85rem;
    gap: 0.35rem;
  }

  .card-features li {
    font-size: 0.78rem;
  }

  /* Pasos "Cómo Funciona" */
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .step-card {
    padding: 1.25rem;
  }

  /* Sección CTA y Footer */
  .cta-section {
    padding: 3rem 0;
  }

  .cta-title {
    font-size: 1.5rem;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

@media (max-width: 380px) {
  .header-logo {
    height: 22px;
  }

  .btn-link-parent {
    padding: 0.3rem 0.4rem;
    font-size: 0.74rem;
  }

  .btn-whatsapp-header {
    padding: 0.35rem 0.5rem;
    font-size: 0.74rem;
  }
}
