/* ================================================
   RESPONSIVE STYLES
   Breakpoints: Mobile (320-767px), Tablet (768-1199px), Desktop (1200px+)
   ================================================ */

/* ================================================
   TABLET STYLES (768px - 1199px)
   ================================================ */

@media (max-width: 1199px) {
    .container {
        padding: 0 32px;
    }
    
    /* Show mobile menu on tablets */
    .header__nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 400px;
        max-width: 50%;
        height: 100vh;
        background-color: var(--color-bg-card);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 100px 0 40px;
        box-shadow: var(--shadow-heavy);
        transition: all 0.3s ease;
        z-index: 9999;
        overflow-y: auto;
    }
    
    .header__nav.active {
        left: 0;
    }
    
    .header__mobile {
        display: flex;
    }
    
    .header__contact {
        display: none;
    }
    
    .header__top {
        display: none;
    }
    
    .header__right {
        display: none;
    }
    
    /* Mobile header phones */
    .header__phone {
        font-size: 14px;
        font-weight: 500;
    }
    
    .header__right {
        flex-direction: row;
        gap: 12px;
    }
    
    .logo__image {
        height: auto;
    }
    
    /* Tablet specific menu styles */
    .nav {
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 0 32px;
    }
    
    .nav__item {
        width: 100%;
        border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    }
    
    .nav__link {
        font-size: 18px;
        font-weight: 500;
        padding: 20px 0;
        color: var(--color-text-primary);
        transition: all 0.3s ease;
    }
    
    .nav__link:hover {
        color: var(--color-accent-primary);
        padding-left: 12px;
    }
    
    /* Mobile menu overlay for tablets */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.4);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-menu-header {
        display: block;
    }
    
    .mobile-contact-info {
        width: 100%;
        padding: 0 32px 32px;
        display: block;
        visibility: visible;
    }
    
    .mobile-contact-phone {
        display: block;
        font-size: 20px;
        font-weight: 600;
        color: var(--color-accent-primary);
        margin-bottom: 12px;
    }
    
    .nav__link:hover {
        color: var(--color-accent-primary);
        padding-left: 8px;
    }
    
    /* Mobile menu contact info */
    .mobile-menu-header {
        display: block;
        font-weight: 600;
        color: var(--color-accent-primary);
        margin-bottom: 8px;
        text-decoration: none;
    }
    
    .mobile-contact-address {
        font-size: 14px;
        color: var(--color-text-secondary);
        margin-bottom: 16px;
    }
    
    .mobile-contact-cta {
        background-color: var(--color-accent-primary);
        color: var(--color-white);
        padding: 12px 20px;
        border-radius: var(--border-radius-small);
        text-decoration: none;
        font-weight: 500;
        display: inline-block;
        transition: all 0.3s ease;
        font-size: 14px;
    }
    
    .mobile-contact-cta:hover {
        background-color: #4A9FD9;
        transform: translateY(-1px);
    }
    
    .header__mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
        position: relative;
    }
    
    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        padding: 8px;
        background: none;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle:hover {
        background-color: rgba(92, 177, 233, 0.1);
        border-radius: 8px;
    }
    
    .mobile-menu-toggle span {
        width: 24px;
        height: 3px;
        background-color: var(--color-text-primary);
        transition: all 0.3s ease;
        border-radius: 2px;
    }
    
    .mobile-menu-toggle--active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
        background-color: var(--color-accent-primary);
    }
    
    .mobile-menu-toggle--active span:nth-child(2) {
        opacity: 0;
        transform: translateX(20px);
    }
    
    .mobile-menu-toggle--active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
        background-color: var(--color-accent-primary);
    }
    
    /* Hero Tablet */
    .hero {
        padding: var(--section-spacing-mobile) 0;
    }
    
    .hero__content {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    
    .hero__title {
        font-size: clamp(28px, 7vw, 40px);
        line-height: 1.2;
        margin-bottom: 20px;
    }
    
    .hero__description {
        font-size: 16px;
        text-align: center;
        max-width: 100%;
        margin-bottom: 28px;
    }
    
    .hero__benefits {
        display: inline-block;
        text-align: left;
        margin-bottom: 32px;
    }
    
    .hero__benefit-item {
        font-size: 15px;
        margin-bottom: 14px;
    }
    
    .hero__cta {
        justify-content: center;
        flex-direction: column;
        gap: 16px;
    }
    
    .hero__cta .btn {
        width: 100%;
        max-width: 400px;
    }
    
    .hero__phone-link {
        font-size: 18px;
    }
    
    .promo-card {
        padding: 24px;
        text-align: center;
    }
    
    .promo-card__image {
        position: static;
        width: 100%;
        height: 200px;
        margin-top: 16px;
    }
    
    /* Services Mobile */
    .services__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .section-subtitle {
        font-size: 14px;
        margin-bottom: 32px;
        text-align: center;
    }
    
    .service-card {
        padding: 32px 20px;
    }
    
    .service-card__icon {
        width: 52px;
        height: 52px;
        margin-bottom: 20px;
    }
    
    .service-card__icon i {
        font-size: 22px;
    }
    
    .service-card__title {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .service-card__subtitle {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .service-card__description {
        font-size: 12px;
        margin-bottom: 14px;
    }
    
    .service-card__price {
        font-size: 19px;
        margin-bottom: 20px;
    }
    
    /* Family Dentistry Tablet */
    .family-dentistry {
        padding: var(--section-spacing-mobile) 0;
    }
    
    .family-dentistry__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .family-card {
        min-height: 500px;
    }
    
    .family-card__content {
        padding: 36px 32px;
    }
    
    .family-card__icon {
        width: 70px;
        height: 70px;
    }
    
    .family-card__icon i {
        font-size: 32px;
    }
    
    .family-card__title {
        font-size: 24px;
    }
    
    .family-card__description {
        font-size: 14px;
    }
    
    .family-card__services li {
        font-size: 13px;
    }
    
    /* Отключаем эффект затемнения соседней карточки на планшетах */
    .family-dentistry__grid:has(.family-card:hover) .family-card:not(:hover) {
        opacity: 1;
        transform: none;
    }
    
    /* Advantages Tablet */
    .advantages {
        padding: var(--section-spacing-mobile) 0;
    }
    
    .advantages__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .advantage-card {
        padding: 36px 32px;
        min-height: auto;
    }
    
    .advantage-card__icon {
        width: 70px;
        height: 70px;
    }
    
    .advantage-card__icon i {
        font-size: 32px;
    }
    
    .advantage-card__title {
        font-size: 18px;
    }
    
    .advantage-card__text {
        font-size: 14px;
    }
    
    /* About Tablet */
    .about__wrapper {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    
    .about__left {
        order: 1;
    }
    
    .about__right {
        order: 2;
    }
    
    .about__left .section-title {
        text-align: center;
        font-size: 28px;
    }
    
    .about__text {
        text-align: center;
    }
    
    .about__text p {
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .about__cta {
        justify-content: center;
    }
    
    .about__images {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto;
        gap: 16px;
    }
    
    .about__image-item--large {
        grid-column: 1 / 4;
        grid-row: 1;
    }
    
    .about__image-item--large img {
        min-height: 300px;
        height: 100%;
        object-fit: cover;
    }
    
    .about__image-item:not(.about__image-item--large) {
        grid-column: span 1;
        min-height: 200px;
    }
    
    .about__image-item:not(.about__image-item--large) img {
        height: 100%;
        min-height: 200px;
        object-fit: cover;
    }
    
    .about__image-item--large {
        min-height: 300px;
    }
    
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .gallery__item img {
        height: 140px;
    }
    
    /* Показываем 4-е фото на планшете */
    .gallery__item:nth-child(4) {
        display: block;
    }
    
    /* Team Mobile */
    .team {
        padding: var(--section-spacing-mobile) 0;
    }
    
    /* Team Mobile - отключаем карусель и показываем карточки просто */
    .team__carousel {
        position: static;
    }
    
    .team__slider-wrapper {
        overflow: visible;
    }
    
    .team__slider {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        width: 100%;
    }
    
    .team-member {
        visibility: visible !important;
        opacity: 1 !important;
        width: 100%;
        max-width: none;
        margin-bottom: 0;
    }
    
    /* Показываем только первых 4 врачей по умолчанию */
    .team__slider .team-member {
        display: flex;
    }
    
    .team__slider .team-member:nth-child(n+5) {
        display: none !important;
    }
    
    /* Когда показываем всех врачей */
    .team__slider.show-all .team-member:nth-child(n+5) {
        display: flex !important;
    }
    
    .team-member__name,
    .team-member__position,
    .team-member__motto {
        text-align: center;
    }
    
    .team-member__position {
        justify-content: center;
    }
    
    .team__navigation {
        display: none !important;
    }
    
    /* Кнопка показать всех врачей */
    .team__show-all {
        text-align: center;
        margin-top: 24px;
    }
    
    .team__show-all-btn {
        background: linear-gradient(135deg, #96D38A 0%, #7BC572 100%);
        color: var(--color-white);
        border: none;
        padding: 14px 32px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 12px rgba(123, 197, 114, 0.3);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .team__show-all-btn:hover {
        background: linear-gradient(135deg, #7BC572 0%, #6AB461 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(123, 197, 114, 0.4);
    }
    
    .team__show-all-btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(123, 197, 114, 0.3);
    }
    
    /* Promotions Tablet */
    .promotions {
        padding: var(--section-spacing-mobile) 0;
    }
    
    .promotions__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .promotion-card {
        min-height: auto;
        padding: 32px 24px;
    }
    
    .promotion-card__icon {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }
    
    .promotion-card__icon i {
        font-size: 32px;
    }
    
    .promotion-card__title {
        font-size: 20px;
    }
    
    .promotion-card__text {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .promotion-card__badge {
        padding: 6px 14px;
        font-size: 11px;
    }
    
    /* Equipment Tablet */
    .equipment__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .equipment-card__image {
        height: 200px;
    }
    
    .equipment-card__content {
        padding: 28px 24px;
    }
    
    .equipment-card__title {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .equipment-card__section-title {
        font-size: 13px;
    }
    
    .equipment-card__description {
        font-size: 13px;
    }
    
    .equipment-card__benefits li {
        font-size: 12px;
    }
    
    /* Clinic Gallery Mobile */
    .clinic-gallery {
        padding: var(--section-spacing-mobile) 0;
    }
    
    .clinic-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .gallery-photo-item {
        height: 200px;
    }
    
    /* Equipment Mobile */
    .equipment {
        padding: var(--section-spacing-mobile) 0;
    }
    
    /* Services Tablet */
    .services__grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .service-card {
        padding: 36px 28px;
    }
    
    .service-card__icon {
        width: 56px;
        height: 56px;
    }
    
    .service-card__icon i {
        font-size: 24px;
    }
    
    .service-card__title {
        font-size: 17px;
    }
    
    .service-card__description {
        font-size: 13px;
    }
    
    .service-card__price {
        font-size: 20px;
    }
    
    /* Appointment Mobile */
    .appointment {
        padding: var(--section-spacing-mobile) 0;
    }
    
    .appointment__wrapper {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .appointment__image img {
        min-height: 350px;
    }
    
    .appointment__right {
        padding: 32px 24px;
    }
    
    .appointment__title {
        font-size: 24px;
    }
    
    .appointment__description {
        font-size: 15px;
        margin-bottom: 24px;
    }
    
    .form-input {
        padding: 12px;
    }
    
    /* Gallery Mobile */
    .gallery-section {
        padding: var(--section-spacing-mobile) 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .gallery-item--large {
        grid-column: span 2;
        grid-row: span 1;
    }
    
    .gallery-image {
        height: 150px;
    }
    
    .gallery-item--large .gallery-image {
        height: 200px;
    }
    
    /* Reviews Mobile */
    .reviews {
        padding: var(--section-spacing-mobile) 0;
    }
    
    .reviews__platforms {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .review-platform {
        padding: 24px;
    }
    
    .platform-icon {
        width: 48px;
        height: 48px;
    }
    
    .platform-icon i {
        font-size: 20px;
    }
    
    .platform-name {
        font-size: 16px;
    }
    
    /* Contacts Mobile */
    .contacts {
        padding: var(--section-spacing-mobile) 0;
    }
    
    .contact-main {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 32px 20px;
    }
    
    .contact-main__phone {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .contacts__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .contact-card {
        padding: 20px;
    }
    
    .contacts__actions {
        flex-direction: column;
        gap: 20px;
    }
    
    .contact-buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .contact-buttons .btn {
        width: 100%;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .map-container iframe {
        height: 300px;
    }
    
    /* Footer Mobile */
    .footer {
        padding: var(--section-spacing-mobile) 0;
    }
    
    .footer__content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Modal Mobile */
    .modal {
        padding: 16px;
    }
    
    .modal__content {
        padding: 24px;
        max-height: 85vh;
    }
    
    .modal__close {
        margin-bottom: 12px;
    }
    
    .modal__title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    /* Button Adjustments Mobile */
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Typography Mobile */
    .section-title {
        font-size: clamp(20px, 6vw, 28px);
        margin-bottom: 16px;
        text-align: center;
    }
    
    .section-description {
        font-size: 14px;
        margin-bottom: var(--section-spacing-mobile);
        text-align: center;
    }
}

/* ================================================
   VERY SMALL MOBILE STYLES (320px - 480px)
   ================================================ */

@media (max-width: 480px) {
    :root {
        --container-padding-mobile: 12px;
        --section-spacing-mobile: 20px;
        --card-spacing: 12px;
    }
    
    /* Mobile menu adjustments for small screens */
    .header__nav {
        width: 90%;
        max-width: 300px;
        padding: 80px 0 20px;
    }
    
    .nav {
        padding: 0 20px;
    }
    
    .nav__link {
        font-size: 16px;
        padding: 14px 0;
    }
    
    .mobile-menu-header {
        padding: 16px 20px;
    }
    
    .mobile-contact-info {
        padding: 0 20px 20px;
    }
    
    .mobile-contact-phone {
        font-size: 18px;
    }
    
    .mobile-contact-address {
        font-size: 14px;
    }
    
    .mobile-contact-cta {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .hero__title {
        font-size: clamp(24px, 7vw, 32px);
        margin-bottom: 16px;
    }
    
    .hero__description {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .hero__benefits {
        margin-bottom: 28px;
    }
    
    .hero__benefit-item {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .hero__benefit-item i {
        font-size: 18px;
    }
    
    .hero__cta .btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 14px;
    }
    
    .hero__phone-link {
        font-size: 16px;
    }
    
    .promo-card {
        padding: 20px;
    }
    
    /* Services Very Small Mobile */
    .section-subtitle {
        font-size: 13px;
        margin-bottom: 24px;
        text-align: center;
    }
    
    .service-card {
        padding: 24px 16px;
    }
    
    .service-card__icon {
        width: 48px;
        height: 48px;
        margin-bottom: 16px;
    }
    
    .service-card__icon i {
        font-size: 20px;
    }
    
    .service-card__title {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .service-card__subtitle {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .service-card__description {
        font-size: 11px;
        margin-bottom: 12px;
        line-height: 1.5;
    }
    
    .service-card__price {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    /* Family Dentistry Very Small Mobile */
    .family-card {
        min-height: auto;
    }
    
    .family-card__content {
        padding: 28px 20px;
    }
    
    .family-card__icon {
        width: 60px;
        height: 60px;
        margin-bottom: 24px;
    }
    
    .family-card__icon i {
        font-size: 28px;
    }
    
    .family-card__title {
        font-size: 20px;
        margin-bottom: 16px;
    }
    
    .family-card__description {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .family-card__services {
        margin-bottom: 24px;
    }
    
    .family-card__services li {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .family-card__services li i {
        font-size: 14px;
    }
    
    /* Убираем hover эффекты на маленьких экранах */
    .family-card:hover {
        transform: none;
        box-shadow: var(--shadow-light);
    }
    
    /* Advantages Very Small Mobile */
    .advantage-card {
        padding: 28px 20px;
    }
    
    .advantage-card__icon {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }
    
    .advantage-card__icon i {
        font-size: 28px;
    }
    
    .advantage-card__title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .advantage-card__text {
        font-size: 13px;
        line-height: 1.6;
    }
    
    /* Убираем hover эффекты на маленьких экранах */
    .advantage-card:hover {
        transform: none;
        box-shadow: var(--shadow-light);
    }
    
    /* About Very Small Mobile */
    .about__left .section-title {
        font-size: 22px;
    }
    
    .about__text p {
        font-size: 14px;
        margin-bottom: 16px;
    }
    
    .about__cta .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
        font-size: 14px;
    }
    
    .about__images {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .about__image-item--large {
        grid-column: 1;
        grid-row: auto;
    }
    
    .about__image-item--large img {
        min-height: 250px;
        height: 100%;
        object-fit: cover;
    }
    
    .about__image-item:not(.about__image-item--large) img {
        height: 100%;
        min-height: 180px;
        object-fit: cover;
    }
    
    .about__image-item {
        min-height: 180px;
    }
    
    .about__image-item--large {
        min-height: 250px;
    }
    
    /* Убираем hover эффекты */
    .about__image-item:hover {
        transform: none;
        box-shadow: var(--shadow-medium);
    }
    
    .about__image-item:hover img {
        transform: none;
    }
    
    /* Promotions Very Small Mobile */
    .promotion-card {
        padding: 28px 20px;
    }
    
    .promotion-card__icon {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }
    
    .promotion-card__icon i {
        font-size: 28px;
    }
    
    .promotion-card__title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .promotion-card__text {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .promotion-card__badge {
        top: 16px;
        right: 16px;
        padding: 6px 12px;
        font-size: 11px;
    }
    
    /* Убираем hover эффекты */
    .promotion-card:hover {
        transform: none;
        box-shadow: var(--shadow-light);
    }
    
    /* Equipment Very Small Mobile */
    .equipment-card__image {
        height: 180px;
    }
    
    .equipment-card__content {
        padding: 24px 20px;
    }
    
    .equipment-card__title {
        font-size: 16px;
        margin-bottom: 14px;
    }
    
    .equipment-card__section {
        margin-bottom: 16px;
    }
    
    .equipment-card__section-title {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .equipment-card__description {
        font-size: 12px;
    }
    
    .equipment-card__benefits li {
        font-size: 11px;
        margin-bottom: 10px;
    }
    
    .equipment-card__benefits i {
        font-size: 14px;
    }
    
    /* Убираем hover эффекты */
    .equipment-card:hover {
        transform: none;
        box-shadow: var(--shadow-light);
    }
    
    .equipment-card:hover .equipment-card__image img {
        transform: none;
    }
    
    .appointment__right {
        padding: 24px 20px;
    }
    
    .appointment__title {
        font-size: 22px;
    }
    
    .review-platform {
        padding: 20px;
    }
    
    .contact-card {
        padding: 16px;
    }
    
    .modal__content {
        padding: 20px;
        /* margin: 12px; */
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .section-title {
        font-size: clamp(18px, 6vw, 24px);
        text-align: center;
    }
}

/* ================================================
   LANDSCAPE MOBILE ORIENTATION
   ================================================ */

@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding: 20px 0;
    }
    
    .hero__content {
        gap: 16px;
    }
    
    .promo-card__image {
        height: 150px;
    }
    
    section {
        padding: 20px 0;
    }
    
    .modal__content {
        max-height: 95vh;
    }
}

/* ================================================
   HIGH DPI / RETINA DISPLAYS
   ================================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo__icon,
    .service-card__icon i,
    .advantage-card__icon i {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ================================================
   DARK MODE SUPPORT
   ================================================ */

@media (prefers-color-scheme: dark) {
    /* Future dark mode styles can be added here */
}

/* ================================================
   REDUCED MOTION SUPPORT
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .team-member:hover .team-member__image img,
    .gallery__item:hover {
        transform: none;
    }
    
    .btn:hover,
    .service-card:hover,
    .advantage-card:hover,
    .promotion-card:hover {
        transform: none;
    }
}

/* ================================================
   PRINT STYLES
   ================================================ */

@media print {
    .header,
    .footer,
    .btn,
    .modal,
    .team__navigation,
    .equipment__navigation {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .section-title {
        break-after: avoid;
        page-break-after: avoid;
    }
}

/* ================================================
   ACCESSIBILITY IMPROVEMENTS
   ================================================ */

/* Focus styles for keyboard navigation */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid;
    }
    
    .service-card,
    .advantage-card,
    .promotion-card,
    .contact-card {
        border: 1px solid var(--color-text-secondary);
    }
}

/* ================================================
   HOVER DEVICE DETECTION
   ================================================ */

@media (hover: none) {
    /* Remove hover effects on touch devices */
    .btn:hover,
    .service-card:hover,
    .advantage-card:hover,
    .promotion-card:hover,
    .team-member:hover,
    .gallery__item:hover,
    .family-card:hover {
        transform: none;
        box-shadow: var(--shadow-light);
    }
    
    .team-member:hover .team-member__image img {
        transform: none;
        filter: grayscale(20%);
    }
    
    .family-card:hover .family-card__icon {
        transform: none;
    }
    
    .family-card:hover .family-card__icon i {
        transform: none;
    }
    
    .family-card:hover .family-card__btn {
        transform: none;
    }
    
    .family-dentistry__grid:has(.family-card:hover) .family-card:not(:hover) {
        opacity: 1;
        transform: none;
    }
    
    .advantage-card:hover {
        transform: none;
        box-shadow: var(--shadow-light);
    }
    
    .advantage-card:hover .advantage-card__icon {
        transform: none;
    }
    
    .advantage-card:hover::before {
        transform: scaleX(0);
    }
    
    .about__image-item:hover {
        transform: none;
        box-shadow: var(--shadow-medium);
    }
    
    .about__image-item:hover img {
        transform: none;
    }
    
    .about__image-item:hover::before {
        opacity: 0;
    }
    
    .promotion-card:hover {
        transform: none;
        box-shadow: var(--shadow-light);
        border-color: rgba(255, 255, 255, 0.05);
    }
    
    .promotion-card:hover .promotion-card__icon {
        transform: none;
    }
    
    .equipment-card:hover {
        transform: none;
        box-shadow: var(--shadow-light);
        border-color: rgba(255, 255, 255, 0.05);
    }
    
    .equipment-card:hover .equipment-card__image img {
        transform: none;
    }
}

/* ================================================
   WIDE SCREENS (1400px+)
   ================================================ */

@media (min-width: 1400px) {
    :root {
        --container-max-width: 1320px;
    }
    
    .hero__content {
        grid-template-columns: 2fr 400px;
        gap: 64px;
    }
    
    .section-title {
        font-size: clamp(28px, 4vw, 40px);
    }
}

/* ================================================
   EMERGENCY VISIBILITY FIX FOR ALL SCREENS
   ================================================ */

/* ================================================
   CONTACTS & FOOTER RESPONSIVE
   ================================================ */

/* Tablet */
@media (max-width: 1199px) {
    .contact-main {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 40px 32px;
    }
    
    .footer__main {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    /* Fixed mobile header (fix disappearing when header--scrolled applies) */
    .header {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10001; /* above nav overlay */
        background: var(--color-white);
    }

    /* neutralize effects that create new containing block on mobile */
    .header--scrolled {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        background-color: var(--color-white) !important;
        backdrop-filter: none !important;
        box-shadow: var(--shadow-light);
        z-index: 10001;
    }

    /* avoid double-fixed child; let parent .header be fixed */
    .header__main {
        position: static !important;
        box-shadow: none;
    }

    /* prevent content from going under the fixed header */
    body {
        padding-top: 72px; /* approximate mobile header height */
    }

    /* Contacts Mobile */
    .contact-main {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 32px 20px;
    }
    
    .contact-main__item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .contact-main__icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .contact-main__title {
        font-size: 15px;
    }
    
    .contact-main__content p {
        font-size: 14px;
    }
    
    .contact-main__phone {
        font-size: 16px;
    }
    
    /* Footer Mobile */
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer__main {
        grid-template-columns: 1fr;
        gap: 32px;
        margin-bottom: 32px;
        padding-bottom: 32px;
    }
    
    .footer__column {
        text-align: center;
    }
    
    .footer__title {
        font-size: 15px;
        margin-bottom: 16px;
    }
    
    .footer__list li {
        margin-bottom: 10px;
    }
    
    .footer__list a {
        font-size: 13px;
    }
    
    .footer__phone {
        font-size: 16px;
    }
    
    .footer__email {
        font-size: 13px;
    }
    
    .footer__address {
        font-size: 12px;
    }
    
    .footer__social-links {
        justify-content: center;
    }
    
    .footer__bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
    
    .footer__logo {
        justify-content: center;
    }
    
    .footer__copy,
    .footer__legal,
    .footer__copyright {
        font-size: 12px;
    }
    
    /* Preloader Mobile - отключаем на мобильных */
    .preloader {
        display: none !important;
    }
}

@media (max-width: 2000px) {
    /* Принудительно показываем все основные элементы на всех разрешениях */
    .service-card,
    .advantage-card,
    .team-member,
    .promotion-card,
    .equipment-item,
    .review-platform,
    .contact-card,
    .gallery-item {
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
        min-height: 50px !important;
    }
    
    section:not(.header):not(.footer) {
        display: block !important;
        visibility: visible !important;
        min-height: 50px !important;
    }
}