/* Адаптивные стили */

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

/* Планшеты и большие планшеты */
@media (max-width: 1200px) {
    main {
        padding-top: 100px;
    }

    .hero-inner {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
        gap: 24px;
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #medical .medical-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cards-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .medical-details {
        height: auto;
    }

    /* Hide burger menu on larger screens */
    .burger {
        display: none;
    }

    /* Hide contact button first on tablet */
    .header-cta {
        display: none;
    }

    /* Hide some nav items on tablet */
    .nav-list > li:first-child,
    .nav-list > li:nth-last-child(1),
    .nav-list > li:nth-last-child(2) {
        display: none;
    }

    /* Show burger menu on tablet */
    .burger {
        display: inline-flex;
        flex-direction: column;
        gap: 3px;
        margin-left: auto;
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        justify-content: center;
        align-items: center;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
    }

    .burger-line {
        width: 20px;
        height: 2px;
        background-color: var(--color-text-main);
        transition: all 0.3s ease;
    }

    /* Enable mobile menu functionality for tablets */
    .main-nav {
        position: fixed;
        top: 110px;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 60vh;
        background-color: white;
        transform: translateY(100%);
        transition: opacity 0.3s ease, transform 0.3s ease;
        z-index: 250;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        border-radius: 0 0 12px 12px;
        opacity: 0;
        display: none;
    }

    .main-nav.is-open {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        padding: 20px;
        gap: 0;
    }

    .nav-list li {
        width: 100%;
        border-bottom: 1px solid #e5e7eb;
    }

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

    .nav-list li a {
        display: block;
        padding: 15px 20px;
        color: var(--color-text-main);
        text-decoration: none;
        font-weight: 500;
        transition: background-color 0.3s ease;
    }

    .nav-list li a:hover {
        background-color: #f8f9fa;
        color: var(--color-primary);
    }

    /* Mobile menu contact button */
    .nav-list {
        padding-bottom: 16px;
    }

    /* Show mobile contact button on tablet */
    .mobile-contact-btn {
        display: block;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid #e5e7eb;
        text-align: center;
        width: 100%;
    }

    /* Mobile contact button - full width with blue background */
    .mobile-contact-btn a {
        display: block;
        width: 100%;
        background-color: var(--color-primary);
        color: #ffffff;
        padding: 14px 20px;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        font-size: 16px;
        text-align: center;
        cursor: pointer;
        border: none;
        margin: 0;
        box-sizing: border-box;
    }

    .mobile-contact-btn a:hover {
        background-color: var(--color-primary-dark);
        color: #ffffff;
    }

    .nav-list .has-submenu > button {
        display: block;
        width: 100%;
        padding: 15px 20px;
        background: none;
        border: none;
        text-align: left;
        color: var(--color-text-main);
        font-weight: 500;
        cursor: pointer;
        border-bottom: 1px solid #e5e7eb;
    }

    .nav-list .has-submenu > button:hover {
        background-color: #f8f9fa;
        color: var(--color-primary);
    }

    /* Show hidden items in mobile menu */
    .nav-list > li:nth-last-child(1),
    .nav-list > li:nth-last-child(2),
    .nav-list > li:nth-last-child(3),
    .nav-list > li:nth-last-child(4),
    .nav-list > li:nth-last-child(5) {
        display: block !important;
    }

    /* Стили для всех выпадающих меню на планшетах и мобильных */
    .submenu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        border: none;
        padding: 4px 0 0;
        display: none;
    }

    .submenu.is-open {
        display: block;
    }

    .submenu li a {
        padding-left: 20px;
        color: #0f2647;
    }

    /* Hero directions slider - tablet and mobile */
    section.hero-directions {
        margin-top: -30px;
        margin-bottom: 30px;
        overflow: hidden;
        padding-left: 0; /* Remove padding */
        padding-right: 0; /* Remove padding */
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    section.hero-directions .hero-directions-inner {
        display: flex;
        transition: transform 0.5s ease-in-out;
        gap: 0;
        padding: 0;
        margin: 0;
        max-width: none;
    }

    section.hero-directions .hero-directions-inner.container {
        max-width: none;
        padding: 0;
        margin: 0;
    }

    section.hero-directions .hero-direction-card {
        min-width: 100vw;
        width: 100vw;
        padding: 32px 40px; /* Add horizontal padding */
        border-right: none;
        border-radius: 10px 0 0 10px; /* Rounded corners only on left */
        background-color: #283b6a;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    section.hero-directions .hero-direction-icon {
        font-size: 42px;
        margin-bottom: 20px;
    }

    section.hero-directions .hero-direction-card h3 {
        font-size: 22px;
        margin-bottom: 16px;
    }

    section.hero-directions .hero-direction-card p {
        font-size: 17px;
        line-height: 1.6;
        margin-bottom: 20px;
    }

    section.hero-directions .hero-direction-list {
        margin: 12px 0 0;
    }

    section.hero-directions .hero-direction-list li {
        font-size: 16px;
        line-height: 1.7;
        padding-left: 24px;
        margin-bottom: 12px;
    }

    section.hero-directions .hero-directions-slider-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 16px;
        padding: 0 20px;
    }

    section.hero-directions .hero-directions-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.3);
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

    section.hero-directions .hero-directions-dot.active {
        background-color: #13c5dd;
    }
}

/* Средние планшеты */
@media (max-width: 850px) {
    /* Show burger menu */
    .burger {
        display: inline-flex;
        margin-left: auto;
        flex-shrink: 0;
    }
    
    /* Hide more nav items on smaller tablets */
    .nav-list > li:first-child,
    .nav-list > li:nth-last-child(1),
    .nav-list > li:nth-last-child(2),
    .nav-list > li:nth-last-child(3) {
        display: none;
    }

    /* Enable mobile menu functionality for medium tablets */
    .main-nav {
        position: fixed;
        top: 110px;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 60vh;
        background-color: white;
        transform: translateY(100%);
        transition: opacity 0.3s ease, transform 0.3s ease;
        z-index: 250;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        border-radius: 0 0 12px 12px;
        opacity: 0;
        display: none;
    }

    .main-nav.is-open {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        padding: 20px;
        gap: 0;
    }

    .nav-list li {
        width: 100%;
        border-bottom: 1px solid #e5e7eb;
    }

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

    .nav-list li a {
        display: block;
        padding: 15px 20px;
        color: var(--color-text-main);
        text-decoration: none;
        font-weight: 500;
        transition: background-color 0.3s ease;
    }

    .nav-list li a:hover {
        background-color: #f8f9fa;
        color: var(--color-primary);
    }

    /* Mobile menu contact button */
    .nav-list {
        padding-bottom: 16px;
    }

    /* Show mobile contact button on medium tablets */
    .mobile-contact-btn {
        display: block;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid #e5e7eb;
        text-align: center;
        width: 100%;
    }

    /* Mobile contact button - full width with blue background */
    .mobile-contact-btn a {
        display: block;
        width: 100%;
        background-color: var(--color-primary);
        color: #ffffff;
        padding: 14px 20px;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        font-size: 16px;
        text-align: center;
        cursor: pointer;
        border: none;
        margin: 0;
        box-sizing: border-box;
    }

    .mobile-contact-btn a:hover {
        background-color: var(--color-primary-dark);
        color: #ffffff;
    }
}

.topbar {
  display: flex;
  width: 100vw;
  background: #23395d;
  color: #fff;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(30,40,90,0.08);
}

/* Маленькие планшеты / большие мобильные */
@media (max-width: 768px) {
    /* Show burger menu */
    .burger {
        display: inline-flex !important;
        margin-left: auto;
        flex-shrink: 0;
    }
    
    /* Hide almost all nav items, show only first few */
    .nav-list > li:first-child,
    .nav-list > li:nth-last-child(1),
    .nav-list > li:nth-last-child(2),
    .nav-list > li:nth-last-child(3),
    .nav-list > li:nth-last-child(4),
    .nav-list > li:nth-last-child(5) {
        display: none;
    }

  main {
    padding-top: 152px;
    padding-bottom: 40px;
  }

  .topbar {
    display: block;
    position: relative;
    width: 100vw;
    z-index: 200;
  }

    main {
        padding-top: 152px;
        padding-bottom: 40px;
    }

    .topbar {
        display: block;
        height: auto;
    }

    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        gap: 8px;
        padding: 8px;
    }

    .topbar-left {
        flex-wrap: wrap;
        gap: 8px;
        white-space: normal;
    }

    .topbar-left span {
        font-size: 12px;
    }

    .topbar-separator {
        display: none;
    }

    .topbar-right {
        align-self: flex-end;
        margin-top: -16px;
        padding-right: 8px;
    }

    .header-inner {
        height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        padding: 8px 16px;
        width: 100%;
    }
    .logo {
        font-weight: 800;
        font-size: 18px;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: var(--color-primary-dark);
        white-space: normal;
        word-break: break-word;
        margin-bottom: 0;
        text-align: left;
        max-width: 200px;
        line-height: 1.2;
        padding-right: 8px;
    }
    .header-cta {
        display: none;
    }

    /* Add contact button to mobile menu */
    .main-nav {
        position: fixed;
        top: 160px;
        left: 0;
        right: 0;
        height: auto;
        max-height: 60vh;
        background-color: #ffffff;
        backdrop-filter: none;
        padding: 16px;
        display: none;
        overflow-y: auto;
        border-radius: 0;
        box-shadow: none;
        z-index: 250;
        opacity: 0;
        transform: translateY(100%);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .main-nav.is-open {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .nav-list > li > a,
    .nav-link-with-sub {
        color: #0f2647;
        padding: 4px 0;
        position: relative;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 13px;
        letter-spacing: 0.08em;
    }

    .has-submenu {
        width: 100%;
    }

    .nav-link-with-sub {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .submenu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        border: none;
        padding: 4px 0 0;
        display: none;
    }

    .submenu.is-open {
        display: block;
    }

    .submenu li a {
        padding-left: 20px;
        color: #0f2647;
    }

    /* Mobile menu contact button */
    .nav-list {
        padding-bottom: 16px;
    }

    /* Show mobile contact button on mobile */
    .mobile-contact-btn {
        display: block;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid #e5e7eb;
        text-align: center;
        width: 100%;
    }

    /* Mobile contact button - full width with blue background */
    .mobile-contact-btn a {
        display: block;
        width: 100%;
        background-color: var(--color-primary);
        color: #ffffff;
        padding: 14px 20px;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        font-size: 16px;
        text-align: center;
        cursor: pointer;
        border: none;
        margin: 0;
        box-sizing: border-box;
    }

    .mobile-contact-btn a:hover {
        background-color: var(--color-primary-dark);
        color: #ffffff;
    }

    .burger {
        display: inline-flex;
        flex-direction: column;
        gap: 3px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .hero {
        padding-top: 24px;
        padding-bottom: 40px;
        min-height: 50vh;
    }

    .hero[data-hero="hospice"] {
        min-height: 40vh;
    }

    /* Hero directions slider - mobile only */
    section.hero-directions {
        margin-top: -30px;
        margin-bottom: 30px;
        overflow: hidden;
        padding-left: 0; /* Remove padding */
        padding-right: 0; /* Remove padding */
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    section.hero-directions .hero-directions-inner {
        display: flex;
        transition: transform 0.5s ease-in-out;
        gap: 0;
        padding: 0;
        margin: 0;
        max-width: none;
    }

    section.hero-directions .hero-directions-inner.container {
        max-width: none;
        padding: 0;
        margin: 0;
    }

    section.hero-directions .hero-direction-card {
        min-width: 100vw;
        width: 100vw;
        padding: 32px 40px; /* Add horizontal padding */
        border-right: none;
        border-radius: 10px 0 0 10px; /* Rounded corners only on left */
        background-color: #283b6a;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    section.hero-directions .hero-direction-icon {
        font-size: 42px;
        margin-bottom: 20px;
    }

    section.hero-directions .hero-direction-card h3 {
        font-size: 22px;
        margin-bottom: 16px;
    }

    section.hero-directions .hero-direction-card p {
        font-size: 17px;
        line-height: 1.6;
        margin-bottom: 20px;
    }

    section.hero-directions .hero-direction-list {
        margin: 12px 0 0;
    }

    section.hero-directions .hero-direction-list li {
        font-size: 16px;
        line-height: 1.7;
        padding-left: 24px;
        margin-bottom: 12px;
    }

    section.hero-directions .hero-directions-slider-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 16px;
        padding: 0 20px;
    }

    section.hero-directions .hero-directions-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.3);
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

    section.hero-directions .hero-directions-dot.active {
        background-color: #13c5dd;
    }

    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .help-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .medical-details-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .cards-grid,
    .cards-grid--4 {
        grid-template-columns: minmax(0, 1fr);
    }

    #medical .medical-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .footer-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Doctors section slider - mobile only */
    section.doctors-section {
        overflow: hidden;
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    section.doctors-section .doctors-grid {
        display: flex;
        transition: transform 0.5s ease-in-out;
        gap: 0;
        padding: 0;
        margin: 0;
        max-width: none;
    }

    section.doctors-section .doctors-grid.container {
        max-width: none;
        padding: 0;
        margin: 0;
    }

    section.doctors-section .doctor-card {
        min-width: 100vw;
        width: 100vw;
        padding: 20px;
        box-sizing: border-box;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    section.doctors-section .doctor-card-media {
        width: 200px;
        height: 200px;
        margin-bottom: 20px;
        border-radius: 50%;
        overflow: hidden;
    }

    section.doctors-section .doctor-card-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    section.doctors-section .doctor-card-body {
        padding: 0;
        max-width: 400px;
    }

    section.doctors-section .doctor-name {
        font-size: 24px;
        margin-bottom: 8px;
        color: #26365e !important;
    }

    section.doctors-section .doctor-speciality {
        font-size: 18px;
        margin-bottom: 16px;
        color: var(--color-primary);
    }

    section.doctors-section .doctor-description {
        font-size: 16px;
        line-height: 1.5;
        color: var(--color-text-muted);
    }

    section.doctors-section .doctor-socials {
        display: flex;
        justify-content: center;
        gap: 16px;
    }

    section.doctors-section .doctor-socials a {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--color-primary);
        color: white;
        border-radius: 50%;
        text-decoration: none;
        transition: background-color 0.3s ease;
    }

    section.doctors-section .doctor-socials a:hover {
        background-color: var(--color-primary-dark);
    }

    /* Contacts section mobile layout - stack vertically */
    .contacts-section .contacts-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Team section mobile layout - slider like doctors */
    section.team-section {
        overflow: hidden;
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    section.team-section .doctors-grid {
        display: flex;
        transition: transform 0.5s ease-in-out;
        gap: 0;
        padding: 0;
        margin: 0;
        max-width: none;
    }

    section.team-section .doctors-grid.container {
        max-width: none;
        padding: 0;
        margin: 0;
    }

    section.team-section .doctor-card {
        min-width: 100vw;
        width: 100vw;
        padding: 20px;
        box-sizing: border-box;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    section.team-section .doctor-card-media {
        width: 200px;
        height: 200px;
        margin-bottom: 20px;
        border-radius: 50%;
        overflow: hidden;
        border-bottom: none;
    }

    section.team-section .doctor-card-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    section.team-section .doctor-card-body {
        padding: 0;
        max-width: 400px;
    }

    section.team-section .doctor-name {
        font-size: 24px;
        margin-bottom: 8px;
    }

    section.team-section .doctor-speciality {
        font-size: 18px;
        margin-bottom: 16px;
        color: var(--color-primary);
    }

    section.team-section .doctor-description {
        font-size: 16px;
        line-height: 1.5;
        color: var(--color-text-muted);
    }

    section.team-section .doctor-socials {
        display: flex;
        justify-content: center;
        gap: 16px;
        margin-top: 16px;
    }

    section.team-section .doctor-socials a {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--color-primary);
        color: white;
        border-radius: 50%;
        text-decoration: none;
        transition: background-color 0.3s ease;
    }

    section.team-section .doctor-socials a:hover {
        background-color: var(--color-primary-dark);
    }
}

/* Hospice feature section mobile layout - photo inside container */
@media (max-width: 768px) {
    /* Fix container padding for mobile - only for hospice feature */
    .hospice-feature .container {
        padding: 0 20px !important;
        max-width: 100% !important;
    }
    
    .hospice-feature {
        position: relative;
        background: transparent !important;
        overflow: visible;
        max-width: 100vw;
        width: 100%;
    }

    .hospice-feature::before,
    .hospice-feature::after {
        display: none !important;
    }

    /* COMPLETE RESET AND OVERRIDE OF MAIN.CSS GRID STYLES */
    .section.hospice-feature .hospice-feature-inner {
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        z-index: 2 !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        padding: 30px 20px !important;
        gap: 20px !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        margin: 0 !important;
        /* FORCE GRID OVERRIDE */
        grid-template-columns: none !important;
        grid-template-rows: none !important;
        grid-template-areas: none !important;
        grid-gap: 0 !important;
        gap: 20px !important;
    }
    
    /* ULTIMATE OVERRIDE - Use inline styles approach */
    .section.hospice-feature .hospice-feature-inner[style] {
        display: flex !important;
        flex-direction: column !important;
    }

    /* COMPLETE OVERRIDE OF MAIN.CSS STYLES */
    .section.hospice-feature .hospice-feature-content {
        padding-left: 0 !important;
        border-left: none !important;
        max-width: 100% !important;
        width: 100% !important;
        z-index: 3 !important;
        background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 50%, #f8f9fa 100%) !important;
        padding: 20px !important;
        border-radius: 20px !important;
        backdrop-filter: blur(5px) !important;
        order: 2 !important;
        box-shadow: 0 8px 32px rgba(19, 197, 221, 0.15) !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        margin: 0 !important;
    }

    .section.hospice-feature .hospice-feature-content h2 {
        font-size: 24px !important;
        margin-bottom: 15px !important;
        color: #26365e !important;
        text-shadow: none !important;
        line-height: 1.2 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .section.hospice-feature .hospice-feature-content p {
        font-size: 16px !important;
        line-height: 1.5 !important;
        color: #333333 !important;
        text-shadow: none !important;
        max-width: none !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* COMPLETE OVERRIDE OF MAIN.CSS STYLES */
    .section.hospice-feature .hospice-feature-media {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        z-index: 1 !important;
        justify-content: center !important;
        align-items: center !important;
        order: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
    }

    .hospice-feature-card {
        margin: 0;
        border-radius: 20px;
        width: 100%;
        max-width: 100%;
        height: 200px;
        object-fit: cover;
        overflow: hidden;
        box-sizing: border-box;
    }

    .hospice-feature-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
    }

    .hospice-feature-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    /* Force override main.css styles */
    .hospice-feature-inner > * {
        max-width: 100% !important;
    }

    /* Mobile optimization for narnia slideshow inside hospice-feature-card */
    .hospice-feature-card .narnia-what-slideshow {
        position: relative;
        width: 100%;
        height: 200px;
        border-radius: 20px;
        overflow: hidden;
        animation: narniaWhatSlideshow 24s infinite ease-in-out;
        box-sizing: border-box;
    }

    .hospice-feature-card .narnia-what-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(19, 197, 221, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
        border-radius: 20px;
    }
}

/* Мобильные устройства */
@media (max-width: 600px) {
    /* Fix container padding for very small screens - only for hospice feature */
    .hospice-feature .container {
        padding: 0 15px !important;
        max-width: 100% !important;
    }
    
    /* Force mobile layout for very small screens */
    .hospice-feature {
        max-width: 100vw !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* COMPLETE RESET AND OVERRIDE OF MAIN.CSS GRID STYLES */
    .section.hospice-feature .hospice-feature-inner {
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        z-index: 2 !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        padding: 20px 15px !important;
        gap: 15px !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        margin: 0 !important;
        /* FORCE GRID OVERRIDE */
        grid-template-columns: none !important;
        grid-template-rows: none !important;
        grid-template-areas: none !important;
        grid-gap: 0 !important;
    }
    
    /* Additional fixes for very small screens */
    .section.hospice-feature .hospice-feature-content h2 {
        font-size: 20px !important;
        line-height: 1.3 !important;
    }
    
    .section.hospice-feature .hospice-feature-content p {
        font-size: 15px !important;
    }
    
    .section.hospice-feature .hospice-feature-card {
        height: 180px !important;
    }
    
    .section.hospice-feature .hospice-feature-card .narnia-what-slideshow {
        height: 180px !important;
    }
    
    .section.hospice-feature .hospice-feature-content {
        padding: 15px !important;
    }
    
    /* Force override all main.css styles */
    .section.hospice-feature .hospice-feature-inner,
    .section.hospice-feature .hospice-feature-content,
    .section.hospice-feature .hospice-feature-media {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Whom section mobile layout - slider like doctors */
    section.whom-section {
        overflow: hidden;
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    section.whom-section .whom-cards {
        display: flex;
        transition: transform 0.5s ease-in-out;
        gap: 30px;
        padding: 0 20px;
        margin: 30px 0 0 0;
        max-width: none;
    }

    section.whom-section .whom-cards.container {
        max-width: none;
        padding: 0;
        margin: 0;
    }

    section.whom-section .whom-card {
        min-width: calc(100vw - 80px);
        width: calc(100vw - 80px);
        padding: 20px;
        box-sizing: border-box;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    section.whom-section .whom-card-image {
        width: 100%;
        height: 170px;
        margin-bottom: 20px;
        border-radius: 14px;
        overflow: hidden;
        margin-top: auto;
    }

    section.whom-section .whom-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    section.whom-section .whom-card-title {
        font-size: 24px;
        margin-bottom: 8px;
        color: #000000;
    }

    section.whom-section .whom-card-text {
        font-size: 16px;
        line-height: 1.5;
        color: #000000;
        margin-bottom: 16px;
        max-width: 400px;
    }

    section.whom-section .whom-card-list {
        font-size: 16px;
        line-height: 1.5;
        color: #000000;
        text-align: left;
        margin-bottom: 16px;
    }

    /* Whom section mobile layout - slider like doctors */
    .hospice-team {
        position: relative;
        background: transparent !important;
        overflow: visible;
    }

    .hospice-team::before,
    .hospice-team::after {
        display: none !important;
    }

    .hospice-team-inner {
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .hospice-team-photo {
        width: 100%;
        max-width: 400px;
        order: 1;
    }

    .hospice-team-content {
        background: linear-gradient(135deg, rgba(227, 242, 253, 0.7) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(248, 249, 250, 0.7) 100%);
        padding: 20px;
        border-radius: 20px;
        text-align: left;
        box-shadow: 0 8px 32px rgba(19, 197, 221, 0.15);
        order: 2;
        max-width: 90%;
    }

    .hospice-team-content h2 {
        font-size: 28px;
        margin-bottom: 15px;
        color: #000000;
        text-shadow: none;
    }

    .hospice-team-content p {
        font-size: 16px;
        line-height: 1.5;
        color: #000000;
        text-shadow: none;
        max-width: none;
    }

    .hospice-team-block h3 {
        font-size: 18px;
        margin-bottom: 15px;
        color: #000000;
    }

    .room-name {
        font-size: 14px;
        line-height: 1.4;
        color: #000000;
    }

    .comfort-list li {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 10px;
        padding-left: 20px;
        color: #000000;
    }

    .hospice-team-card {
        margin: 0;
        border-radius: 20px;
        width: 100%;
        height: 250px;
        overflow: hidden;
    }

    .hospice-team-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    /* Hospice team section mobile layout - same design as "Наши будни" */
    .centers-hero.hospice-team-hero {
        position: relative;
        background: transparent !important;
        overflow: visible;
        margin-bottom: 0;
    }

    .centers-hero.hospice-team-hero::before,
    .centers-hero.hospice-team-hero::after {
        display: none !important;
    }

    .centers-hero-inner {
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 40px 20px;
        gap: 30px;
        grid-template-columns: none !important;
        min-height: auto !important;
    }

    .centers-hero-left,
    .centers-hero-right {
        background: linear-gradient(135deg, rgba(227, 242, 253, 0.7) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(248, 249, 250, 0.7) 100%);
        padding: 20px;
        border-radius: 20px;
        box-shadow: 0 8px 32px rgba(19, 197, 221, 0.15);
        max-width: 90%;
        width: 100%;
        backdrop-filter: blur(8px);
    }

    .centers-hero-left {
        order: 1;
        background: linear-gradient(135deg, rgba(227, 242, 253, 0.7) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(248, 249, 250, 0.7) 100%);
    }

    .centers-hero-right {
        order: 2;
        background: linear-gradient(135deg, rgba(248, 249, 250, 0.7) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(227, 242, 253, 0.7) 100%);
    }

    .centers-hero-kicker {
        font-size: 14px;
        color: #13c5dd;
        margin-bottom: 10px;
        text-transform: uppercase;
        letter-spacing: 0.12em;
    }

    .centers-hero-title {
        font-size: 28px;
        margin-bottom: 15px;
        color: #26365e;
        line-height: 1.3;
    }

    .centers-hero-right p {
        font-size: 16px;
        line-height: 1.5;
        color: #333333;
        margin-bottom: 15px;
    }

    .centers-hero-right p:last-child {
        margin-bottom: 0;
    }

    .centers-hero-list {
        display: none;
    }

    /* Hospice sponsors section mobile layout - same design as "Наши будни" */
    .hospice-sponsors {
        position: relative;
        background: transparent !important;
        overflow: visible;
    }

    .hospice-sponsors-inner {
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 40px 20px;
        gap: 30px;
        grid-template-columns: none !important;
    }

    .hospice-sponsors-content {
        background: linear-gradient(135deg, rgba(227, 242, 253, 0.7) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(248, 249, 250, 0.7) 100%);
        padding: 20px;
        border-radius: 20px;
        box-shadow: 0 8px 32px rgba(19, 197, 221, 0.15);
        max-width: 90%;
        width: 100%;
        backdrop-filter: blur(8px);
        order: 2;
    }

    .hospice-sponsors-content h2 {
        font-size: 28px;
        margin-bottom: 15px;
        color: #26365e;
        line-height: 1.2;
        font-weight: 800;
    }

    .hospice-sponsors-accent {
        width: 80px;
        height: 3px;
        background: linear-gradient(90deg, #13c5dd, #2565eb);
        border-radius: 999px;
        margin: 0 auto 15px auto;
    }

    .hospice-sponsors-content p {
        font-size: 16px;
        line-height: 1.5;
        color: #333333;
        margin-bottom: 15px;
        max-width: none;
    }

    .hospice-sponsors-content p + p {
        margin-top: 15px;
    }

    .hospice-sponsors-media {
        position: relative;
        width: 100%;
        max-width: 400px;
        z-index: 1;
        justify-content: center;
        align-items: center;
        order: 1;
    }

    .hospice-sponsors-map {
        margin: 0;
        border-radius: 20px;
        width: 100%;
        height: 250px;
        object-fit: cover;
        overflow: hidden;
        box-shadow: 0 8px 32px rgba(19, 197, 221, 0.2);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .hospice-sponsors-map:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 40px rgba(19, 197, 221, 0.3);
    }

    /* Hotel contact section mobile */
    .hospice-sponsors[aria-labelledby="hotel-contact-title"] .hospice-sponsors-content {
        background: linear-gradient(135deg, rgba(227, 242, 253, 0.9) 0%, rgba(255, 255, 255, 0.95) 50%, rgba(248, 249, 250, 0.9) 100%);
        padding: 25px 20px;
        border-radius: 20px;
        text-align: left;
        box-shadow: 0 8px 32px rgba(19, 197, 221, 0.15);
        margin: 0 auto;
        max-width: 95%;
    }

    .hospice-sponsors[aria-labelledby="hotel-contact-title"] h2 {
        font-size: 22px;
        margin-bottom: 20px;
        color: #000000;
        text-align: left;
    }

    .hospice-sponsors[aria-labelledby="hotel-contact-title"] p {
        font-size: 15px;
        line-height: 1.5;
        margin-bottom: 15px;
        color: #000000;
        text-align: left;
    }

    .hospice-sponsors[aria-labelledby="hotel-contact-title"] p strong {
        color: #2565eb;
        font-weight: 600;
    }

    /* Hide media elements for hotel contact section on mobile */
    .hospice-sponsors[aria-labelledby="hotel-contact-title"] .hospice-sponsors-media {
        display: none;
    }

    /* Mobile layout for about-features - place under text */
    .about-features {
        transform: translateY(0) !important;
        margin-top: 30px;
        order: 2;
    }

    .about-text {
        order: 1;
        padding: 0 20px;
    }

    .section-header {
        padding: 0 20px;
    }

    /* Mobile centers cards layout */
    .centers-cards {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 20px;
        border-radius: 0;
        box-shadow: none;
        background-color: transparent;
    }

    /* Mobile canteen photo gallery layout - one photo per row */
    .hospice-conditions-cards {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 20px;
    }

    .hospice-conditions-cards .hospice-condition-card {
        margin-bottom: 20px;
    }

    .centers-card {
        border-right: none;
        border-radius: 14px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .centers-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15);
    }

    /* Mobile expandable sections - simpler approach */
    .centers-details {
        display: none;
        margin-top: 16px;
        background: #ffffff;
        border-radius: 14px;
        box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
        overflow: hidden;
        opacity: 0;
        max-height: 0;
        transition: opacity 0.3s ease, max-height 0.3s ease;
    }

    /* Show sections when hovering over cards */
    .centers-cards:hover .centers-details--departments {
        display: block;
        opacity: 1;
        max-height: 400px;
    }

    /* Hide all details sections on mobile by default */
    @media (max-width: 600px) {
        .centers-details {
            display: none !important;
        }

        /* Show specific section on card hover */
        .centers-card[data-center="medical"]:hover ~ .centers-details--departments,
        .centers-card[data-center="center"]:hover ~ .centers-details--centers,
        .centers-card[data-center="social-menu"]:hover ~ .centers-details--social,
        .centers-card[data-center="social"]:hover ~ .centers-details--news {
            display: block !important;
            opacity: 1;
            max-height: 400px;
            margin-top: 16px;
        }
    }
}
