/* ============================================================
   ENGLISH OAK CARE HOMES — MOBILE RESPONSIVE OVERRIDES
   All rules use !important to override 895 inline styles
   ============================================================ */

/* ---- HAMBURGER BUTTON ---- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1100;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--navy-blue);
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Desktop/mobile enquire toggle */
.mobile-enquire { display: none !important; }
.desktop-enquire { display: inline-block !important; }

/* Overlay behind mobile menu */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(54, 63, 94, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}


/* ============================================================
   TABLET + MOBILE: <= 1024px — HAMBURGER + SLIDE-OUT MENU
   ============================================================ */
@media (max-width: 1024px) {
    .hamburger {
        display: flex !important;
    }

    .desktop-enquire {
        display: none !important;
    }

    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        right: -320px !important;
        width: 300px !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #F5F5F0 !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 100px 1.5rem 2rem !important;
        gap: 0 !important;
        z-index: 1050 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .nav-menu.open {
        right: 0 !important;
    }

    .nav-menu .nav-item,
    .nav-menu .nav-link {
        font-size: 1rem !important;
        padding: 0.85rem 0 !important;
        width: 100% !important;
        border-bottom: 1px solid rgba(54, 63, 94, 0.08);
        text-transform: none !important;
        letter-spacing: 0 !important;
        display: block !important;
    }

    .nav-menu .dropdown {
        width: 100% !important;
        display: block !important;
    }

    .nav-menu .dropdown-content {
        position: static !important;
        display: none !important;
        box-shadow: none !important;
        background: rgba(62, 35, 113, 0.04) !important;
        border-radius: 8px !important;
        margin: 0.25rem 0 0.5rem !important;
        padding: 0.5rem 0 !important;
        min-width: unset !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    .nav-menu .dropdown.mobile-open > .dropdown-content {
        display: block !important;
    }

    .nav-menu .dropdown-content a {
        padding: 0.6rem 1rem !important;
        font-size: 0.9rem !important;
        display: block !important;
    }

    .nav-menu .homes-dropdown {
        padding: 0.5rem !important;
        display: none !important;
        grid-template-columns: 1fr !important;
    }

    .nav-menu .dropdown.mobile-open .homes-dropdown {
        display: block !important;
    }

    .nav-menu .homes-dropdown .homes-dropdown-item {
        padding: 0.5rem !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
    }

    .nav-menu .homes-dropdown .dropdown-thumbnail {
        width: 45px !important;
        height: 32px !important;
        border-radius: 4px !important;
    }

    .mobile-enquire {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        margin-top: 1.5rem !important;
        padding: 1rem !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
    }

    body.menu-open {
        overflow: hidden !important;
    }

    /* Better touch targets */
    .nav-item,
    .back-btn,
    .slideshow-arrows {
        min-height: 44px;
    }

    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}


/* ============================================================
   MOBILE: <= 768px — FULL LAYOUT OVERRIDES
   ============================================================ */
@media (max-width: 768px) {

    /* ---- GLOBAL OVERFLOW FIX ---- */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    /* ---- NAV ---- */
    .kyn-nav {
        padding: 0.4rem 0 !important;
    }

    .nav-container {
        padding: 0 0.75rem !important;
    }

    .nav-logo img {
        height: 50px !important;
    }

    /* ---- HERO ---- */
    .kyn-hero {
        padding: 6.5rem 1.25rem 3rem !important;
        min-height: 65vh !important;
    }

    .hero-title {
        font-size: 2rem !important;
        margin-bottom: 1.25rem !important;
        line-height: 1.25 !important;
    }

    .elegant-text {
        font-size: 0.95rem !important;
        padding: 0 0.5rem !important;
        line-height: 1.65 !important;
    }

    .section-title {
        font-size: 1.6rem !important;
        margin-bottom: 1rem !important;
    }

    .watch-video {
        left: 1rem !important;
        bottom: 1rem !important;
        font-size: 0.8rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* ---- INITIAL ANIMATION ---- */
    .initial-animation-container {
        padding: 0 1.5rem !important;
    }

    .initial-logo {
        height: 140px !important;
        width: 140px !important;
        margin-bottom: 1.5rem !important;
    }

    .initial-title {
        font-size: 1.8rem !important;
    }

    .initial-subtitle {
        font-size: 0.95rem !important;
    }

    /* ---- SECTIONS ---- */
    .kyn-section {
        padding: 3rem 0.75rem !important;
    }

    /* ============================================================
       NUCLEAR GRID FIX — force ALL grids to single column
       ============================================================ */
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    [style*="grid-template-columns: repeat(auto-fit, minmax(300px"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    [style*="grid-template-columns: repeat(auto-fit, minmax(280px"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    [style*="grid-template-columns: repeat(auto-fit, minmax(250px"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    [style*="grid-template-columns: repeat(auto-fit, minmax(220px"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    [style*="grid-template-columns: repeat(auto-fit, minmax(200px"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    [style*="grid-template-columns: repeat(auto-fit, minmax(350px"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* ---- PADDING OVERRIDES ---- */
    [style*="padding: 3rem 2rem"] {
        padding: 1.5rem 1rem !important;
    }

    [style*="padding: 3rem;"],
    [style*="padding: 3rem "] {
        padding: 1.5rem 1rem !important;
    }

    [style*="padding: 2.5rem"] {
        padding: 1.25rem 1rem !important;
    }

    [style*="padding: 8rem 0"] {
        padding: 3rem 1rem !important;
    }

    [style*="padding: 0 2rem"] {
        padding: 0 1rem !important;
    }

    /* ---- MARGIN OVERRIDES ---- */
    [style*="margin: 4rem 0"] {
        margin: 2rem 0 !important;
    }

    [style*="margin: 5rem 0"] {
        margin: 2rem 0 !important;
    }

    [style*="margin-bottom: 4rem"] {
        margin-bottom: 2rem !important;
    }

    [style*="margin-bottom: 3rem"] {
        margin-bottom: 1.5rem !important;
    }

    /* ---- MAX-WIDTH CONTAINERS ---- */
    [style*="max-width: 1200px"],
    [style*="max-width: 1400px"],
    [style*="max-width: 900px"],
    [style*="max-width: 800px"] {
        max-width: 100% !important;
    }

    /* ---- FONT SIZE OVERRIDES ---- */
    [style*="font-size: 3rem"] {
        font-size: 1.75rem !important;
    }

    [style*="font-size: 2.8rem"] {
        font-size: 1.6rem !important;
    }

    [style*="font-size: 2.5rem"] {
        font-size: 1.5rem !important;
    }

    [style*="font-size: 2.2rem"] {
        font-size: 1.35rem !important;
    }

    [style*="font-size: 2rem"] {
        font-size: 1.25rem !important;
    }

    [style*="font-size: 1.4rem"] {
        font-size: 1.15rem !important;
    }

    /* ---- ICON/BADGE SIZES ---- */
    [style*="width: 80px"][style*="height: 80px"] {
        width: 56px !important;
        height: 56px !important;
    }

    /* ---- BORDER RADIUS ---- */
    [style*="border-radius: 25px"] {
        border-radius: 14px !important;
    }

    [style*="border-radius: 20px"] {
        border-radius: 12px !important;
    }

    /* ---- GAP OVERRIDES ---- */
    [style*="gap: 4rem"] {
        gap: 1.5rem !important;
    }

    [style*="gap: 3rem"] {
        gap: 1.5rem !important;
    }

    /* ---- FLEX WRAPPING ---- */
    [style*="display: flex"][style*="gap: 2rem"] {
        flex-wrap: wrap !important;
    }

    [style*="display: flex"][style*="gap: 1.5rem"] {
        flex-wrap: wrap !important;
    }

    /* ---- CARE HOME DETAIL PAGES ---- */
    .care-home-detail {
        padding: 0 !important;
    }

    .care-home-detail > div[style*="padding: 0 2rem"] {
        padding: 0 0.75rem !important;
    }

    .care-home-header {
        flex-direction: column !important;
        text-align: center !important;
        gap: 1rem !important;
        padding: 0 !important;
    }

    .care-home-text {
        text-align: center !important;
    }

    .care-home-title {
        font-size: 1.8rem !important;
    }

    .care-home-location {
        font-size: 0.95rem !important;
    }

    .care-home-page-image {
        width: 100% !important;
        height: auto !important;
        max-height: 200px !important;
        border-radius: 8px !important;
    }

    .care-home-image-container {
        width: 100% !important;
    }

    /* ---- SLIDESHOW ---- */
    .slideshow-container {
        margin: 0 auto 1.5rem !important;
    }

    .slideshow-wrapper,
    .slideshow-wrapper[style*="height"] {
        height: 220px !important;
    }

    .slide-dot {
        width: 8px !important;
        height: 8px !important;
    }

    .slideshow-nav {
        gap: 3px !important;
        bottom: 0.4rem !important;
    }

    .slideshow-arrows {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.85rem !important;
    }

    .prev-arrow { left: 0.4rem !important; }
    .next-arrow { right: 0.4rem !important; }

    /* ---- MANAGER PROFILE ---- */
    .manager-profile {
        flex-direction: column !important;
        text-align: center !important;
        gap: 1rem !important;
        padding: 1.25rem !important;
    }

    .manager-image {
        width: 80px !important;
        height: 80px !important;
        margin: 0 auto !important;
    }

    .manager-name {
        font-size: 1.15rem !important;
    }

    .manager-content p,
    .manager-content {
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
    }

    .manager-photo-section {
        align-self: center !important;
        margin-bottom: 0.5rem !important;
    }

    .manager-photo-name {
        font-size: 0.9rem !important;
    }

    /* ---- DETAIL SECTIONS ---- */
    .detail-section {
        padding: 1.25rem 0 !important;
    }

    .detail-section h3 {
        font-size: 1.2rem !important;
    }

    .detail-section p,
    .detail-section li {
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
    }

    .detail-section ul {
        padding-left: 1.25rem !important;
    }

    /* ---- CONTACT ---- */
    .contact-info {
        padding: 1.25rem !important;
    }

    .contact-info h3 {
        font-size: 1.2rem !important;
    }

    /* ---- MAPS ---- */
    .maps-section {
        padding: 0 0.75rem !important;
        margin: 2rem 0 !important;
    }

    .maps-widget {
        height: 220px !important;
    }

    .maps-container {
        padding: 1rem !important;
    }

    .maps-title {
        font-size: 1.3rem !important;
    }

    /* ---- TESTIMONIALS ---- */
    .testimonial-card {
        padding: 1.25rem !important;
    }

    .testimonial-text {
        font-size: 0.88rem !important;
        line-height: 1.6 !important;
    }

    .testimonial-author {
        font-size: 0.85rem !important;
    }

    .testimonial-date {
        font-size: 0.8rem !important;
    }

    .testimonials-nav-buttons {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .testimonials-nav-buttons a {
        width: 100% !important;
        text-align: center !important;
    }

    /* ---- ROOM TYPES ---- */
    .room-slideshow {
        height: 160px !important;
    }

    /* ---- BUTTONS ---- */
    .enquire-btn {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.85rem !important;
    }

    button[style*="padding: 1rem 2rem"],
    a[style*="padding: 1rem 2rem"] {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.9rem !important;
    }

    .back-btn {
        font-size: 0.85rem !important;
        padding: 0.5rem 0 !important;
        margin-bottom: 0.5rem !important;
    }

    .care-type-card {
        padding: 1.25rem !important;
    }

    /* ---- VIDEO MODAL ---- */
    #video-modal [style*="width: 90vw"],
    #video-modal [style*="max-width"] {
        width: 96vw !important;
        max-width: 96vw !important;
    }

    /* ---- FULLSCREEN IMAGE ---- */
    .fullscreen-overlay img {
        max-width: 95vw !important;
        max-height: 80vh !important;
    }

    /* ---- HOME CARDS ---- */
    .home-image {
        width: 100% !important;
        max-width: 260px !important;
        max-height: none !important;
        height: auto !important;
    }

    .about-home-image {
        width: 100% !important;
        max-width: 200px !important;
        max-height: none !important;
        height: auto !important;
    }

    /* ---- CARE HOME VIDEO BTN ---- */
    .care-home-video-btn {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.85rem !important;
    }

    .view-home-btn {
        font-size: 0.85rem !important;
        padding: 0.75rem 1.25rem !important;
    }

    /* ---- SECTION SLIDESHOW (about) ---- */
    .section-slideshow-container {
        height: 250px !important;
    }

    .slideshow-overlay h3 {
        font-size: 1.2rem !important;
    }

    .slideshow-overlay p {
        font-size: 0.85rem !important;
    }
}


/* ============================================================
   SMALL PHONE: <= 480px
   ============================================================ */
@media (max-width: 480px) {

    .nav-menu {
        width: 100% !important;
        right: -100% !important;
    }

    .nav-menu.open {
        right: 0 !important;
    }

    .hero-title {
        font-size: 1.65rem !important;
    }

    .section-title {
        font-size: 1.35rem !important;
    }

    .elegant-text {
        font-size: 0.88rem !important;
    }

    .kyn-hero {
        padding: 5.5rem 1rem 2.5rem !important;
        min-height: 55vh !important;
    }

    .slideshow-wrapper,
    .slideshow-wrapper[style*="height"] {
        height: 170px !important;
    }

    .care-home-title {
        font-size: 1.5rem !important;
    }

    .detail-section h3 {
        font-size: 1.1rem !important;
    }

    .manager-profile {
        padding: 1rem !important;
    }

    .maps-widget {
        height: 180px !important;
    }

    .room-slideshow {
        height: 140px !important;
    }

    [style*="font-size: 3rem"],
    [style*="font-size: 2.8rem"] {
        font-size: 1.5rem !important;
    }

    [style*="width: 80px"][style*="height: 80px"] {
        width: 48px !important;
        height: 48px !important;
    }
}


/* ============================================================
   LANDSCAPE PHONE
   ============================================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .kyn-hero {
        min-height: auto !important;
        padding: 5.5rem 1.5rem 2rem !important;
    }

    .slideshow-wrapper,
    .slideshow-wrapper[style*="height"] {
        height: 240px !important;
    }
}


/* ============================================================
   NOTCH / SAFE-AREA SUPPORT
   ============================================================ */
@supports (padding-top: env(safe-area-inset-top)) {
    .kyn-nav {
        padding-top: max(0.4rem, env(safe-area-inset-top)) !important;
    }
}
