/* =============================================================================
   Maa Shatrupa Gau Sadan Shansher - Dedicated Mobile Stylesheet
   File: css/mobile.css
   Active for Viewports <= 1024px and <= 768px | Zero CSS Conflicts
============================================================================= */

@media (max-width: 1024px) {
    /* Hide desktop nav links, reveal mobile hamburger */
    .desktop-nav-links {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        width: 38px;
        height: 38px;
        background: transparent;
        border: 1px solid var(--border-light, #e7e5e4);
        border-radius: 8px;
        padding: 7px;
        cursor: pointer;
        z-index: 1002;
    }

    .mobile-menu-toggle span {
        width: 100%;
        height: 2.5px;
        background-color: var(--primary-dark, #78350f);
        border-radius: 4px;
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Grids on Tablet */
    .grid-5 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
    .grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
    .grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

/* -----------------------------------------------------------------------------
   Mobile Drawer Navigation & Backdrop Overlay (Pure Viewport Specific)
----------------------------------------------------------------------------- */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

.mobile-drawer.active {
    right: 0;
}

.mobile-drawer-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f3f4f6;
    background: #fffdf5;
}

.mobile-drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-drawer-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.mobile-drawer-brand span {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark, #78350f);
    line-height: 1.2;
}

.mobile-drawer-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: #4b5563;
    cursor: pointer;
    padding: 4px 8px;
}

.mobile-drawer-nav {
    padding: 12px 0;
    flex: 1;
}

.mobile-drawer-link {
    display: block;
    padding: 13px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 1px solid #f9fafb;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.mobile-drawer-link:hover, .mobile-drawer-link:active {
    background: #fffbeb;
    color: var(--primary-saffron, #b45309);
}

.mobile-accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 13px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    background: none;
    border: none;
    border-bottom: 1px solid #f9fafb;
    text-align: left;
    cursor: pointer;
}

.mobile-accordion-icon {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-saffron, #b45309);
    transition: transform 0.2s ease;
}

.mobile-accordion-content {
    display: none;
    background: #fafaf9;
    padding: 4px 0 8px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.mobile-accordion-content.open {
    display: block;
}

.mobile-accordion-sublink {
    display: block;
    padding: 10px 18px;
    font-size: 0.88rem;
    color: #4b5563;
    font-weight: 500;
    text-decoration: none;
}

.mobile-accordion-sublink:hover {
    color: var(--primary-saffron, #b45309);
}

.mobile-drawer-footer {
    padding: 16px 20px;
    background: #fdfbf7;
    border-top: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-drawer-footer .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    min-height: 46px;
    font-size: 0.92rem;
}

/* -----------------------------------------------------------------------------
   Strict Mobile Viewports (<= 768px)
----------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Prevent any horizontal screen blowout */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    .container {
        padding: 0 16px !important;
    }

    .section-padding {
        padding: 42px 0 !important;
    }

    /* Single Column Layouts on Mobile */
    .grid-2,
    .grid-3,
    .grid-4,
    .grid-5 {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    /* Top Sacred Bar Mobile Polish */
    .top-sacred-bar {
        padding: 6px 0 !important;
        font-size: 0.78rem !important;
    }

    .top-sacred-bar .container {
        flex-direction: column !important;
        gap: 4px !important;
        text-align: center !important;
    }

    .top-bar-emergency-wrap {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .top-bar-marquee-wrap {
        width: 100% !important;
        padding-top: 2px !important;
    }

    /* Primary Header Mobile Adjustments */
    .site-header {
        padding: 10px 0 !important;
    }

    .brand-logo-icon {
        width: 40px !important;
        height: 40px !important;
    }

    .brand-titles h1 {
        font-size: 1.05rem !important;
        letter-spacing: 0 !important;
    }

    .brand-titles p {
        font-size: 0.68rem !important;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Hero Section Mobile */
    .hero-h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    .hero-buttons-wrap {
        flex-direction: column !important;
        width: 100% !important;
    }

    .hero-buttons-wrap .btn {
        width: 100% !important;
    }

    /* Glass Cards & Image Bleed Prevention */
    .glass-card {
        padding: 18px !important;
        border-radius: 14px !important;
    }

    .card-media-wrapper {
        aspect-ratio: 16/9 !important;
        height: auto !important;
        margin: -18px -18px 14px -18px !important;
        width: calc(100% + 36px) !important;
        border-radius: 14px 14px 0 0 !important;
        overflow: hidden !important;
    }

    .card-media-wrapper img,
    .card-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }

    /* Amount Chips on Mobile: 2 Columns */
    .amount-chips {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .chip-btn {
        min-height: 44px !important;
        font-size: 0.95rem !important;
    }

    /* Filter buttons on Campaigns Page: Horizontal Scroll or Wrap */
    .filter-buttons-container {
        display: flex !important;
        overflow-x: auto !important;
        padding-bottom: 8px !important;
        gap: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .filter-btn {
        white-space: nowrap !important;
        font-size: 0.8rem !important;
        padding: 8px 14px !important;
        flex-shrink: 0 !important;
    }

    /* Modal Mobile Adjustments */
    .modal-dialog {
        max-width: 95vw !important;
        margin: 10px auto !important;
        border-radius: 14px !important;
    }

    .modal-body {
        padding: 16px !important;
    }

    /* Sticky Bottom Mobile Seva Bar */
    .mobile-sticky-action-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
        padding: 10px 16px;
        display: flex !important;
        gap: 10px;
        z-index: 1000;
        border-top: 1px solid var(--border-light, #e7e5e4);
    }

    .mobile-sticky-action-bar .btn {
        flex: 1;
        min-height: 44px;
        font-size: 0.85rem;
        padding: 8px 10px;
    }

    /* Padding to prevent sticky bar from covering footer content */
    body {
        padding-bottom: 64px !important;
    }
}
