/* ================================================
   RESPONSIVE.CSS — glasscor-design
   Mobile-first breakpoints
   ================================================ */

/* ── Tablet grande: ≤ 1100px ──────────────────── */
@media (max-width: 1100px) {
  :root { --section-py: 72px; }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 36px;
  }

  .footer-grid .footer-col:last-child {
    grid-column: 1 / -1;
  }
}

/* ── Product detail grid: ≤ 960px ─────────────── */
@media (max-width: 960px) {
  .product-detail-grid {
    grid-template-columns: 1fr !important;
  }

  .product-detail-grid aside {
    position: static !important;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* ── Tablet: ≤ 900px ──────────────────────────── */
@media (max-width: 900px) {
  :root {
    --section-py: 60px;
    --header-h:   64px;
  }

  /* Nav */
  .nav-menu,
  .nav-cta {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 27, 42, 0.98);
    backdrop-filter: blur(12px);
    padding: 32px 24px;
    gap: 8px;
    overflow-y: auto;
    align-items: flex-start;
    z-index: 999;
  }

  .nav-menu.open .nav-cta-mobile {
    margin-top: 16px;
    width: 100%;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu li a {
    font-size: 1rem;
    padding: 12px 16px;
    display: block;
  }

  .dropdown {
    position: static;
    transform: none !important;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    background: rgba(255,255,255,.05);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    padding: 4px 0;
    display: none;
  }

  .has-dropdown.open .dropdown {
    display: block;
  }

  .dropdown li a {
    color: rgba(255,255,255,.7) !important;
  }

  .dropdown li a:hover {
    background: rgba(255,255,255,.1) !important;
    color: var(--color-white) !important;
  }

  .dropdown-group-title {
    color: rgba(255,255,255,.4);
    padding: 8px 20px 4px;
  }

  /* Hero */
  .hero-content {
    padding-bottom: 60px;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(1),
  .stat-item:nth-child(2) {
    border-bottom: 1px solid rgba(255,255,255,.1);
  }

  /* Sectores */
  .sectores-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sectores-grid .sector-card:last-child {
    grid-column: 1 / -1;
    min-height: 280px;
  }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-badge {
    right: 16px;
    bottom: -16px;
  }

  /* Mercados */
  .mercados-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* CTA */
  .cta-inner {
    flex-direction: column;
    text-align: center;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-grid .footer-brand {
    grid-column: 1 / -1;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Products */
  .about-full-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .about-full-grid.reverse {
    direction: ltr;
  }
}

/* ── Mobile: ≤ 640px ──────────────────────────── */
@media (max-width: 640px) {
  :root {
    --section-py: 48px;
    --header-h:   60px;
  }

  .container { padding: 0 16px; }

  /* Hero */
  .hero h1 {
    font-size: 2rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Sectores */
  .sectores-grid {
    grid-template-columns: 1fr;
  }

  .sectores-grid .sector-card:last-child {
    grid-column: auto;
  }

  /* Section header */
  .section-header {
    margin-bottom: 36px;
  }

  /* About badge */
  .about-badge {
    position: static;
    margin-top: -24px;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-tagline {
    max-width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer-legal {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Form */
  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-form-wrap {
    padding: 24px 20px;
  }

  /* CTA actions */
  .cta-actions {
    flex-direction: column;
    width: 100%;
  }

  .cta-actions .btn {
    justify-content: center;
  }

  /* Products grid */
  .products-grid {
    grid-template-columns: 1fr;
  }

  /* Page hero */
  .page-hero {
    padding: calc(var(--header-h) + 36px) 0 48px;
  }

  /* Cookies */
  .cookies-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .cookies-actions {
    flex-direction: column;
    width: 100%;
  }

  .cookies-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Certs grid */
  .cert-cards {
    grid-template-columns: 1fr 1fr;
  }

  /* Float contact group */
  .float-contact-group {
    bottom: 16px;
    right: 12px;
    gap: 10px;
  }

  .float-btn {
    width: 50px;
    height: 50px;
  }

  .float-btn svg {
    width: 26px;
    height: 26px;
  }

  /* Legal */
  .legal-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ── Impresión ─────────────────────────────────── */
@media print {
  #main-header,
  #cookies-banner,
  #cookies-modal,
  .float-contact-group,
  .hero-scroll,
  .nav-hamburger {
    display: none !important;
  }

  body { font-size: 12pt; }

  .page-hero {
    padding: 24pt 0 16pt;
    background: none !important;
  }

  .page-hero-content h1 {
    color: #000 !important;
  }
}

/* ── L13/F7/F8: prefers-reduced-motion ─────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-in       { opacity: 1 !important; transform: none !important; }
  .hero-bg       { transform: none !important; }
  .float-wa,
  .float-tg      { animation: none !important; }
  #back-to-top   { transition: none !important; }
}

/* ── Mobile: back-to-top position ────────────────── */
@media (max-width: 640px) {
  #back-to-top {
    bottom: 100px;
    right: 12px;
    width: 40px;
    height: 40px;
  }
}
