/* ==========================================================================
   Casa Inteligente - Premium Design Override 2026
   REVERSIBLE: Remove <link href="/css/premium.css"> to revert to original.
   Based on: Guia Maestra de Diseno Web Premium 2026
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Premium Fonts: Space Grotesk (Display) + Inter Variable (Body)
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Premium Color Palette - Smart Home / Tech */
  --premium-primary: #0EA5E9;        /* Azul tech */
  --premium-primary-dark: #0284C7;
  --premium-primary-light: #38BDF8;
  --premium-accent: #22C55E;          /* Verde ahorro */
  --premium-accent-dark: #16A34A;
  --premium-dark: #0F172A;            /* Negro premium */
  --premium-dark-800: #1E293B;
  --premium-dark-700: #334155;
  --premium-dark-600: #475569;
  --premium-surface: #F8FAFC;
  --premium-surface-alt: #F1F5F9;
  --premium-border: #E2E8F0;
  --premium-glow: rgba(14, 165, 233, 0.15);

  /* Premium Typography */
  --font-display: 'Space Grotesk', var(--font-sans);
  --font-body: 'Inter', var(--font-sans);

  /* Premium Transitions */
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-premium: 400ms var(--ease-premium);
}

/* --------------------------------------------------------------------------
   2. Base Typography Override
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--premium-dark);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
  font-weight: 600;
  line-height: 1.25;
}

/* --------------------------------------------------------------------------
   3. Glassmorphism Navbar
   -------------------------------------------------------------------------- */
.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  transition: background var(--transition-premium), box-shadow var(--transition-premium);
}

.site-header--scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
}

.logo span,
.site-logo span {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* --------------------------------------------------------------------------
   4. Premium Hero Section
   -------------------------------------------------------------------------- */
.hero {
  min-height: 50vh;
  display: flex;
  align-items: center;
  padding: 3rem 0;
  background: linear-gradient(135deg, rgba(15,23,42,0.88) 0%, rgba(30,41,59,0.82) 40%, rgba(14,165,233,0.45) 100%),
              url('/images/hero/smart-home-hero.webp') center/cover no-repeat;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(14,165,233,0.2) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
  margin-bottom: 1rem;
  max-width: 700px;
}

.hero p {
  color: rgba(255,255,255,0.9);
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 600px;
  margin-bottom: 1.5rem;
}

.hero-buttons {
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-buttons .btn {
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  border-radius: 12px;
  transition: all var(--transition-premium);
}

.hero-buttons .btn-primary {
  background: var(--premium-primary);
  border-color: var(--premium-primary);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.hero-buttons .btn-primary:hover {
  background: var(--premium-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.45);
}

.hero-buttons .btn-secondary {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
  backdrop-filter: blur(10px);
}

.hero-buttons .btn-secondary:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   5. Section Titles - Premium
   -------------------------------------------------------------------------- */
.section-title {
  font-family: var(--font-display);
  position: relative;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 2.5rem;
}

.section-title::before {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: linear-gradient(90deg, var(--premium-primary), var(--premium-accent));
  border-radius: 2px;
  margin-bottom: 1rem;
  margin-right: 0;
}

@media (min-width: 768px) {
  .section-title {
    margin-bottom: 3rem;
  }
}

/* --------------------------------------------------------------------------
   6. Bento Grid Categories (Silo Cards)
   -------------------------------------------------------------------------- */
.silos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .silos-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .silos-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 1.25rem;
  }

  /* First two cards span wider */
  .silos-grid .silo-card:nth-child(1) {
    grid-column: span 2;
  }
}

.silo-card {
  border-radius: 16px;
  border: 1px solid var(--premium-border);
  overflow: hidden;
  transition: all var(--transition-premium);
  background: var(--color-white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
}

.silo-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  border-color: var(--premium-primary-light);
}

.silo-card-img {
  height: 180px;
  overflow: hidden;
}

.silo-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-premium);
}

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

.silo-card-content {
  padding: 1.25rem;
}

.silo-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  margin-top: 0;
}

.silo-card p {
  font-size: 0.85rem;
  color: var(--premium-dark-600);
}

.silo-icon {
  font-size: 1.75rem;
}

/* --------------------------------------------------------------------------
   7. Product Cards - Premium
   -------------------------------------------------------------------------- */
.product-card {
  border-radius: 16px;
  border: 1px solid var(--premium-border);
  overflow: hidden;
  transition: all var(--transition-premium);
  background: var(--color-white);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border-color: var(--premium-primary-light);
}

.product-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
}

.product-price {
  color: var(--premium-dark);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.product-rating {
  color: #FBBF24;
}

/* Affiliate buttons premium */
.btn-amazon {
  background: linear-gradient(135deg, #FF9900, #FF8C00);
  color: #fff;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  transition: all var(--transition-premium);
  border: none;
}

.btn-amazon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 153, 0, 0.35);
  color: #fff;
}

.btn-aliexpress {
  background: linear-gradient(135deg, #E43225, #D42B1E);
  color: #fff;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  transition: all var(--transition-premium);
  border: none;
}

.btn-aliexpress:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(228, 50, 37, 0.35);
  color: #fff;
}

/* --------------------------------------------------------------------------
   8. Blog Cards - Premium
   -------------------------------------------------------------------------- */
.blog-card {
  border-radius: 16px;
  border: 1px solid var(--premium-border);
  overflow: hidden;
  transition: all var(--transition-premium);
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.blog-card-img img {
  transition: transform 0.6s var(--ease-premium);
}

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

.blog-card-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
}

.blog-card-cat {
  color: var(--premium-primary);
  font-family: var(--font-display);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   9. Trust Section - Premium
   -------------------------------------------------------------------------- */
.trust-section {
  background: var(--premium-surface);
  border-radius: 24px;
  padding: 3rem 2rem;
  margin: 2rem 0;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .trust-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.trust-item {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: 16px;
  background: var(--color-white);
  border: 1px solid var(--premium-border);
  transition: all var(--transition-premium);
}

.trust-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.06);
  border-color: var(--premium-primary-light);
}

.trust-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
}

.trust-item h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.trust-item p {
  font-size: 0.875rem;
  color: var(--premium-dark-600);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   10. Buttons - Premium
   -------------------------------------------------------------------------- */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: 12px;
  transition: all var(--transition-premium);
  letter-spacing: -0.01em;
}

.btn-primary,
.btn.btn-primary {
  background: var(--premium-primary);
  border-color: var(--premium-primary);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

.btn-primary:hover {
  background: var(--premium-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.35);
}

/* --------------------------------------------------------------------------
   11. Footer - Premium
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--premium-dark);
  color: #94A3B8;
}

.site-footer h4 {
  font-family: var(--font-display);
  color: #F1F5F9;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-footer a {
  color: #94A3B8;
  transition: color var(--transition-premium);
}

.site-footer a:hover {
  color: var(--premium-primary-light);
}

/* --------------------------------------------------------------------------
   12. Scroll Reveal Animations
   -------------------------------------------------------------------------- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-premium), transform 0.6s var(--ease-premium);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay for cards in grids */
.scroll-reveal-stagger > *:nth-child(1) { transition-delay: 0ms; }
.scroll-reveal-stagger > *:nth-child(2) { transition-delay: 80ms; }
.scroll-reveal-stagger > *:nth-child(3) { transition-delay: 160ms; }
.scroll-reveal-stagger > *:nth-child(4) { transition-delay: 240ms; }
.scroll-reveal-stagger > *:nth-child(5) { transition-delay: 320ms; }
.scroll-reveal-stagger > *:nth-child(6) { transition-delay: 400ms; }
.scroll-reveal-stagger > *:nth-child(7) { transition-delay: 480ms; }
.scroll-reveal-stagger > *:nth-child(8) { transition-delay: 560ms; }

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

  .scroll-reveal {
    opacity: 1;
    transform: none;
  }

  .silo-card:hover,
  .product-card:hover,
  .blog-card:hover,
  .trust-item:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   14. Focus States - Premium (WCAG 2.2)
   -------------------------------------------------------------------------- */
*:focus-visible {
  outline: 3px solid var(--premium-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.btn:focus-visible {
  outline: 3px solid var(--premium-primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--premium-glow);
}

/* --------------------------------------------------------------------------
   15. Scrollbar - Premium
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--premium-surface);
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 5px;
  border: 2px solid var(--premium-surface);
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* --------------------------------------------------------------------------
   16. Article / Content Pages - Premium
   -------------------------------------------------------------------------- */
.silo-header {
  background: linear-gradient(135deg, var(--premium-surface) 0%, #fff 100%);
  padding: 2.5rem 0 2rem;
}

.silo-header h1 {
  font-family: var(--font-display);
  border-left: 4px solid var(--premium-primary);
  padding-left: 1rem;
}

/* Content width for readability */
.article-content,
.section > p,
main > .container > p {
  max-width: 720px;
}

/* Comparison tables premium */
.comparison-table-wrap {
  border-radius: 16px;
  border: 1px solid var(--premium-border);
  overflow: hidden;
}

.comparison-table thead {
  background: var(--premium-surface);
}

.comparison-table th {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--premium-dark);
}

/* FAQ Section premium */
details {
  border: 1px solid var(--premium-border);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  transition: all var(--transition-premium);
}

details[open] {
  border-color: var(--premium-primary-light);
  box-shadow: 0 4px 12px var(--premium-glow);
}

details summary {
  font-family: var(--font-display);
  font-weight: 600;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

details summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--premium-primary);
  transition: transform var(--transition-premium);
}

details[open] summary::after {
  transform: rotate(45deg);
}

details summary::-webkit-details-marker {
  display: none;
}

/* --------------------------------------------------------------------------
   17. Affiliate Disclosure Premium
   -------------------------------------------------------------------------- */
.affiliate-disclosure-box {
  border-radius: 12px;
  border-left: 4px solid var(--premium-primary);
  background: var(--premium-surface);
}

/* --------------------------------------------------------------------------
   18. Selection Color
   -------------------------------------------------------------------------- */
::selection {
  background: rgba(14, 165, 233, 0.2);
  color: var(--premium-dark);
}

/* --------------------------------------------------------------------------
   19. Products Grid Premium Layout
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --------------------------------------------------------------------------
   20. Smooth Page Transitions
   -------------------------------------------------------------------------- */
main {
  animation: fadeIn 0.4s var(--ease-premium);
}

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