/* Mobile UI for Egurukul Listing */
:root {
    --el-primary: #ea580c; /* Orange */
    --el-primary-dark: #c2410c;
    --el-bg: #f8fafc;
    --el-text: #0f172a;
    --el-text-light: #64748b;
    --el-white: #ffffff;
    --el-border: #e2e8f0;
    
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --font-heading: 'Noto Sans Devanagari', 'Hind', sans-serif;
    --font-body: 'Noto Sans Devanagari', 'Hind', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --el-bg: #0f172a;
        --el-text: #f8fafc;
        --el-text-light: #94a3b8;
        --el-white: #1e293b;
        --el-border: #334155;
    }
}

/* Base Mobile Overrides */
@media (max-width: 768px) {
    body {
        background-color: var(--el-bg);
        font-family: var(--font-body);
        color: var(--el-text);
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 20px)) !important; /* Space for Bottom Nav */
    }

    /* Hide desktop elements if needed */
    .site-footer, .header-navbar.el-sticky-header {
        display: none !important; /* Will replace with custom mobile header/footer */
    }
    
    /* Accessibility: Reduced Motion */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation: none !important;
            transition: none !important;
        }
    }

    /* Hide desktop elements on mobile */
    .el-desktop-only {
        display: none !important;
    }

    /* Bottom Navigation Bar */
    .el-mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background-color: var(--el-white);
        display: flex;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        z-index: 99999;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: content-box;
        border-top-left-radius: var(--radius-lg);
        border-top-right-radius: var(--radius-lg);
    }
    
    .el-mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--el-text-light);
        flex: 1;
        height: 100%;
        transition: color 0.2s ease;
    }
    
    .el-mobile-nav-item i {
        font-size: 24px;
        margin-bottom: 4px;
        transition: transform 0.2s ease;
    }
    
    .el-mobile-nav-item span {
        font-size: 11px;
        font-weight: 600;
    }
    
    .el-mobile-nav-item.is-active,
    .el-mobile-nav-item:active {
        color: var(--el-primary);
    }
    
    .el-mobile-nav-item.is-active i {
        transform: scale(1.1);
    }
    
    /* Floating Action Button (FAB) */
    .el-mobile-fab {
        position: relative;
        top: -15px;
    }
    
    .el-fab-circle {
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, var(--el-primary), var(--el-primary-dark));
        border-radius: var(--radius-full);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 16px rgba(234, 88, 12, 0.3);
        margin-bottom: 4px;
        border: 4px solid var(--el-bg);
        transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    
    .el-fab-circle i {
        color: white;
        font-size: 28px;
        margin-bottom: 0;
    }
    
    .el-mobile-fab:active .el-fab-circle {
        transform: scale(0.9);
        box-shadow: 0 4px 8px rgba(234, 88, 12, 0.4);
    }
    /* Mobile Hero Section */
    .el-mobile-hero {
        position: relative;
        width: 100%;
        height: 320px;
        background-color: var(--el-bg);
        border-bottom-left-radius: var(--radius-lg);
        border-bottom-right-radius: var(--radius-lg);
        overflow: hidden;
    }
    
    .el-mobile-hero-bg {
        width: 100%;
        height: 100%;
        object-fit: cover;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
    }
    
    .el-mobile-hero::after {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background: linear-gradient(to bottom, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.7) 100%);
        z-index: 2;
    }
    
    .el-mobile-hero-content {
        position: absolute;
        bottom: 40px; /* Leave space for search */
        left: 0;
        width: 100%;
        padding: var(--space-4);
        z-index: 3;
        color: var(--el-white);
        text-align: center;
    }
    
    .el-mobile-hero-title {
        font-size: 22px;
        font-weight: 800;
        margin-bottom: var(--space-1);
        text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    }
    
    .el-mobile-hero-subtitle {
        font-size: 14px;
        font-weight: 500;
        opacity: 0.9;
        margin-bottom: var(--space-3);
    }
    
    .el-mobile-hero-graphic {
        margin-top: var(--space-2);
        display: inline-block;
    }

    /* Floating Search */
    .el-mobile-search-wrapper {
        padding: 0 var(--space-4);
        position: relative;
        margin-top: -24px;
        z-index: 10;
    }
    
    .el-mobile-search {
        background: var(--el-white);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
        display: flex;
        overflow: hidden;
        height: 48px;
    }
    
    .el-mobile-search form {
        display: flex;
        width: 100%;
        height: 100%;
    }
    
    .el-mobile-search input {
        flex: 1;
        border: none;
        padding: 0 var(--space-3);
        font-size: 14px;
        outline: none;
        background: transparent;
        color: var(--el-text);
    }
    
    .el-mobile-search-btn {
        background: var(--el-primary);
        color: var(--el-white);
        border: none;
        width: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    /* Sections */
    .el-mobile-section {
        padding: var(--space-5) var(--space-4);
    }
    
    .el-mobile-section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: var(--space-4);
    }
    
    .el-mobile-section-header h2 {
        font-size: 18px;
        font-weight: 700;
        margin: 0;
        color: var(--el-text);
    }
    
    .el-mobile-view-all {
        font-size: 13px;
        font-weight: 600;
        color: var(--el-primary);
        text-decoration: none;
    }

    /* Categories Grid */
    .el-mobile-categories-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: var(--space-3);
    }
    
    .el-mobile-cat-card {
        background: var(--el-white);
        border-radius: var(--radius-md);
        padding: var(--space-3) var(--space-1);
        text-align: center;
        text-decoration: none;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--el-border);
        display: flex;
        flex-direction: column;
        align-items: center;
        transition: transform 0.2s ease;
    }
    
    .el-mobile-cat-card:active {
        transform: scale(0.95);
    }
    
    .el-mobile-cat-icon {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-md);
        margin-bottom: var(--space-2);
    }
    
    .el-mobile-cat-icon i {
        font-size: 28px;
    }
    
    .el-mobile-cat-name {
        font-size: 12px;
        font-weight: 600;
        color: var(--el-text);
        line-height: 1.2;
    }

    /* Listings Carousel */
    .el-mobile-listings-carousel {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: var(--space-4);
        padding-bottom: var(--space-2);
        scrollbar-width: none; /* Firefox */
    }
    
    .el-mobile-listings-carousel::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .el-mobile-listing-card {
        flex: 0 0 240px;
        scroll-snap-align: center;
        background: var(--el-white);
        border-radius: var(--radius-md);
        overflow: hidden;
        text-decoration: none;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--el-border);
        display: flex;
        flex-direction: column;
    }
    
    .el-mobile-listing-img-wrapper {
        position: relative;
        width: 100%;
        height: 140px;
    }
    
    .el-mobile-listing-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .el-mobile-listing-badge {
        position: absolute;
        bottom: var(--space-2);
        left: var(--space-2);
        background: rgba(22, 163, 74, 0.9);
        color: white;
        padding: 2px 8px;
        border-radius: var(--radius-sm);
        font-size: 11px;
        font-weight: 700;
        backdrop-filter: blur(4px);
    }
    
    .el-mobile-listing-content {
        padding: var(--space-3);
    }
    
    .el-mobile-listing-title {
        font-size: 15px;
        font-weight: 700;
        color: var(--el-text);
        margin: 0 0 4px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .el-mobile-listing-meta {
        font-size: 12px;
        color: var(--el-text-light);
        margin: 0 0 8px 0;
    }
    
    .el-mobile-listing-dist {
        font-size: 11px;
        color: var(--el-text-light);
        margin: 0;
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    .el-mobile-listing-dist i {
        font-size: 12px;
        width: 12px;
        height: 12px;
    }

    /* Promo Banner */
    .el-mobile-promo {
        margin: var(--space-2) var(--space-4) var(--space-5) var(--space-4);
        background: linear-gradient(135deg, #f0fdf4, #dcfce7);
        border-radius: var(--radius-lg);
        padding: var(--space-4);
        display: flex;
        align-items: center;
        gap: var(--space-4);
        box-shadow: var(--shadow-sm);
        border: 1px solid #bbf7d0;
    }
    
    .el-mobile-promo-img {
        flex: 0 0 80px;
    }
    
    .el-mobile-promo-text h3 {
        font-size: 16px;
        font-weight: 800;
        color: #166534;
        margin: 0 0 4px 0;
    }
    
    .el-mobile-promo-text p {
        font-size: 12px;
        color: #15803d;
        margin: 0 0 var(--space-3) 0;
    }
    
    .el-mobile-promo-btn {
        background: var(--el-primary);
        color: var(--el-white);
        padding: 6px 16px;
        border-radius: var(--radius-full);
        font-size: 12px;
        font-weight: 600;
        text-decoration: none;
        display: inline-block;
    }

    /* Quick Actions */
    .el-mobile-quick-actions {
        display: flex;
        gap: var(--space-3);
        padding: 0 var(--space-4) var(--space-5) var(--space-4);
        overflow-x: auto;
        scrollbar-width: none;
    }
    
    .el-mobile-qa-btn {
        flex: 0 0 auto;
        background: var(--el-white);
        border: 1px solid var(--el-border);
        border-radius: var(--radius-full);
        padding: 8px 16px;
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        color: var(--el-text);
        font-size: 13px;
        font-weight: 600;
        box-shadow: var(--shadow-sm);
    }
    
    .el-mobile-qa-btn i {
        color: var(--el-text-light);
    }
}

/* Hide Mobile UI on Desktop */
@media (min-width: 769px) {
    .el-mobile-only {
        display: none !important;
    }
}
