/* ===== SWADVIR - MOBILE NAVIGATION ===== */
/* Mobile-First Design with Native App Experience */

/* ===== MOBILE APPBAR ===== */
.mobile-appbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
}

.mobile-appbar .appbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-appbar .appbar-logo img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-appbar .appbar-logo span {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.mobile-appbar .appbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-appbar .appbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mobile-appbar .appbar-btn:hover,
.mobile-appbar .appbar-btn:active {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .mobile-appbar .appbar-btn:hover,
[data-theme="dark"] .mobile-appbar .appbar-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-appbar .cart-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: #e53935;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ===== BOTTOM NAVIGATION BAR ===== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--card-bg);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.2s ease;
    position: relative;
    padding: 8px 0;
}

.bottom-nav-item i {
    font-size: 1.4rem;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

.bottom-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.bottom-nav-item.active {
    color: #a0522d;
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 40px;
    height: 3px;
    background: #a0522d;
    border-radius: 0 0 3px 3px;
    transition: transform 0.2s ease;
}

.bottom-nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

.bottom-nav-item .nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    min-width: 18px;
    height: 18px;
    background: #e53935;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Ripple effect for touch */
.bottom-nav-item:active {
    background: rgba(160, 82, 45, 0.1);
}

/* ===== MOBILE MENU DRAWER ===== */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: var(--card-bg);
    z-index: 1002;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.mobile-drawer.active {
    right: 0;
}

.mobile-drawer-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-drawer-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-drawer-header .user-info h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

.mobile-drawer-header .user-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.mobile-drawer-nav {
    padding: 12px 0;
}

.mobile-drawer-nav a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.mobile-drawer-nav a:hover,
.mobile-drawer-nav a:active {
    background: rgba(160, 82, 45, 0.1);
}

.mobile-drawer-nav a i {
    width: 24px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.mobile-drawer-nav a.active {
    background: rgba(160, 82, 45, 0.15);
    color: #a0522d;
}

.mobile-drawer-nav a.active i {
    color: #a0522d;
}

.mobile-drawer-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {

    /* Show mobile components */
    .mobile-appbar {
        display: flex;
    }

    .bottom-nav {
        display: block;
    }

    .mobile-drawer-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-drawer-overlay.active {
        pointer-events: auto;
    }

    /* Hide desktop navbar */
    .navbar:not(.mobile-appbar) {
        display: none !important;
    }

    /* Add top spacing for mobile appbar */
    body {
        padding-top: 56px;
        padding-bottom: 64px;
    }

    /* Adjust for pages with no bottom nav spacing needed */
    .no-bottom-nav body {
        padding-bottom: 0;
    }
}

/* ===== TABLET AND UP - HIDE MOBILE NAV ===== */
@media (min-width: 769px) {

    .mobile-appbar,
    .bottom-nav,
    .mobile-drawer,
    .mobile-drawer-overlay {
        display: none !important;
    }

    body {
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* ===== TOUCH-FRIENDLY COMPONENTS ===== */
@media (max-width: 768px) {

    /* Larger touch targets */
    .btn {
        min-height: 48px;
        padding: 12px 24px;
        font-size: 1rem;
    }

    /* Full-width buttons on mobile */
    .btn-mobile-full {
        width: 100%;
        display: block;
    }

    /* Touch-friendly form inputs */
    .form-control,
    .form-select {
        min-height: 48px;
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 12px 16px;
    }

    /* Mobile cards - full width */
    .mobile-card {
        border-radius: 0;
        margin-left: -15px;
        margin-right: -15px;
        box-shadow: none;
        border-bottom: 1px solid var(--border-color);
    }

    /* Product cards for mobile */
    .product-card-mobile {
        display: flex;
        flex-direction: row;
        background: var(--card-bg);
        border-radius: 12px;
        overflow: hidden;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .product-card-mobile .card-img {
        width: 120px;
        height: 120px;
        flex-shrink: 0;
    }

    .product-card-mobile .card-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .product-card-mobile .card-body {
        padding: 12px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        flex: 1;
    }

    .product-card-mobile .card-title {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .product-card-mobile .card-price {
        font-size: 1.1rem;
        color: #a0522d;
        font-weight: 600;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slideUp 0.3s ease forwards;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}