/* ============================================================
   FLOW K9 — Mobile-specific overrides
   v2.9.0 — Full cross-browser overflow fix
   Target: iPhone SE (375px) through iPhone 15 Pro Max (430px)
            Samsung Galaxy S series (360–412px)
            iPad (768px+), all desktop browsers
   ============================================================ */

/* ── GLOBAL OVERFLOW PREVENTION ─────────────────────────────
   Prevents any element causing horizontal scroll on any browser.
   This is the B2G/WCAG standard approach.
   ──────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Every element respects viewport width */
img,
video,
iframe,
embed,
object,
table {
  max-width: 100%;
}

/* Grids and flex containers never overflow */
.container,
.hero-content,
.about-grid,
.services-grid,
.breeds-grid,
.standards-inner,
.contact-grid,
.footer-inner,
.dogs-grid,
.trust-banner-inner,
.clients-row,
.cta-actions {
  max-width: 100%;
  overflow: visible;
}

/* ── HERO ──────────────────────────────────────────────────── */
@media (max-width: 479px) {
  .hero {
    padding: 6.5rem 0 3rem;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .hero-desc {
    font-size: 0.93rem;
  }

  /* Photo fills column width, never overflows */
  .hero-photo-wrap {
    width: 100%;
    max-width: 100%;
  }

  /* Buttons: full width on very small phones */
  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 100%;
  }

  /* Logo sizing */
  .site-logo img {
    height: 44px;
    width: 44px;
  }

  .logo-name { font-size: 1rem; }
  .logo-sub  { font-size: 0.52rem; }
}

/* ── TRUST BANNER ──────────────────────────────────────────── */
@media (max-width: 479px) {
  .trust-items {
    gap: 0.4rem;
  }

  .trust-item {
    font-size: 0.6rem;
    padding: 0.25rem 0.6rem;
  }
}

/* ── ABOUT ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .about-image-wrap {
    aspect-ratio: 16/9;
    max-height: 260px;
    width: 100%;
  }
}

/* ── SERVICES ──────────────────────────────────────────────── */
@media (max-width: 479px) {
  .services-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .service-card {
    padding: 1.4rem 1.1rem;
    width: 100%;
  }
}

/* ── BREEDS ────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .breeds-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

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

/* ── STANDARDS ─────────────────────────────────────────────── */
@media (max-width: 899px) {
  .standards-inner {
    width: 100%;
  }

  .standards-list {
    width: 100%;
  }

  .standard-item {
    padding: 1rem;
    gap: 0.9rem;
    width: 100%;
  }

  .standard-num {
    font-size: 1.1rem;
    min-width: 1.6rem;
  }
}

/* ── CTA ───────────────────────────────────────────────────── */
@media (max-width: 479px) {
  .section-cta h2 {
    font-size: 1.5rem;
  }

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

  .cta-actions .btn {
    width: 100%;
  }
}

/* ── CONTACT ───────────────────────────────────────────────── */
@media (max-width: 479px) {
  .form-row {
    flex-direction: column;
    width: 100%;
  }

  .form-group {
    width: 100%;
  }

  .contact-item {
    padding: 0.75rem 0.85rem;
  }
}

/* ── PORTAL ────────────────────────────────────────────────── */
@media (max-width: 479px) {
  .portal-gate {
    align-items: flex-start;
    padding-top: 5.5rem;
  }

  .portal-card {
    padding: 2rem 1.25rem;
    width: 100%;
    max-width: 100%;
  }
}

/* ── FOOTER ────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
  }

  .site-footer {
    padding: var(--space-md) 0;
  }
}

/* ── NAV — very small screens (320px Samsung etc) ─────────── */
@media (max-width: 359px) {
  .logo-sub { display: none; }
  .logo-name { font-size: 0.95rem; }
}

/* ── TAP TARGETS — WCAG 2.5.5 (44×44px minimum) ──────────── */
@media (max-width: 899px) {
  .mobile-nav a {
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .footer-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* ── PORTAL DOGS GRID ──────────────────────────────────────── */
@media (max-width: 559px) {
  .dogs-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

/* ── FIREFOX SPECIFIC ──────────────────────────────────────── */
@-moz-document url-prefix() {
  .hero-content {
    width: 100%;
  }
}

/* ── SAFARI IOS SPECIFIC ──────────────────────────────────── */
@supports (-webkit-touch-callout: none) {
  .hero {
    min-height: -webkit-fill-available;
  }
}
