/* Mobile layer for the Appledental page.
   The design ships with inline styles, so overrides below use !important.
   Everything outside the media query is a no-op on desktop. */

:root {
  --olive-900: #263010;
  --olive-800: #3B4614;
  --olive-500: #8E9733;
  --olive-300: #B7BF48;
  --sage-100: #EAEED6;
  --sage-50: #F4F6EC;
  --line: rgba(38, 48, 16, .12);
  --gutter: 14px;
  --bar-height: 64px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
section[id], #termin { scroll-margin-top: 16px; }

.nav-toggle,
.mobile-bar { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (max-width: 767px) {
  body { padding-bottom: calc(var(--bar-height) + 20px + env(safe-area-inset-bottom)); }

  .page {
    padding: 12px var(--gutter) 24px !important;
    gap: 18px !important;
  }

  /* ── Header: logo + menu button; nav collapses into a panel ── */
  .site-header {
    position: sticky;
    top: 8px;
    z-index: 40;
    flex-wrap: nowrap !important;
    padding: 10px 10px 10px 16px !important;
    border-radius: 20px !important;
    box-shadow: 0 6px 24px rgba(38, 48, 16, .08) !important;
  }
  .site-header > a:first-child img { width: 30px !important; height: 36px !important; }
  .site-header > a:first-child span span:first-child { font-size: 22px !important; }
  .site-header > a:first-child span span:last-child { font-size: 8px !important; letter-spacing: 1.3px !important; }
  .header-actions { display: none !important; }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: var(--sage-100);
    color: var(--olive-900);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle__close { display: none; }
  .site-header.is-open .nav-toggle__open { display: none; }
  .site-header.is-open .nav-toggle__close { display: inline; }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none !important;
    flex-direction: column;
    gap: 0 !important;
    padding: 8px;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(38, 48, 16, .16);
    font-size: 17px !important;
  }
  .site-header.is-open .site-nav { display: flex !important; }
  .site-nav a {
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 0 14px;
    border-radius: 12px;
  }
  .site-nav a:active { background: var(--sage-50); }

  /* ── Hero ── */
  .hero { min-height: 0 !important; border-radius: 26px !important; }
  .hero-copy { padding: 30px 22px 28px !important; gap: 20px !important; }
  .hero-copy > div:first-child { font-size: 11px !important; letter-spacing: 1.8px !important; }
  .hero h1 { font-size: clamp(40px, 12vw, 52px) !important; letter-spacing: -1.5px !important; }
  .hero-copy > p { font-size: 16.5px !important; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas > a { justify-content: center; width: 100%; }
  .hero-trust {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px !important;
    padding-top: 2px !important;
  }
  .hero-trust > div {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 6px !important;
    background: rgba(255, 255, 255, .55);
    border-radius: 14px;
    padding: 12px 10px;
  }
  .hero-trust svg { width: 22px; height: 22px; }
  .hero-trust span { font-size: 12px !important; }

  .hero-booking {
    min-height: 0 !important;
    padding: 92px 14px 14px !important;
    justify-content: center !important;
  }
  .hero-note { left: 18px !important; top: 24px !important; font-size: 26px !important; }
  .booking-form { max-width: none !important; padding: 22px 18px !important; border-radius: 22px !important; }

  /* 16px stops iOS Safari from zooming into focused fields */
  .field { font-size: 16px !important; }

  /* ── Section headings ── */
  #usluge, #rezultati { padding: 18px 0 0 !important; gap: 18px !important; }
  #usluge > div:first-child > a,
  #rezultati > div:first-child > a { width: 100%; justify-content: center; }

  /* ── Services: compact row cards (icon left, text right) ── */
  .services-grid { gap: 10px !important; }
  .services-grid .card {
    display: grid !important;
    grid-template-columns: 50px 1fr;
    column-gap: 14px;
    row-gap: 4px !important;
    align-items: start !important;
    padding: 16px !important;
    border-radius: 20px !important;
  }
  .services-grid .card > span {
    grid-row: span 2;
    width: 50px !important;
    height: 50px !important;
  }
  .services-grid .card > span svg { width: 24px; height: 24px; }
  .services-grid .card h3 { margin: 2px 0 0 !important; font-size: 17px !important; }
  .services-grid .card p { font-size: 13.5px !important; line-height: 1.5 !important; }
  .card:hover { transform: none; }

  /* ── Calm banner ── */
  .calm-photo { min-height: 260px !important; }

  /* ── Before/after: swipeable carousel bleeding to the screen edge ── */
  .results-grid {
    display: flex !important;
    gap: 12px !important;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--gutter);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .results-grid::-webkit-scrollbar { display: none; }
  .results-grid > figure { flex: 0 0 78%; scroll-snap-align: start; }

  /* ── About ── */
  #o-nama { padding-top: 18px !important; }
  .about-photo { min-height: 430px !important; border-radius: 26px !important; }
  .about-thumb {
    flex: 1 1 100% !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 10;
  }

  /* ── Reviews: swipeable like results ── */
  .reviews {
    display: flex !important;
    gap: 12px !important;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .reviews::-webkit-scrollbar { display: none; }
  .reviews > figure { flex: 0 0 82%; scroll-snap-align: start; }

  /* ── Stats: 2×2 ── */
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    padding: 6px !important;
    margin-top: 0 !important;
    border-radius: 24px !important;
  }
  .stats > div {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 18px 14px !important;
  }
  .stats > div svg { width: 32px; height: 32px; }
  .stats > div > div > div:first-child { font-size: 24px !important; }
  .stats > div:last-child > div > div:first-child { font-size: 18px !important; }
  .stats > div > div > div:last-child { font-size: 12.5px !important; }

  /* ── Contact ── */
  #kontakt { padding-top: 18px !important; }
  #kontakt > div { border-radius: 26px !important; }
  #kontakt > div:last-child { padding: 24px 20px !important; }
  .contact-ctas { flex-direction: column; }
  .contact-ctas > a { justify-content: center; width: 100%; }

  /* ── Footer ── */
  .site-footer {
    flex-direction: column;
    justify-content: center !important;
    text-align: center;
    padding: 24px 18px !important;
    margin-top: 0 !important;
  }
  .site-footer nav { justify-content: center; gap: 4px 18px !important; }
  .site-footer nav a { display: inline-flex; align-items: center; min-height: 40px; }
  .site-footer > div:last-child { flex-wrap: wrap; justify-content: center; }
  .footer-divider { display: none; }
  .site-footer > div:last-child > span:last-child { flex-basis: 100%; margin-top: 6px; }

  /* ── Sticky contact bar ── */
  .mobile-bar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 50;
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 14px 36px rgba(38, 48, 16, .18);
  }
  .mobile-bar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    text-decoration: none;
    border-radius: 999px;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-bar__call,
  .mobile-bar__wa {
    flex: 0 0 48px;
    color: var(--olive-900);
    background: var(--sage-100);
  }
  .mobile-bar__wa { background: var(--olive-300); }
  .mobile-bar__book {
    flex: 1 1 auto;
    gap: 10px;
    background: var(--olive-800);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 15px;
  }
}

@media (max-width: 359px) {
  :root { --gutter: 10px; }
  .hero-trust { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr !important; }
}
