/* ============================================
   Responsive — Глазная клиника «Орион»
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .header__nav { display: none; }
    .header__burger { display: flex; }
    .header__phone-pill { display: none; }
    .header__a11y-btn { display: none; }
    .header__island { height: 60px; padding: 8px 16px; }

    .hero { min-height: 480px; }
    .hero__title { font-size: clamp(2rem, 5vw, 2.8rem); }
    .hero__stats { gap: var(--spacing-xl); flex-wrap: wrap; }

    .advantages__grid { grid-template-columns: repeat(2, 1fr); }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .doctors-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: repeat(2, 1fr); }

    .appointment-form-section { grid-template-columns: 1fr; }
    .footer__grid { grid-template-columns: repeat(2, 1fr); }
    .contacts-grid-page { grid-template-columns: 1fr; }
    .about-section { grid-template-columns: 1fr; }

    .section { padding: var(--spacing-2xl) var(--spacing-lg); width: 100%; }

    /* Service hero — stack buttons earlier */
    .service-hero__actions { flex-wrap: wrap; }
}

/* Mobile */
@media (max-width: 768px) {
    .hero { min-height: 420px; width: 100%; border-radius: 0; margin: 0; }
    .hero__container { padding-top: var(--spacing-2xl); padding-bottom: var(--spacing-2xl); }
    .hero__title { font-size: 2rem; }
    .hero__subtitle { font-size: var(--font-size-base); }
    .hero__stats { gap: var(--spacing-lg); }
    .hero__stat-value { font-size: var(--font-size-xl); }
    .hero__actions { flex-direction: column; align-items: stretch; }

    .section { width: 100%; border-radius: 0; padding: var(--spacing-xl) 0; margin: 0; }
    .section .container { padding: 0 16px; max-width: 100%; }
    .container { max-width: 100%; }
    .btn { max-width: 100%; white-space: normal; overflow-wrap: break-word; }
    .section__title { font-size: var(--font-size-2xl); }

    .page-hero { width: 100%; border-radius: 0; margin: 0; padding: 100px var(--spacing-md) 32px; }
    .page-hero__title { font-size: var(--font-size-2xl); }

    .advantages__grid { grid-template-columns: 1fr 1fr; gap: var(--spacing-md); }
    .advantage-card { padding: var(--spacing-md); }
    .advantage-card__icon { width: 48px; height: 48px; }

    .services-grid { grid-template-columns: 1fr; }
    .doctors-grid { grid-template-columns: 1fr; }
    .card-grid--3 { grid-template-columns: 1fr; }
    .card-grid--4 { grid-template-columns: 1fr 1fr; }

    .contact-grid { grid-template-columns: 1fr; gap: var(--spacing-md); }
    .map-container { height: 280px; }

    .info-banner { flex-direction: column; gap: var(--spacing-md); }
    .info-banner__icon { width: 48px; height: 48px; }

    .price-card__grid td,
    .price-card__grid th { padding: 10px var(--spacing-md); font-size: var(--font-size-sm); }

    .footer__grid { grid-template-columns: 1fr; gap: var(--spacing-xl); }
    .footer__bottom { flex-direction: column; gap: var(--spacing-md); text-align: center; }
    .footer__legal { text-align: center; }
    .footer__dev-credit { margin: 8px auto 0; }

    .header { padding: 8px 10px 0; }
    .header__island { border-radius: var(--radius-lg); }

    .mobile-menu { top: 76px; }

    /* #5 — Hide swiper arrows on mobile, keep dots */
    .swiper-nav-btn { display: none; }
    .swiper-nav-row { gap: 0; }

    /* #7 — Cookie consent stack */
    .cookie-consent { flex-direction: column; gap: var(--spacing-sm); text-align: center; }
    .notice-bar__inner { flex-direction: column; gap: 12px; text-align: center; }
    .notice-bar__actions { width: 100%; justify-content: center; }

    /* #9 — Service hero actions stack on mobile */
    .service-hero__actions { flex-direction: column; align-items: stretch; }

    /* #10 — About features — earlier break */
    .about-features { grid-template-columns: 1fr; }

    /* #13 — Accordion — tighter padding on mobile */
    .accordion__header { padding: var(--spacing-md); }
    .accordion__content { padding: 0 var(--spacing-md) var(--spacing-md); }
    .accordion__title { font-size: var(--font-size-sm); }

    /* CTA block — stack price and button */
    .cta-block__action { flex-direction: column; text-align: center; padding: var(--spacing-lg); }
    .cta-block__features { flex-direction: column; align-items: center; gap: var(--spacing-md); }

    /* Price tables — prevent overflow */
    .price-table { min-width: auto; }
    .price-table td { padding: 10px 12px; font-size: var(--font-size-sm); }
    .price-table td:first-child { word-break: break-word; }
    .price-table td:last-child { white-space: normal; }

    /* Review cards grid — force single column */
    .card-grid[style] { grid-template-columns: 1fr !important; }

    /* #8 — Floating CTA + messengers — avoid overlap */
    .floating-cta { bottom: 20px; left: 16px; right: 16px; }
    .floating-cta__btn { width: 100%; justify-content: center; padding: 16px 24px; }
    .floating-messengers { bottom: 80px; right: 16px; gap: 10px; }
    .floating-btn { width: 46px; height: 46px; border-radius: 23px; }
    .floating-btn svg { width: 20px; height: 20px; }
    .floating-btn__label { display: none; }
    .scroll-top { bottom: 148px; right: 16px; }

    /* Section group — no border-radius on mobile */
    .section-group { border-radius: 0; width: 100%; margin: 0; }

    /* Promo card premium — single column, no clipping */
    .promo-card-premium { grid-template-columns: 1fr; overflow: visible; }
    .promo-card-premium__visual { min-height: 200px; order: -1; }
    .promo-card-premium__content { padding: 20px 16px; text-align: left; }
    .promo-card-premium__title { font-size: 1.25rem; word-wrap: break-word; overflow-wrap: break-word; }
    .promo-card-premium__desc { font-size: 0.875rem; word-wrap: break-word; overflow-wrap: break-word; }
    .promo-card-premium__features li { font-size: 0.875rem; }
    .promo-card-premium__cta { width: 100%; justify-content: center; padding: 14px 16px; font-size: 0.875rem; }
    .promo-card-premium__price-value { font-size: 2rem; }

    /* Page hero text */
    .page-hero__title { word-wrap: break-word; overflow-wrap: break-word; }
}

/* Small mobile */
@media (max-width: 480px) {
    .hero { min-height: 380px; border-radius: 0; }
    .hero__title { font-size: 1.75rem; }
    /* #14 — Hero stats — overflow protection */
    .hero__stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-md); overflow: hidden; }
    .hero__stat-value { font-size: var(--font-size-lg); }

    .advantages__grid { grid-template-columns: 1fr; }
    .card-grid--4 { grid-template-columns: 1fr; }

    .appointment-form { padding: var(--spacing-lg); }

    .service-hero__title { font-size: var(--font-size-2xl); }
    .service-hero__actions { flex-direction: column; align-items: stretch; }

    /* Tighter section padding */
    .section { padding: var(--spacing-lg) 0; width: 100%; border-radius: 0; margin: 0; }
    .section .container { padding: 0 12px; }
    .page-hero { padding: 90px var(--spacing-sm) 24px; }

    /* Smaller floating buttons */
    .floating-btn { width: 42px; height: 42px; border-radius: 21px; }
    .floating-messengers { bottom: 76px; right: 12px; gap: 8px; }
    .floating-cta { bottom: 16px; left: 12px; right: 12px; }
    .scroll-top { bottom: 140px; right: 12px; }
}

/* Print */
@media print {
    .header, .footer, .mobile-menu, .a11y-toolbar, .appointment-form-section, .map-container { display: none !important; }
    .section { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
    body { color: #000; background: #fff; }
}
