/* ============================================================
   PLASTICOS - Responsive Stylesheet
   Breakpoints: 1024px (tablet landscape), 768px (tablet),
                640px (mobile), 480px (small mobile)
   ============================================================ */

/* ---------- Large desktop down to 1024px ---------- */
@media (max-width: 1200px) {
  :root {
    --space-9: 5rem;
    --space-8: 3.5rem;
  }
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1.1fr; }
}

/* ---------- Tablet landscape 1024px ---------- */
@media (max-width: 1024px) {
  :root { --header-h: 72px; }

  .hero-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .hero-content { max-width: 100%; text-align: center; margin: 0 auto; }
  .hero-cta { justify-content: center; }
  .hero-trust { justify-content: center; }
  .hero-visual { max-width: 560px; margin: 0 auto; }

  .intro-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .intro-image { max-width: 520px; margin: 0 auto; order: -1; }

  .doctor-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .doctor-image { max-width: 380px; margin: 0 auto; }
  .doctor-content { text-align: center; }
  .doctor-creds { justify-items: center; }
  .doctor-cred { justify-content: center; }

  .location-grid { grid-template-columns: 1fr; }
  .cta-banner-grid { grid-template-columns: 1fr; text-align: center; }
  .cta-banner-actions { justify-content: center; }

  .gallery-preview-grid { grid-template-columns: repeat(3, 1fr); }

  .treatment-layout { grid-template-columns: 1fr; }
  .treatment-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .treatment-sidebar .sidebar-card { flex: 1 1 280px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-5); }
  .footer-col.brand { grid-column: 1 / -1; }

  /* Treatment grid: two columns from tablet landscape down */
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-card-cta { grid-column: span 2; flex-direction: column; align-items: center; text-align: center; }
  .services-grid .service-card:nth-of-type(7) { grid-column: span 2; }
  /* Bento grid collapses to 2 columns on tablet; rows size to content again */
  .why-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; }
  .why-card-feature { grid-column: span 2; grid-row: span 1; }
  .why-card-wide { grid-column: span 2; }
}

/* The inline nav replaces the hamburger above 768px, so a menu left open by a
   resize must not linger — and the scroll lock that goes with it is scoped to
   the mobile block below, so the page stays scrollable here. */
@media (min-width: 769px) {
  .mobile-menu.open { display: none; }
}

/* ---------- Tablet header 769–1024: inline nav returns, tightened to fit ---------- */
@media (max-width: 1024px) and (min-width: 769px) {
  .nav-menu { gap: var(--space-4); }
  .nav-link { font-size: 0.9rem; }
  /* Number stays one tap away in the topbar, which is visible in this band */
  .nav-phone { display: none; }
}

/* ---------- Tablet 768px ---------- */
@media (max-width: 768px) {
  :root {
    --space-9: 4rem;
    --space-8: 3rem;
    --space-7: 2.5rem;
  }
  .container { padding: 0 var(--space-4); }
  .topbar { display: none; }
  .nav-menu { display: none; }
  .nav-phone { display: none; }
  .hamburger { display: flex; }
  html.menu-open { overflow: hidden; }
  .section, .section-sm { padding: var(--space-7) 0; }

  .hero { padding: var(--space-6) 0 var(--space-7); }
  .hero h1 { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .hero-lead { font-size: 1.05rem; }
  .hero-trust { gap: var(--space-4); }
  .hero-trust-num { font-size: 1.3rem; }
  .hero-badge { padding: var(--space-3) var(--space-4); }
  .hero-badge-name { font-size: 0.95rem; }

  /* Service cards: 2-column grid on mobile for a compact, scannable layout */
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  /* Hide "Treatment" word in link on mobile to prevent truncation */
  .link-full { display: none; }
  .why-grid { grid-template-columns: 1fr; }
  .why-card-feature, .why-card-wide { grid-column: span 1; }
  /* Treatment cards: two per row, content always visible */
  .service-card-image { aspect-ratio: 16 / 12; }
  .service-card-number { font-size: 1.9rem; top: var(--space-2); right: var(--space-3); }
  .service-card-tag { font-size: 0.58rem; padding: 0.22rem 0.55rem; top: var(--space-3); left: var(--space-3); max-width: 62%; }
  .service-card-body { padding: var(--space-4); gap: 0.35rem; }
  .service-card h3 { font-size: 0.95rem; line-height: 1.25; }
  .service-card p { font-size: 0.8rem; line-height: 1.5; }
  .service-card-link { font-size: 0.78rem; }
  .service-card-link svg { width: 13px; height: 13px; }
  /* CTA card: full width on mobile, extra bottom space for floating buttons */
  .service-card-cta { grid-column: span 2; flex-direction: column; align-items: center; text-align: center; padding: var(--space-5) var(--space-4) var(--space-6); margin-bottom: 90px; }
  /* 7th treatment card spans full width on mobile to avoid orphan row */
  .services-grid .service-card:nth-of-type(7) { grid-column: span 2; }
  .services-grid .service-card:nth-of-type(7) h3 { font-size: 1.05rem; }
  .services-grid .service-card:nth-of-type(7) p { font-size: 0.85rem; }
  /* Add bottom padding to services section so floating buttons don't overlap CTA */
  .section-alt { padding-bottom: var(--space-7); }
  .gallery-preview-grid { grid-template-columns: repeat(2, 1fr); }
  .doctor-creds { grid-template-columns: 1fr; }

  .form-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .location-map { min-height: 280px; }
  .location-map iframe { min-height: 280px; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .floating-actions { bottom: var(--space-4); right: var(--space-4); }
  .floating-btn { width: 52px; height: 52px; }

  .lightbox-prev { left: var(--space-2); }
  .lightbox-next { right: var(--space-2); }
  .lightbox-close { top: var(--space-2); right: var(--space-2); }

  .page-hero { padding: var(--space-6) 0; }
  .page-hero h1 { font-size: clamp(1.7rem, 6vw, 2.2rem); }
  .page-hero p { font-size: 1rem; }
}

/* ---------- Mobile 640px ---------- */
@media (max-width: 640px) {
  /* Header: keep the logo at its true proportions, hide the desktop CTA so nothing crowds it */
  .nav { gap: var(--space-3); }
  .logo-link img { height: 56px; }
  .nav-cta { display: none; }
  .btn { padding: 0.8rem 1.3rem; font-size: 0.92rem; }
  .hero-cta { flex-direction: column; align-items: stretch; gap: var(--space-2); }
  .hero-cta .btn { width: 100%; }
  .hero-trust { flex-direction: column; gap: var(--space-3); align-items: center; text-align: center; }
  .hero-trust-item { align-items: center; }

  .cta-banner-actions { flex-direction: column; align-items: stretch; }
  .cta-banner-actions .btn { width: 100%; }

  .form-card { padding: var(--space-5); }
  .gallery-filters { gap: var(--space-2); }
  .gallery-filter { padding: 0.5rem 0.9rem; font-size: 0.85rem; }

  .why-card { padding: var(--space-5); }

  .treatment-hero-image { aspect-ratio: 16/9; }
  .treatment-sidebar { flex-direction: column; }
}

/* ---------- Small mobile 480px ---------- */
@media (max-width: 480px) {
  .container { padding: 0 var(--space-3); }
  .hero h1 { font-size: 1.7rem; }
  .section-head h2, h2 { font-size: 1.5rem; }
  h1 { font-size: 1.7rem; }
  .gallery-preview-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  /* Treatment cards: single column for readability */
  .services-grid { grid-template-columns: 1fr; }
  .services-grid .service-card:nth-of-type(7) { grid-column: span 1; }
  .service-card-cta { grid-column: span 1; }
  .doctor-image::before { display: none; }
  .hero-shape { display: none; }
  .floating-actions { bottom: var(--space-3); right: var(--space-3); }
  .floating-btn { width: 48px; height: 48px; }
  .floating-btn svg { width: 22px; height: 22px; }
}

/* ---------- Very small mobile 375px — roomier type inside the single column ---------- */
@media (max-width: 375px) {
  .service-card-image { aspect-ratio: 16 / 10; }
  .service-card h3 { font-size: 1.05rem; }
  .service-card p { font-size: 0.86rem; }
  .service-card-link { font-size: 0.85rem; }
  .service-card-link .link-full { display: inline; }
  .service-card-number { font-size: 2.2rem; top: var(--space-3); right: var(--space-4); }
  .service-card-tag { font-size: 0.62rem; padding: 0.25rem 0.6rem; top: var(--space-3); left: var(--space-3); max-width: 70%; }
  .service-card-cta { margin-bottom: var(--space-5); }
}

/* ---------- Print ---------- */
@media print {
  .header, .topbar, .floating-actions, .footer, .ba-section, .cta-banner, .nav-cta, .hamburger, .mobile-menu { display: none !important; }
  body { font-size: 11pt; }
  .section { padding: 1rem 0; }
  a { color: var(--charcoal); text-decoration: underline; }
}

/* ---------- Before & After comparison band ---------- */
@media (max-width: 1024px) {
  .ba-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .ba-copy { text-align: center; }
  .ba-copy p, .ba-note { max-width: 620px; margin-left: auto; margin-right: auto; }
  .ba-slider { margin: 0 auto; }
}

@media (max-width: 768px) {
  .ba-section { padding: var(--space-7) 0; }
  .ba-slider { max-width: 420px; }
  .ba-handle-grip { width: 42px; height: 42px; }
}
