/**
 * ELIO SOLAR - LANDING HERO SECTION (REDESIGNED)
 * Premium hero section with sodium battery focus
 * Version: 2.0
 */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */

:root {
  /* Spacing */
  --hero-padding-x: clamp(16px, 4vw, 48px);
  --hero-padding-y: clamp(48px, 8vh, 120px);
  --hero-max-width: 1400px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s cubic-bezier(0.16, 1, 0.3, 1);

  /* Sodium accent (sempre uguale) */
  --sodium-primary: #f59e0b;
  --sodium-light: #fbbf24;
  --sodium-glow: rgba(245, 158, 11, 0.35);
  --trust-green: #10b981;
}

/* ============================================
   LIGHT MODE (Default)
   ============================================ */
:root {
  --hero-bg: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
  --hero-bg-solid: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --card-bg: rgba(255, 255, 255, 0.95);
  --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  --card-border: 1px solid rgba(0, 0, 0, 0.08);
  --badge-text: #0c1222;
  --cta-secondary-border: rgba(15, 23, 42, 0.2);
  --cta-secondary-hover-bg: rgba(15, 23, 42, 0.05);
  --trust-item-bg: rgba(15, 23, 42, 0.05);
  --divider-color: rgba(15, 23, 42, 0.15);
}

/* ============================================
   DARK MODE (System preference)
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --hero-bg: linear-gradient(160deg, #0c1222 0%, #162032 50%, #1a2744 100%);
    --hero-bg-solid: #0c1222;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.7);
    --card-bg: rgba(30, 41, 59, 0.95);
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    --card-border: 1px solid rgba(255, 255, 255, 0.1);
    --badge-text: #0c1222;
    --cta-secondary-border: rgba(255, 255, 255, 0.25);
    --cta-secondary-hover-bg: rgba(255, 255, 255, 0.1);
    --trust-item-bg: rgba(255, 255, 255, 0.05);
    --divider-color: rgba(255, 255, 255, 0.2);
  }
}

/* ============================================
   HERO CONTAINER
   ============================================ */

.hero-sodium {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--hero-bg);
  color: var(--text-primary);
  padding: var(--hero-padding-y) var(--hero-padding-x);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-sodium-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--hero-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

/* ============================================
   HERO CONTENT (LEFT COLUMN)
   ============================================ */

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Exclusive Badge */
.hero-exclusive-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--sodium-primary), #d97706);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 100px;
  box-shadow: 0 4px 20px var(--sodium-glow);
  width: fit-content;
}

.hero-exclusive-badge .badge-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.hero-exclusive-badge .badge-separator {
  opacity: 0.4;
  margin: 0 2px;
}

.hero-exclusive-badge .badge-subtext {
  font-weight: 600;
}

/* Headline */
.hero-headline {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text-primary);
}

.hero-headline .highlight {
  color: var(--sodium-light);
  text-shadow: 0 0 40px var(--sodium-glow);
}

.hero-headline-sub {
  display: block;
  margin-top: 12px;
  font-size: 0.55em;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0;
}

/* Subheadline */
.hero-subheadline {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
  max-width: 540px;
}

.hero-subheadline strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================
   TRUST STRIP
   ============================================ */

.hero-trust-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.trust-stars {
  display: flex;
  gap: 2px;
}

.star-icon {
  width: 14px;
  height: 14px;
  fill: var(--sodium-light);
}

.trust-stat {
  font-weight: 700;
  color: var(--trust-green);
  font-size: 1rem;
}

.trust-shield {
  width: 20px;
  height: 20px;
  fill: var(--trust-green);
}

.trust-text {
  color: var(--text-muted);
}

.trust-divider {
  width: 1px;
  height: 24px;
  background: var(--divider-color);
}

/* ============================================
   CTA GROUP
   ============================================ */

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 8px;
}

.hero-cta--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 32px;
  background: linear-gradient(135deg, var(--sodium-primary), #d97706);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  border-radius: 14px;
  box-shadow: 0 8px 32px var(--sodium-glow);
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.hero-cta--primary .cta-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.hero-cta--primary .cta-text {
  font-size: 1.125rem;
  font-weight: 700;
}

.hero-cta--primary .cta-subtext {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
}

.hero-cta--primary .cta-icon {
  width: 24px;
  height: 24px;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.hero-cta--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(245, 158, 11, 0.5);
}

.hero-cta--primary:hover .cta-icon {
  transform: translateX(4px);
}

.hero-cta--primary:active {
  transform: translateY(-1px);
}

.hero-cta--secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 24px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 1px solid var(--cta-secondary-border);
  border-radius: 10px;
  transition: var(--transition-base);
}

.hero-cta--secondary .cta-icon-small {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.hero-cta--secondary:hover {
  background: var(--cta-secondary-hover-bg);
  border-color: var(--sodium-primary);
  color: var(--text-primary);
}

.hero-cta--secondary:hover .cta-icon-small {
  transform: translateY(2px);
}

/* ============================================
   HERO VISUAL (RIGHT COLUMN)
   ============================================ */

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* ============================================
   SAVINGS PREVIEW CARD
   ============================================ */

.hero-savings-preview {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--card-shadow);
  border: var(--card-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 420px;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.preview-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sodium-primary), #d97706);
  border-radius: 14px;
  color: #ffffff;
  flex-shrink: 0;
}

.preview-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.savings-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.savings-currency {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
}

.savings-amount {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--trust-green);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.savings-period {
  font-size: 1.125rem;
  color: var(--text-muted);
  font-weight: 500;
}

.preview-subtext {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 24px 0;
}

/* Comparison Bars */
.savings-comparison {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.comparison-bar {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 12px;
}

.bar-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.bar-track {
  height: 10px;
  background: var(--trust-item-bg);
  border-radius: 5px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-fill--red {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.bar-fill--green {
  background: linear-gradient(90deg, var(--trust-green), #059669);
}

.bar-value {
  font-size: 0.8125rem;
  font-weight: 700;
  min-width: 90px;
  text-align: right;
}

.bar-value--red {
  color: #ef4444;
}

.bar-value--green {
  color: var(--trust-green);
}

/* Features List */
.preview-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--divider-color);
}

.preview-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--trust-item-bg);
  border-radius: 8px;
}

.preview-feature svg {
  color: var(--sodium-primary);
  flex-shrink: 0;
}

/* Preview CTA */
.preview-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--sodium-primary), #d97706);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px var(--sodium-glow);
}

.preview-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.4);
}

.preview-cta:active {
  transform: translateY(0);
}

.preview-cta svg {
  transition: transform var(--transition-fast);
}

.preview-cta:hover svg {
  transform: translateX(4px);
}

/* ============================================
   ENTRY ANIMATIONS
   ============================================ */

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

.hero-content > * {
  opacity: 0;
  animation: heroFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-exclusive-badge { animation-delay: 0s; }
.hero-headline { animation-delay: 0.1s; }
.hero-subheadline { animation-delay: 0.2s; }
.hero-trust-strip { animation-delay: 0.3s; }
.hero-cta-group { animation-delay: 0.4s; }

.hero-visual {
  opacity: 0;
  animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 1200px) {
  .hero-sodium-container {
    gap: 48px;
  }

  .hero-savings-preview {
    max-width: 380px;
    padding: 28px;
  }

  .savings-amount {
    font-size: 3rem;
  }
}

@media (max-width: 1024px) {
  .hero-sodium {
    min-height: 0;
    padding: 60px var(--hero-padding-x) 80px;
  }

  .hero-sodium-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    align-items: center;
  }

  .hero-subheadline {
    max-width: 600px;
  }

  .hero-trust-strip {
    justify-content: center;
  }

  .hero-cta-group {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
    margin-bottom: 32px;
  }

  .hero-savings-preview {
    max-width: 400px;
    margin: 0 auto;
  }
}

/* ============================================
   RESPONSIVE - MOBILE (Progressive Disclosure)
   ============================================ */

@media (max-width: 768px) {
  .hero-sodium {
    padding: 56px 20px 40px;
    min-height: 0;
  }

  .hero-sodium-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Rimuovi animazioni su mobile - tutto visibile subito */
  .hero-content > * {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
  }

  /* Content FIRST on mobile */
  .hero-content {
    order: 0;
    gap: 14px;
    align-items: flex-start;
    text-align: left;
  }

  /* Badge compatto con più spazio dall'header */
  .hero-exclusive-badge {
    font-size: 0.6875rem;
    padding: 6px 12px;
    gap: 6px;
    margin-top: 12px;
  }

  /* Headline ottimizzata */
  .hero-headline {
    font-size: 1.875rem;
    line-height: 1.2;
    text-align: left;
  }

  .hero-headline-sub {
    font-size: 0.9375rem;
    margin-top: 8px;
  }

  /* Subheadline ridotta */
  .hero-subheadline {
    font-size: 0.9375rem;
    line-height: 1.5;
    text-align: left;
  }

  /* Trust strip compatta - NO scroll */
  .hero-trust-strip {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    flex-wrap: wrap;
    overflow: hidden;
    margin: 0;
  }

  .trust-item {
    font-size: 0.75rem;
    padding: 6px 10px;
    background: var(--trust-item-bg);
    border-radius: 8px;
    flex-shrink: 0;
  }

  .trust-divider {
    display: none;
  }

  /* Nasconde il terzo trust item su schermi molto piccoli */
  .trust-item:nth-child(5) {
    display: none;
  }

  /* ============================================
     SAVINGS TEASER - NASCOSTO SU MOBILE
     ============================================ */

  .hero-savings-teaser {
    display: none !important;
  }

  /* ============================================
     SAVINGS CARD - SEMPRE VISIBILE SU MOBILE
     ============================================ */

  .hero-visual {
    order: 1;
    opacity: 1 !important;
    max-height: none !important;
    overflow: visible;
    transform: none !important;
    transition: none;
    margin: 16px 0 0 0;
  }

  .hero-visual.revealed {
    opacity: 1;
    max-height: none;
    transform: none;
    margin-top: 16px;
  }

  /* Card semplificata quando espansa */
  .hero-savings-preview {
    padding: 20px;
    max-width: 100%;
    border-radius: 16px;
  }

  .preview-header {
    margin-bottom: 12px;
    gap: 10px;
  }

  .preview-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .preview-title {
    font-size: 0.875rem;
  }

  .savings-amount {
    font-size: 2.5rem;
  }

  .savings-currency {
    font-size: 1.25rem;
  }

  .preview-subtext {
    font-size: 0.8125rem;
    margin-bottom: 16px;
  }

  /* Nascondere comparison bars su mobile - troppo denso */
  .savings-comparison {
    display: none;
  }

  /* Features compatte */
  .preview-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 12px;
    margin-bottom: 0;
  }

  .preview-feature {
    font-size: 0.6875rem;
    padding: 5px 8px;
  }

  .preview-feature svg {
    width: 14px;
    height: 14px;
  }

  /* CTA dentro la card - VISIBILE su mobile */
  .preview-cta {
    display: flex !important;
    margin-top: 16px;
  }

  /* ============================================
     CTA GROUP - INLINE (non sticky footer)
     ============================================ */

  .hero-cta-group {
    position: static;
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    margin-top: 20px;
    background: transparent;
    border: none;
    box-shadow: none;
    opacity: 1 !important;
    visibility: visible !important;
    animation: none !important;
    transform: none !important;
  }

  .hero-cta--primary {
    display: inline-flex !important;
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    border-radius: 14px;
    opacity: 1 !important;
    visibility: visible !important;
    justify-content: center;
  }

  .hero-cta--primary .cta-content {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .hero-cta--primary .cta-subtext {
    font-size: 0.75rem;
    opacity: 0.9;
  }

  .hero-cta--secondary {
    display: none;
  }
}

/* Hide teaser on desktop */
.hero-savings-teaser {
  display: none;
}

/* Hide guarantee mobile on desktop */
.hero-guarantee-mobile {
  display: none;
}

/* Guarantee mobile - visible only on mobile */
@media (max-width: 768px) {
  .hero-guarantee-mobile {
    display: block;
    margin-top: 16px;
    opacity: 1 !important;
    animation: none !important;
  }

  .guarantee-mobile-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  }

  .guarantee-mobile-inner i {
    font-size: 20px;
    flex-shrink: 0;
  }

  .guarantee-mobile-text {
    font-size: 13px;
    line-height: 1.4;
  }

  .guarantee-mobile-text strong {
    font-weight: 700;
  }

  .guarantee-note {
    font-size: 11px;
    opacity: 0.85;
    font-style: italic;
  }
}

@media (max-width: 480px) {
  .hero-headline {
    font-size: 1.625rem;
  }

  .hero-headline-sub {
    font-size: 0.9rem;
  }

  .hero-exclusive-badge {
    font-size: 0.6875rem;
    padding: 8px 14px;
  }

  .savings-amount {
    font-size: 2.25rem;
  }

  .comparison-bar {
    grid-template-columns: 60px 1fr auto;
    gap: 8px;
  }

  .bar-value {
    font-size: 0.75rem;
    min-width: 75px;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .hero-content > *,
  .hero-visual {
    animation: none;
    opacity: 1;
  }

  .battery-glow {
    animation: none;
  }

  .hero-cta--primary,
  .hero-cta--secondary {
    transition: none;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.hero-cta--primary:focus-visible,
.hero-cta--secondary:focus-visible {
  outline: 3px solid var(--sodium-light);
  outline-offset: 3px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .hero-sodium {
    background: #000000;
  }

  .hero-headline,
  .hero-headline .highlight {
    color: #ffffff;
    text-shadow: none;
  }

  .hero-cta--secondary {
    border: 2px solid white;
  }

  .hero-comparison-card {
    border: 2px solid #000;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .hero-sodium {
    min-height: 0;
    padding: 40px 20px;
    background: white;
    color: black;
  }

  .battery-glow,
  .hero-cta-group,
  .hero-visual {
    display: none;
  }

  .hero-headline,
  .hero-headline .highlight {
    color: black;
    text-shadow: none;
  }
}
