/**
 * BEAWOP Theme - Custom CSS Fixes
 * Fix scroll issue and navbar transparent
 */

html {
    overflow-x: hidden;
    overflow-y: auto !important;
    height: auto !important;
}

body {
    overflow-x: hidden;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
}

#main.site-main {
    overflow: visible !important;
}

/* Fix navbar transparent style - matches React CSS exactly */
.menu.menu__scroll.global__transparent {
    background: transparent !important;
    background-color: transparent !important;
}

.menu.menu__scroll.position-fixed {
    background: #fff !important;
    background-color: #fff !important;
    box-shadow: 0 3px 12px 0 rgba(0, 0, 0, 0.1);
}

/* Ensure global__transparent works on all screen sizes (React has it only in media query, but we need it always) */
.menu.global__transparent {
    background: transparent !important;
    background-color: transparent !important;
}

/* Ensure menu is always above the overlay */
.menu {
    position: relative;
    z-index: 99999 !important;
}

/* Fix cases section container and slider issues */
.cases {
    overflow-x: hidden;
}

.cases .slick-slider {
    padding: 0 2px;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 0 !important;
}

.cases .slick-list {
    grid-column: 1/3;
    overflow: visible !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.cases .slick-track {
    display: flex !important;
    align-items: stretch;
    margin-bottom: 0 !important;
}

.cases .slick-slide {
    height: auto;
    margin-bottom: 0 !important;
}

.cases .slick-slide>div {
    height: 100%;
}

.cases__slider {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Remove bottom border/line from cases cards */
.cases__card {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

.cases .slick-dots {
    margin: 30px 0 0 0;
    padding-bottom: 0;
    position: relative;
}

/* Fix container width for cases section */
.cases .container {
    max-width: 1280px;
}

@media screen and (min-width: 1400px) {
    .cases .container {
        max-width: 1280px !important;
    }
}

/* Fix mobile testimonials */
@media screen and (max-width: 767px) {
    .testimonial__body-slider .slick-slide {
        width: 100%;
        margin: 0 10px;
        max-width: 100%;
    }

    .testimonial__body-slider .slick-list {
        margin: 0 -10px;
    }

    .testimonial__card-img img,
    .testimonial__card img.img-fluid {
        width: 50px !important;
        height: 50px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        flex-shrink: 0;
    }

    /* Ensure dots are visible and centered */
    .testimonial .slick-dots {
        display: flex !important;
        justify-content: center;
        margin-top: 20px;
        position: relative;
        /* Make relative to flow naturally below cards */
        bottom: auto;
        padding: 0;
    }

    .footer__social {
        margin-top: 30px !important;
    }

    .testimonial .slick-dots li button:before {
        font-size: 12px;
        /* Make dots slightly larger on mobile */
    }
}

/* Hamburger Menu Redesign */
@media (max-width: 991px) {

    /* Dedicated Overlay Element */
    .menu-overlay {
        position: fixed;
        inset: 0;
        /* Top, right, bottom, left: 0 */
        background-color: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        z-index: 99998;
        /* Strictly lower than menu */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
        /* Pass through when hidden */
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        /* Capture clicks when visible */
    }

    /* Menu Panel */
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        /* Full viewport height */
        background-color: #ffffff;
        z-index: 99999;
        /* Strictly higher than overlay */
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 0;
        display: flex !important;
        flex-direction: column;
        /* Flex column layout */
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
        border-radius: 0 !important;
        /* Straight edges */
        visibility: hidden;
        overflow-x: hidden;
        /* No horizontal scroll */
        overflow-y: hidden;
        /* Inner scroll handled by children */
    }

    .navbar-collapse.show,
    .navbar-collapse.collapsing {
        right: 0;
        visibility: visible;
        display: flex !important;
    }

    .navbar-collapse.collapsing {
        height: 100vh !important;
        position: fixed;
        top: 0;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Menu Header (Logo + Close Button) */
    .menu-header {
        flex: 0 0 auto;
        /* Don't shrink */
        padding: 20px;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        border-bottom: 1px solid #f5f5f5;
    }

    /* Close Button */
    .menu-close-btn {
        background: none;
        border: none;
        color: #333;
        font-size: 24px;
        cursor: pointer;
        padding: 8px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background-color 0.2s, transform 0.2s;
    }

    .menu-close-btn:hover,
    .menu-close-btn:focus {
        background-color: #f0f0f0;
        transform: rotate(90deg);
        color: #000;
        outline: none;
    }

    /* Menu List (Scrollable Area) */
    .navbar-nav {
        flex: 1 1 auto;
        /* Grow and shrink */
        overflow-y: auto;
        overflow-x: hidden;
        /* No horizontal scroll */
        /* Scrollable if content overflows */
        padding: 20px 0;
        width: 100%;
        margin: 0 !important;
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll on iOS */
    }

    .nav-item {
        width: 100%;
        margin-bottom: 5px;
    }

    .nav-link {
        padding: 14px 24px !important;
        display: block;
        width: 100%;
        text-align: left;
        color: #333 !important;
        font-size: 18px;
        font-weight: 500;
        transition: all 0.2s ease;
        border-left: 4px solid transparent;
    }

    .nav-link:hover,
    .nav-link:focus {
        color: #0d6efd !important;
        background-color: #f8f9fa;
        border-left-color: #0d6efd;
        padding-left: 28px !important;
        outline: none;
    }

    .nav-link.menu__list-link--active {
        color: #0d6efd !important;
        font-weight: 700;
        background-color: #eef5ff;
        border-left-color: #0d6efd;
    }

    /* Buttons Wrapper (Pinned to Bottom) */
    .menu__buttons-wrapper {
        flex: 0 0 auto;
        /* Don't shrink */
        padding: 20px;
        padding-top: 24px;
        /* More breathing room on top */
        padding-bottom: max(40px, env(safe-area-inset-bottom));
        /* Lifted up from bottom */
        /* Safe area for iPhone X+ */
        border-top: 1px solid #f5f5f5;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        gap: 12px !important;
        background-color: #fff;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.03);
        /* Subtle shadow to separate from list */
    }

    /* Primary Button */
    .menu__btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 0 !important;
        text-align: center;
        padding: 14px 20px !important;
        height: auto !important;
        min-height: 50px;
        display: flex !important;
        align-items: center;
        border-radius: 8px;
        background-color: #0d6efd;
        color: #fff !important;
        font-weight: 600;
        border: none;
        box-shadow: 0 4px 6px rgba(13, 110, 253, 0.2);
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .menu__btn:hover,
    .menu__btn:focus {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(13, 110, 253, 0.3);
        color: #fff !important;
    }

    /* Secondary Button */
    .menu__link-funds {
        width: 100%;
        justify-content: center;
        margin-bottom: 0 !important;
        text-align: center;
        padding: 14px 20px !important;
        height: auto !important;
        min-height: 50px;
        display: flex !important;
        align-items: center;
        border-radius: 8px;
        background-color: transparent;
        border: 2px solid #09a2ff;
        color: #09a2ff !important;
        text-decoration: none !important;
        font-weight: 600;
        transition: all 0.2s;
    }

    .menu__link-funds:hover,
    .menu__link-funds:focus {
        background-color: #09a2ff;
        color: #fff !important;
    }

    /* Utility for simple scroll locking */
    html.noscroll,
    body.noscroll {
        overflow: hidden !important;
    }

    /* Body Scroll Lock - Handled by .noscroll class now */
    /* body.menu-open rule removed as it was empty */

    /* 
     * CRITICAL FIX: Lock menu to viewport when open.
     * 1. transform: none !important -> Prevents creating a new stacking context/containing block.
     *    This ensures fixed children (like the panel) are fixed to the VIEWPORT, not the navbar.
     * 2. position: fixed !important -> Anchors the navbar to the screen.
     * 3. top: 0 !important -> Ensures it's always at the top, regardless of scroll.
     */
    body.menu-open .menu {
        transform: none !important;
        position: fixed !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 99999 !important;
    }
}/* Modern Coat Donation Modal */
.coat-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.coat-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.coat-modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 580px;
    border-radius: 24px;
    padding: 40px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.coat-modal-backdrop.active .coat-modal-content {
    transform: scale(1);
}

.coat-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.coat-modal-close:hover {
    background: #e5e7eb;
    color: #111827;
    transform: rotate(90deg);
}

.coat-modal-title {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 32px;
    text-align: center;
    letter-spacing: -0.02em;
}

.coat-modal-section {
    margin-bottom: 32px;
}

.coat-modal-section:last-child {
    margin-bottom: 0;
}

.coat-modal-subtitle {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    font-weight: 700;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

.coat-modal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .coat-modal-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.coat-modal-location {
    background: #f9fafb;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #f3f4f6;
    transition: border-color 0.2s ease;
}

.coat-modal-location:hover {
    border-color: #d1d5db;
}

.coat-modal-name {
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
    font-size: 16px;
}

.coat-modal-address {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
    margin: 0;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .coat-modal-content {
        padding: 24px;
        border-radius: 20px;
    }

    .coat-modal-title {
        font-size: 24px;
        margin-bottom: 24px;
    }
}