/* responsive.css - Glasscor Railing */

/* === TABLET (max 1024px) === */
@media (max-width: 1024px) {
  .section-padding { padding: 72px 0; }
  .productos-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-img-wrap { max-width: 600px; }
  .about-badge-float { right: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand p { max-width: 100%; }
  .sistemas-grid { grid-template-columns: 1fr 1fr; }
  .sistemas-grid .sistema-card:last-child { grid-column: 1 / -1; }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .testimonios-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .intro-grid { grid-template-columns: 1fr; }
  .intro-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .intro-item:last-child { border-bottom: none; }
  .hero-stats { gap: 32px; }
}

/* === TABLET (carousel y categorías) === */
@media (max-width: 1024px) {
  .categorias-grid { grid-template-columns: 1fr 1fr; }
  .categorias-grid .categoria-card:last-child { grid-column: 1 / -1; max-width: 480px; margin: 0 auto; }
}

/* === MOBILE LARGE (max 768px) === */
@media (max-width: 768px) {
  .topbar .topbar-left { display: none; }
  .nav { display: none; }
  .header-cta { display: none; }
  .hamburger { display: flex; }

  .nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    z-index: 999;
    padding: 100px 24px 40px;
    gap: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .nav.mobile-open .nav-item { width: 100%; }
  .nav.mobile-open .nav-link {
    padding: 16px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0;
    color: var(--navy);
  }
  .nav.mobile-open .submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--light);
    border-radius: var(--radius);
    margin: 4px 0 8px;
    display: none;
  }
  .nav.mobile-open .nav-item.sub-open .submenu { display: block; }
  .nav.mobile-open .submenu a {
    padding: 12px 16px;
    font-size: 0.95rem;
  }
  .mobile-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 1.4rem;
    color: var(--navy);
    border: none;
    cursor: pointer;
  }
  .mobile-cta {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .mobile-cta .btn { width: 100%; justify-content: center; }

  .carousel-prev, .carousel-next { display: none; }
  .categorias-grid { grid-template-columns: 1fr; }
  .categorias-grid .categoria-card:last-child { grid-column: auto; max-width: none; }

  .hero { min-height: 100svh; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .hero-stats { padding-top: 28px; margin-top: 36px; }
  .stat-num { font-size: 1.8rem; }

  .section-padding { padding: 56px 0; }
  .section-title { margin-bottom: 40px; }

  .productos-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
  .gallery-item.wide { grid-column: span 2; }
  .gallery-item.tall { grid-row: auto; }

  .sistemas-grid { grid-template-columns: 1fr; background: transparent; gap: 16px; }
  .sistema-card { border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.08); }

  .testimonios-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }

  .about-features { grid-template-columns: 1fr; }
  .about-img { height: 300px; }
  .about-badge-float { position: static; margin-top: 16px; width: max-content; }

  .cta-contact-info { flex-direction: column; gap: 20px; }

  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 28px 20px; }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-main { padding: 56px 0 32px; }
  .footer-brand { grid-column: auto; }

  .cookie-banner { left: 12px; right: 12px; bottom: 12px; padding: 20px; }
  .cookie-banner-actions { flex-direction: column; }

  .page-hero { padding: 56px 0 40px; }
  .gallery-tabs { justify-content: flex-start; overflow-x: auto; padding-bottom: 8px; flex-wrap: nowrap; }
  .tab-btn { flex-shrink: 0; }
  .prod-tabs-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding-bottom: 4px; }
  .prod-tabs-nav button { flex-shrink: 0; }
}

/* === MOBILE SMALL (max 480px) === */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 1.7rem; }
  .hero-stats { gap: 16px; }
  .stat-num { font-size: 1.5rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .gallery-item.wide { grid-column: span 2; }
  .footer-bottom .container { flex-direction: column; text-align: center; }
  .footer-bottom-links { justify-content: center; }
  .cta-section { padding: 60px 0; }
  .cta-actions { flex-direction: column; }
  .cta-actions .btn { width: 100%; justify-content: center; }
}

/* === LARGE (min 1400px) === */
@media (min-width: 1400px) {
  :root { --max-w: 1320px; }
  .hero h1 { font-size: 4.4rem; }
  .gallery-grid { grid-template-columns: repeat(5, 1fr); }
}

/* === PRINT === */
@media print {
  .topbar, .header, .cookie-banner, .cookie-settings-link, .hero-scroll,
  .fab-group, .nav, .breadcrumb { display: none; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; }
  a[href^="https"]:after, a[href^="http"]:after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
  a[href^="tel:"]:after, a[href^="mailto:"]:after { content: ""; }
  h1, h2, h3, h4 { page-break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  @page { margin: 2cm; }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
