/* ==========================================================================
   SoftDryzz Portfolio - Components CSS
   Estilos específicos para páginas de templates (saas-launch, etc.)
   Extiende portfolio-global.css sin duplicar estilos base.
   ========================================================================== */


/* ==========================================================================
   1. TEMPLATE HERO
   Hero section para páginas de venta de templates
   ========================================================================== */

.template-hero {
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg-primary) 100%);
}

[data-theme="dark"] .template-hero {
  background: linear-gradient(180deg, rgba(0, 102, 255, 0.08) 0%, var(--bg-primary) 100%);
}

.template-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

@media (max-width: 767px) {
  .template-hero__grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}

.template-hero__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.template-hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 50ch;
}

.template-hero__pricing {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-block: var(--space-sm);
}

.template-hero__price {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.template-hero__price-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.template-hero__original-price {
  font-size: var(--font-h4);
  color: var(--text-muted);
  text-decoration: line-through;
}

.template-hero__image {
  display: flex;
  justify-content: center;
}

.template-hero__mockup {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}


/* ==========================================================================
   2. TEMPLATE STATS
   Barra de estadísticas bajo el hero
   ========================================================================== */

.template-stats {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.template-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-lg) var(--space-md);
}

.template-stat__number {
  font-size: var(--font-h3);
  font-weight: 800;
  color: var(--primary);
}

.template-stat__label {
  font-size: var(--font-small);
  color: var(--text-secondary);
}

@media (max-width: 767px) {
  .template-stats .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ==========================================================================
   3. TEMPLATE CHECKLIST
   Lista con checks verdes
   ========================================================================== */

.template-checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.template-checklist li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: var(--font-body);
  line-height: 1.6;
}

.template-checklist li::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  background: var(--success);
  border-radius: var(--radius-full);
}


/* ==========================================================================
   4. TEMPLATE FEATURES
   Sección de features con cards y listas
   ========================================================================== */

.template-features {
  background: var(--bg-secondary);
}

.template-feature-card {
  height: 100%;
}

.template-feature-card h3 {
  margin-bottom: var(--space-md);
  font-size: var(--font-h4);
}

.template-feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.template-feature-list li {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  font-size: var(--font-small);
  color: var(--text-secondary);
  line-height: 1.6;
}

.template-feature-list li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}


/* ==========================================================================
   5. TEMPLATE TECH ICON
   Icono grande para tech stack
   ========================================================================== */

.template-tech-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}


/* ==========================================================================
   6. TEMPLATE SCREENSHOTS / GALLERY
   Grid de screenshots con hover
   ========================================================================== */

.template-gallery {
  background: var(--bg-secondary);
}

.template-screenshot {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.template-screenshot:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Lightbox */
.lb-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.lb-overlay.lb-open { opacity: 1; pointer-events: auto; }
.lb-img {
  max-width: 90vw; max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  user-select: none;
}
.lb-close {
  position: absolute; top: 16px; right: 24px;
  background: none; border: none; color: #fff;
  font-size: 2.4rem; cursor: pointer; opacity: .7;
  transition: opacity .2s;
}
.lb-close:hover { opacity: 1; }
.lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1); border: none; color: #fff;
  font-size: 1.6rem; padding: 12px 16px; cursor: pointer;
  border-radius: 8px; opacity: .7; transition: opacity .2s, background .2s;
}
.lb-prev:hover, .lb-next:hover { opacity: 1; background: rgba(255,255,255,.2); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.7); font-size: .9rem;
}

/* ==========================================================================
   7. TEMPLATE DEMO CTA
   Sección intermedia con CTA para ver demo
   ========================================================================== */

.template-demo-cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.template-demo-cta h2,
.template-demo-cta p {
  color: white;
}

.template-demo-cta .btn--primary {
  background: white;
  color: var(--primary);
}

.template-demo-cta .btn--primary:hover {
  background: var(--bg-primary);
}


/* ==========================================================================
   8. TEMPLATE INCLUDES
   Grid de items incluidos en la compra
   ========================================================================== */

.template-include {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.template-include__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  background: var(--success);
  border-radius: var(--radius-full);
}

.template-include h4 {
  margin-bottom: var(--space-xs);
}


/* ==========================================================================
   9. TEMPLATE PRICING
   Tabla de pricing con 3 columnas
   ========================================================================== */

.template-pricing {
  background: var(--bg-secondary);
}

.template-pricing__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  max-width: 1000px;
  margin-inline: auto;
  align-items: stretch;
}

@media (max-width: 767px) {
  .template-pricing__cards {
    grid-template-columns: 1fr;
  }
}

.template-pricing__card {
  height: 100%;
}

.template-pricing__card--popular {
  transform: scale(1.05);
  position: relative;
  z-index: 1;
}

@media (max-width: 767px) {
  .template-pricing__card--popular {
    transform: none;
  }
}

.template-pricing__popular {
  display: block;
  margin-bottom: var(--space-md);
}

.template-pricing__price {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-block: var(--space-sm);
  line-height: 1;
}

.template-pricing__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-block: var(--space-lg);
}

.template-pricing__features li {
  font-size: var(--font-small);
  color: var(--text-secondary);
  line-height: 1.5;
}


/* ==========================================================================
   10. TEMPLATE FAQ
   Accordion de preguntas frecuentes
   ========================================================================== */

.template-faq__list {
  display: flex;
  flex-direction: column;
}

.template-faq__item {
  border-bottom: 1px solid var(--border);
}

.template-faq__question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) 0;
  cursor: pointer;
  font-size: var(--font-body);
  font-weight: 600;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.template-faq__question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.template-faq__question:hover {
  color: var(--primary);
}

.template-faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base), padding var(--transition-base);
}

.template-faq__answer p {
  padding-bottom: var(--space-lg);
}

.template-faq__item.active .template-faq__question::after {
  content: '−';
  color: var(--primary);
}

.template-faq__item.active .template-faq__answer {
  max-height: 300px;
}


/* ==========================================================================
   11. TEMPLATE CTA FINAL
   Sección final con gradiente
   ========================================================================== */

.template-cta-final {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.template-cta-final h2,
.template-cta-final p {
  color: white;
}

.template-cta-final .btn--outline {
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.template-cta-final .btn--outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: white;
  color: white;
}

.template-cta-final .btn--primary {
  background: white;
  color: var(--primary);
}

.template-cta-final .btn--primary:hover {
  background: var(--bg-primary);
}

.template-cta-final .text--gray {
  color: rgba(255, 255, 255, 0.7) !important;
}


/* ==========================================================================
   12. TEMPLATE MODAL
   Modal de compra
   ========================================================================== */

.template-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.template-modal__content {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: var(--shadow-xl);
}

.template-modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-size: 1.75rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.template-modal__close:hover {
  color: var(--text-primary);
  background: var(--bg-primary);
}


/* ==========================================================================
   13. TEMPLATE REQUIREMENTS
   Bloque de requisitos del sistema
   ========================================================================== */

.template-requirements {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 600px;
  margin-inline: auto;
}

.template-usecases {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}