/* ============================================================
   THE TOOTH DENTAL CARE — responsive.css
   Enhanced Mobile-First Responsive Design
   ============================================================ */

/* ── Tablet (≤ 1024px) ──────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --radius-xl: 32px;
    --radius-lg: 22px;
  }

  .container { padding: 0 28px; }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-card {
    max-width: 480px;
    animation: none;
    transform: none;
    opacity: 1;
  }

  .hero-left { max-width: 100%; }
  .hero-desc { max-width: 100%; }

  .testimonial-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .intro-visual { order: -1; }

  .intro-img-wrap { aspect-ratio: 16/9; }

  .intro-stat-card { left: 16px; bottom: 16px; }
  .intro-cert-card { right: 16px; top: 16px; }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .counter-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
  }

  .counter-item:nth-child(2)::after { display: none; }
  .counter-item:nth-child(2), .counter-item:nth-child(4) {
    border-right: none;
  }
  .counter-item:nth-child(1),
  .counter-item:nth-child(2) {
    border-bottom: 1px solid rgba(255,255,255,0.12);
  }

  .timing-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .gallery-preview-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 240px 240px;
  }

  .gallery-item-large {
    grid-column: 1 / -1;
    grid-row: span 1;
  }

  .cta-inner {
    flex-direction: column;
    text-align: center;
    padding: 56px 36px;
    align-items: center;
  }

  .cta-desc { margin: 0 auto; }
  .cta-eyebrow { justify-content: center; }

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

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

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .hero-trust {
    flex-wrap: wrap;
    gap: 14px;
  }

  .hero-trust-item {
    flex: 1 1 45%;
  }

  .hero-card {
    max-width: 100%;
    width: 100%;
  }
}

/* ── Mobile (≤ 768px) ───────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --radius-xl: 24px;
    --radius-lg: 18px;
    --shadow-card: 0 4px 16px rgba(45,90,50,0.08);
  }

  html { font-size: 15px; }

  .container { 
    padding: 0 16px;
    max-width: 100%;
  }

  /* Navbar */
  .navbar {
    background: rgba(255,255,255,0.96);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  }

  .hamburger span { background: var(--gray-text); }

  .mobile-nav.open { display: flex; }

  .nav-book { padding: 10px 16px; font-size: 0.85rem; height: 44px; }

  /* Hero */
  .hero {
    overflow: visible;
  }

  .hero-content {
    padding: 24px 0 40px;
  }

  .hero-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }

  .intro-section {
    padding-top: 70px;
  }

  .hero-heading {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
    line-height: 1.2;
    margin-bottom: 16px;
  }

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

  .hero-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
  }

  .hero-actions a {
    padding: 14px 16px;
    height: 48px;
    width: 100%;
    justify-content: center;
  }

  .hero-trust {
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
  }

  .hero-trust-item {
    flex: 0 1 calc(50% - 6px);
    font-size: 0.9rem;
  }

  .hero-trust-item .trust-num {
    font-size: 1.1rem;
    font-weight: 700;
  }

  .hero-trust-item .trust-label {
    font-size: 0.75rem;
  }

  .hero-divider { display: none; }

  .hero-left {
    max-width: none;
    width: 100%;
  }

  .hero-card {
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    position: relative;
    background: rgba(255,255,255,0.08);
    color: inherit;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow:
      0 18px 40px rgba(0,0,0,0.15),
      inset 0 1px 0 rgba(255,255,255,0.16);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1;
  }

  .hero-scroll {
    display: none;
  }

  .hero-card .card-header .card-header-icon svg { color: var(--white); }
  .hero-card .card-header-text .card-title { color: var(--white); }
  .hero-card .card-header-text .card-sub { color: rgba(255,255,255,0.75); }
  .hero-card .card-info-item .info-value,
  .hero-card .info-value { color: rgba(255,255,255,0.88); }

  .hero-card .card-header {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
  }

  .card-header-text {
    flex: 1 1 auto;
    min-width: 0;
  }

  .card-open-badge {
    flex: 1 1 100%;
  }

  .card-info-list {
    gap: 14px;
    margin: 14px 0;
  }

  .card-info-item {
    gap: 10px;
  }

  .card-info-text {
    gap: 2px;
  }

  .info-label {
    font-size: 0.75rem;
  }

  .info-value {
    font-size: 0.85rem;
  }

  .card-emergency {
    gap: 10px;
    padding: 12px;
    margin: 14px 0;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .card-call-btn {
    height: 44px;
    width: 100%;
    min-width: 0;
    max-width: 240px;
    justify-content: center;
  }

  .cta-book-btn {
    height: 44px;
    font-size: 0.9rem;
    padding: 12px 16px;
  }

  /* Intro */
  .intro-section { 
    padding: 0 0 40px;
  }

  .intro-grid {
    gap: 30px;
  }

  .intro-stat-card {
    position: static;
    margin-top: 12px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 0;
  }

  .intro-cert-card {
    position: static;
    margin-bottom: 12px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 0;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .cert-icon {
    width: 32px;
    height: 32px;
  }

  .intro-img-wrap { 
    aspect-ratio: 4/3; 
    min-height: 220px;
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  .intro-visual {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .intro-cert-card + .intro-img-wrap { order: -1; }

  .intro-text {
    padding: 0;
  }

  .section-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
    line-height: 1.3;
  }

  .section-desc {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .intro-features {
    gap: 14px;
    margin: 14px 0;
  }

  .intro-feature {
    gap: 10px;
    padding: 12px;
  }

  .intro-feature-icon {
    min-width: 32px;
    width: 32px;
    height: 32px;
  }

  .intro-doctor {
    gap: 12px;
    padding: 12px 0;
    margin-top: 14px;
  }

  .intro-doctor-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 1.4rem;
  }

  .doc-name {
    font-size: 0.95rem;
    font-weight: 600;
  }

  .doc-title {
    font-size: 0.8rem;
  }

  /* Services */
  .services-home-section {
    padding: 60px 0;
  }

  .services-home-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  .service-pill-card {
    padding: 16px 12px;
    border-radius: var(--radius-md);
    text-align: center;
    gap: 6px;
    min-height: 150px;
  }

  .service-pill-card span {
    font-size: 0.7rem;
  }

  .service-pill-card h3 {
    font-size: 0.85rem;
    line-height: 1.3;
  }

  /* Why */
  .why-section { 
    padding: 60px 0;
  }

  .why-grid { 
    grid-template-columns: 1fr; 
    gap: 14px;
  }

  .why-card {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .why-card-number {
    font-size: 2rem;
  }

  .why-icon {
    width: 32px;
    height: 32px;
  }

  .why-card h3 {
    font-size: 0.95rem;
  }

  .why-card p {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  /* Gallery Preview */
  .gallery-preview-section { 
    padding: 60px 0;
  }

  .gallery-preview-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 12px;
  }

  .gallery-preview-item {
    min-height: 180px;
    border-radius: var(--radius-md);
  }

  .gallery-item-large { 
    grid-column: auto; 
    min-height: 220px;
  }

  .gallery-preview-cta {
    margin-top: 14px;
  }

  /* Before & After */
  .before-after-home-section {
    padding: 60px 0;
  }

  .before-after-home-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .before-after-patient-card {
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .patient-result-media {
    min-height: 220px;
  }

  .patient-result-copy {
    padding: 12px;
  }

  .patient-result-copy h3 {
    font-size: 0.95rem;
  }

  .patient-result-copy p {
    font-size: 0.85rem;
  }

  /* Counter */
  .counter-section { 
    padding: 50px 0;
  }

  .counter-grid { 
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
  }

  .counter-item {
    padding: 20px 12px;
    text-align: center;
  }

  .counter-icon {
    width: 28px;
    height: 28px;
  }

  .counter-number {
    font-size: 1.6rem;
  }

  .counter-label {
    font-size: 0.8rem;
  }

  .counter-item:not(:last-child)::after { display: none; }

  .counter-item:nth-child(odd) {
    border-right: 1px solid rgba(255,255,255,0.12);
  }

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

  /* Directions */
  .directions-section {
    padding: 50px 0;
  }

  .directions-panel {
    padding: 24px 16px;
    gap: 14px;
  }

  .directions-button {
    height: 44px;
    padding: 12px 16px;
  }

  /* Timing */
  .timing-section { 
    padding: 60px 0;
  }

  /* Gallery Preview */
  .gallery-preview-section { padding: 80px 0; }

  .gallery-preview-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 220px 200px 200px;
  }

  .gallery-item-large { grid-column: auto; }

  /* CTA */
  .cta-section { padding: 70px 0; }

  .cta-inner { padding: 44px 24px; border-radius: var(--radius-lg); }

  .cta-actions { width: 100%; }

  .cta-book-btn { width: 100%; justify-content: center; }

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

  .footer-brand { grid-column: auto; }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .footer-bottom-right { flex-wrap: wrap; justify-content: center; gap: 12px; }

  /* Scroll Top */
  .scroll-top { bottom: 20px; right: 20px; width: 42px; height: 42px; }

  /* WhatsApp FAB */
  .whatsapp-fab { bottom: 74px; right: 20px; padding: 12px 14px; }
  .whatsapp-fab-label { display: none; }
  .whatsapp-fab { max-width: 56px !important; }

  /* Google badge in trust bar — hide on very small */
  .hero-google-badge { display: none; }
}

/* ── Small Mobile (≤ 480px) ─────────────────────────────────── */
@media (max-width: 480px) {
  .hero-trust-item .trust-num { font-size: 0.9rem; }

  .hero-heading {
    font-size: clamp(2rem, 11vw, 2.6rem);
  }

  .hero-desc,
  .section-desc,
  .testimonial-text {
    font-size: 0.98rem;
  }

  .counter-number { font-size: 2rem; }

  .section-title { font-size: clamp(1.7rem, 7vw, 2.2rem); }

  .cta-inner { padding: 36px 18px; }

  .card-header { flex-wrap: wrap; }

  .hero-actions a,
  .btn-primary,
  .btn-sage,
  .btn-outline,
  .nav-book,
  .card-call-btn,
  .cta-book-btn {
    width: 100%;
    padding: 14px 18px;
  }

  .mobile-nav {
    padding: 90px 20px 20px;
    width: min(100%, 100vw);
  }

  .hero-content,
  .intro-section,
  .why-section,
  .counter-section,
  .timing-section,
  .gallery-preview-section,
  .cta-section,
  .testimonial-section,
  .testimonial-cta,
  footer {
    overflow-x: hidden;
  }
}

/* ── Large Desktop (≥ 1440px) ──────────────────────────────── */
@media (min-width: 1440px) {
  .container { max-width: 1320px; }

  .hero-inner { grid-template-columns: 1fr 420px; }
}

/* ── Polish additions ───────────────────────────────────────── */

/* Hide registration badge on mobile (too narrow) */
@media (max-width: 768px) {
  .hero-reg-badge { display: none; }

  .hero-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }

  .hero-content {
    padding: 24px 0 20px;
  }

  .hero-trust-item {
    flex: 1 1 100%;
  }

  .hero-actions a,
  .btn-primary,
  .btn-sage,
  .btn-outline,
  .nav-book,
  .card-call-btn,
  .cta-book-btn {
    min-width: 0;
    width: 100%;
  }

  .hamburger {
    display: flex;
  }

  .mobile-nav {
    display: flex;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 32px 72px rgba(0,0,0,0.12);
  }

  .services-home-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gallery-preview-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 16px;
    height: auto;
  }

  .gallery-preview-item {
    min-height: 180px;
  }

  .gallery-preview-item img {
    width: 100%;
    height: auto;
  }

  .patient-image,
  .ba-image,
  .before-after-card img {
    width: 100%;
    height: auto;
  }

  .testimonial-cta .btn-sage,
  .directions-button {
    min-width: 0;
    width: 100%;
  }

  .gallery-item-large { grid-column: auto; }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .intro-img-wrap {
    aspect-ratio: 4/3;
    min-height: 240px;
    border-radius: var(--radius-lg);
  }

  .intro-visual { order: 0; }

  .before-after-home-grid,
  .before-after-grid,
  .testimonial-before-after-grid,
  .contact-grid,
  .form-grid,
  .service-grid,
  .team-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .before-after-patient-card,
  .testimonial-cta-inner,
  .intro-stat-card,
  .intro-cert-card {
    width: 100%;
  }

  .patient-result-media {
    min-height: 220px;
  }

  .testimonial-cta-inner {
    padding: 30px 20px;
  }

  .mobile-nav {
    padding: 90px 16px 22px;
    width: min(100vw, 100%);
    max-width: 100%;
    overflow-y: auto;
  }

  /* Make hamburger clearly visible on small screens */
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    position: fixed;
    top: 12px;
    right: 14px;
    z-index: 1400;
    padding: 8px;
  }

  .hamburger span { background: var(--green-dark); }

  /* Reduce service section padding and card height to avoid large gaps */
  .services-home-section { padding: 20px 0; }
  .services-home-grid { grid-template-columns: 1fr; gap: 12px; grid-auto-rows: auto; }
  .service-pill-card { min-height: 0; padding: 14px; }
  .service-pill-card h3 { font-size: 1rem; }
  /* Reduce hero vertical space on small devices to bring services up */
  .hero-content { padding: 40px 0 0; }

  /* Header: hide desktop links and center logo */
  .nav-links { display: none !important; }

  /* Keep the container for CTA but hide phone/book, show only hamburger */
  .nav-cta { display: flex !important; align-items: center; gap: 8px; }
  .nav-cta .nav-phone,
  .nav-cta .nav-book { display: none !important; }
  .nav-cta .hamburger { display: flex !important; }

  .navbar .container { padding: 0 18px; }
  .navbar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    text-align: left;
  }

  .nav-logo-text {
    display: block;
  }

  .nav-logo .nav-logo-icon {
    width: 36px;
    height: 36px;
  }
  /* Ensure logo text is readable on mobile regardless of scroll state */
  .navbar {
    background: rgba(255,255,255,0.98);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  }

  .nav-logo-text .clinic-name {
    color: var(--gray-text) !important;
    font-size: 1rem;
  }

  .nav-logo-text .clinic-sub {
    color: var(--green-mid) !important;
    font-size: 0.62rem;
  }

  .mobile-nav a {
    white-space: normal;
  }

  .timing-card { width: 100%; }
}

/* Ensure gallery grid has auto height on tablet too */
@media (max-width: 1024px) {
  .gallery-preview-grid {
    height: auto;
  }

  .services-home-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
/* ===== Mobile Hero Final Fix ===== */
@media (max-width: 768px){

  .hero{
      height:auto !important;
      min-height:auto !important;
  }

  .hero-content{
      padding:90px 20px 40px !important;
  }

  .hero-inner{
      display:flex !important;
      flex-direction:column !important;
      gap:24px !important;
  }

  .hero-card{
      position:static !important;
      transform:none !important;
      margin:0 !important;
      width:100% !important;
      max-width:100% !important;
  }

  .hero-scroll{
      display:none !important;
  }
}