/* ============================================
   iOS App-Style Mobile Experience
   Only active on screens <= 768px
   ============================================ */

/* --- iOS Safe Areas & App Chrome --- */
@supports (padding: env(safe-area-inset-bottom)) {
  :root {
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
    --safe-left: env(safe-area-inset-left);
    --safe-right: env(safe-area-inset-right);
  }
}

/* --- Bottom Tab Bar (mobile only) --- */
.tab-bar {
  display: none;
}

@media (max-width: 768px) {

  /* --- iOS System Overrides --- */
  html {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    overscroll-behavior-y: none;
  }

  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  /* Hide default scrollbar for app feel */
  body::-webkit-scrollbar { display: none; }
  body { -ms-overflow-style: none; scrollbar-width: none; }

  /* --- Simplified Mobile Header (iOS style) --- */
  .top-bar { display: none !important; }

  .navbar {
    background: rgba(255,255,255,0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid rgba(0,0,0,0.1);
    box-shadow: none;
    min-height: 56px;
  }

  .navbar.scrolled {
    box-shadow: none;
    border-bottom: 0.5px solid rgba(0,0,0,0.15);
  }

  .navbar .container {
    min-height: 56px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .navbar__logo img {
    height: 38px;
  }

  /* Hide hamburger - we use tab bar instead */
  .navbar__toggle { display: none !important; }
  .navbar__links { display: none !important; }

  /* --- Bottom Tab Bar --- */
  .tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(255,255,255,0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid rgba(0,0,0,0.12);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: center;
  }

  .tab-bar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 4px 12px;
    min-width: 56px;
    gap: 2px;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }

  .tab-bar__item svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.8;
    color: #8e8e93;
    transition: color 0.2s ease, transform 0.15s ease;
  }

  .tab-bar__item span {
    font-size: 10px;
    font-weight: 500;
    color: #8e8e93;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
  }

  .tab-bar__item.active svg { color: #007aff; }
  .tab-bar__item.active span { color: #007aff; font-weight: 600; }

  .tab-bar__item:active svg {
    transform: scale(0.85);
  }

  /* Call button - special accent */
  .tab-bar__call {
    position: relative;
  }

  .tab-bar__call .tab-call-icon {
    width: 44px;
    height: 44px;
    background: #34c759;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -18px;
    box-shadow: 0 4px 12px rgba(52,199,89,0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .tab-bar__call .tab-call-icon svg {
    color: #fff;
    width: 22px;
    height: 22px;
    stroke-width: 2.2;
  }

  .tab-bar__call:active .tab-call-icon {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(52,199,89,0.3);
  }

  .tab-bar__call span {
    color: #34c759;
    margin-top: 2px;
  }

  /* --- iOS-Style Cards --- */
  .service-card,
  .location-card,
  .pay-info-card,
  .pay-action-card,
  .contact-form {
    border-radius: 16px;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  }

  .service-card:hover,
  .location-card:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  }

  .service-card:active,
  .location-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  /* --- iOS-Style Section Headers --- */
  .section__title {
    font-size: 1.6rem;
    letter-spacing: -0.02em;
  }

  .section__label {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
  }

  /* --- iOS Hero Adjustments --- */
  .hero {
    min-height: 75vh;
    border-radius: 0 0 24px 24px;
    overflow: hidden;
  }

  .hero__badge {
    font-size: 0.75rem;
    padding: 5px 12px;
  }

  .hero__title {
    font-size: 1.8rem;
    letter-spacing: -0.02em;
  }

  .hero__text {
    font-size: 0.95rem;
  }

  .hero__phone {
    border-radius: 16px;
    padding: 14px 18px;
  }

  .hero__phone-icon {
    width: 42px;
    height: 42px;
  }

  .hero__phone-text strong { font-size: 1.2rem; }

  /* --- iOS-Style Buttons --- */
  .btn {
    border-radius: 12px;
    font-weight: 600;
    transition: transform 0.1s ease, opacity 0.1s ease;
  }

  .btn:active {
    transform: scale(0.97);
    opacity: 0.85;
  }

  .btn--primary {
    box-shadow: 0 2px 8px rgba(245,166,35,0.3);
  }

  .btn--primary:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(245,166,35,0.3);
  }

  /* --- iOS-Style Stats --- */
  .stats-bar {
    margin-top: -24px;
    padding: 0 16px;
  }

  .stats-bar__grid {
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  }

  .stats-bar__item {
    padding: 18px 12px;
  }

  .stats-bar__number { font-size: 1.5rem; }
  .stats-bar__label { font-size: 0.7rem; }

  /* --- iOS Page Headers --- */
  .page-header {
    padding: 70px 0 40px;
    border-radius: 0 0 24px 24px;
  }

  .page-header h1 {
    font-size: 1.8rem;
    letter-spacing: -0.02em;
  }

  .pay-hero {
    padding: 80px 0 40px;
    border-radius: 0 0 24px 24px;
  }

  /* --- iOS-Style CTA Banner --- */
  .cta-banner {
    margin: 0 16px;
    border-radius: 20px;
    padding: 40px 20px;
  }

  .cta-banner h2 { font-size: 1.3rem; }
  .cta-banner p { font-size: 0.95rem; }

  /* --- iOS Footer --- */
  .footer {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    border-radius: 24px 24px 0 0;
  }

  /* --- iOS-Style About --- */
  .about__image {
    border-radius: 16px;
  }

  .about__image-badge {
    border-radius: 10px;
    font-size: 0.9rem;
  }

  /* --- iOS Pull-to-refresh feel on sections --- */
  .section {
    padding: 48px 0;
  }

  .section--gray {
    margin: 0 0;
    border-radius: 0;
    background: #f2f2f7;
  }

  /* --- iOS-Style Affiliations --- */
  .affiliation-badge {
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.8rem;
  }

  /* --- iOS-Style Service List --- */
  .service-list li {
    padding: 10px 0 10px 24px;
    font-size: 0.9rem;
    border-bottom: 0.5px solid rgba(0,0,0,0.06);
  }

  .service-list li:last-child { border-bottom: none; }

  /* --- iOS-Style Info Box --- */
  .info-box {
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    background: #fff9ef;
  }

  /* --- iOS-Style Pay Page --- */
  .pay-layout {
    gap: 24px;
  }

  .pay-btn {
    border-radius: 14px;
    font-size: 1.1rem;
    padding: 16px 28px;
  }

  .pay-btn:active {
    transform: scale(0.97);
  }

  .pay-step {
    border-bottom: 0.5px solid rgba(0,0,0,0.06);
  }

  .pay-step__number {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .pay-qr img {
    width: 160px;
    height: 160px;
  }

  /* --- iOS-Style Contact Cards --- */
  .contact-info-cards .location-card {
    border-radius: 16px;
  }

  /* --- iOS-Style Policy Table --- */
  .policy-table th {
    background: #f2f2f7;
    font-size: 0.8rem;
  }

  .policy-table th,
  .policy-table td {
    padding: 12px 14px;
    font-size: 0.9rem;
    border-bottom: 0.5px solid rgba(0,0,0,0.08);
  }

  /* --- iOS-Style Form Inputs --- */
  .form-group input,
  .form-group textarea,
  .form-group select {
    border-radius: 12px;
    border: 1px solid #d1d1d6;
    padding: 14px 16px;
    font-size: 16px; /* Prevents iOS zoom on focus */
    -webkit-appearance: none;
    appearance: none;
    background: #fff;
  }

  .form-group input:focus,
  .form-group textarea:focus,
  .form-group select:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
  }

  .form-group label {
    font-size: 0.85rem;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  /* --- Scroll to top - hidden on mobile (use tab bar) --- */
  .scroll-top { display: none !important; }

  /* --- Fade-in animations - quicker on mobile --- */
  .fade-in {
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(12px);
  }

  /* --- iOS-style grouped list --- */
  .prose ul {
    background: var(--white);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
  }

  .prose ul li {
    padding: 12px 16px 12px 36px;
    border-bottom: 0.5px solid rgba(0,0,0,0.06);
    margin: 0;
  }

  .prose ul li:last-child { border-bottom: none; }

  .prose ul li::before {
    left: 14px;
    color: #34c759;
  }
}

/* --- Small phones --- */
@media (max-width: 390px) {
  .tab-bar__item { min-width: 48px; padding: 4px 8px; }
  .tab-bar__item span { font-size: 9px; }
  .tab-bar__call .tab-call-icon { width: 40px; height: 40px; margin-top: -14px; }
  .hero__title { font-size: 1.5rem; }
  .stats-bar__grid { grid-template-columns: repeat(2, 1fr); }
  .stats-bar__item:nth-child(2) { border-right: none; }
}
