/* Mobile Header - Beautiful Sidebar Design */

/* Mobile Sidebar Overlay */
.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

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

/* Mobile Sidebar Container */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-sidebar.active {
    transform: translateX(0);
}

/* Sidebar Header */
.mobile-sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
    flex-shrink: 0;
}

.mobile-sidebar-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.mobile-sidebar-close {
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mobile-sidebar-close:hover {
    background: #e5e7eb;
    color: #374151;
    transform: scale(1.05);
}

/* Sidebar Navigation */
.mobile-sidebar-nav {
    padding: 16px 0;
    flex-shrink: 0;
}

.mobile-sidebar-nav-item {
    display: block;
    padding: 18px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    transition: transform 0.1s ease, background-color 0.1s ease;
}

.mobile-sidebar-nav-item:active {
    transform: scale(0.98);
    background: #f3f4f6;
}

/* Cart Preview Section */
.mobile-sidebar-cart {
    flex: 1;
    padding: 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.mobile-sidebar-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.mobile-sidebar-cart-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.mobile-sidebar-cart-count {
    background: #007aff;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cart Items in Sidebar */
.mobile-sidebar-cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 16px;
    min-height: 0;
}

.mobile-sidebar-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.mobile-sidebar-cart-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.mobile-sidebar-cart-item-image {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.mobile-sidebar-cart-item-details {
    flex: 1;
    min-width: 0;
}

.mobile-sidebar-cart-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-sidebar-cart-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.mobile-sidebar-cart-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #007aff;
}

/* Empty Cart State */
.mobile-sidebar-cart-empty {
    text-align: center;
    padding: 32px 16px;
    color: #6b7280;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-cart-empty-icon {
    width: 48px;
    height: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.mobile-sidebar-cart-empty-text {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.mobile-sidebar-cart-empty-subtext {
    font-size: 14px;
    color: #6b7280;
}

/* Cart Footer */
.mobile-sidebar-cart-footer {
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.mobile-sidebar-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-sidebar-cart-total-label {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
}

.mobile-sidebar-cart-total-amount {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.mobile-sidebar-cart-checkout {
    width: 100%;
    padding: 12px 24px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mobile-sidebar-cart-checkout:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.mobile-sidebar-cart-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: #9ca3af;
}

/* Simple animation for sidebar items */
.mobile-sidebar-nav-item,
.mobile-sidebar-cart-item {
    opacity: 0;
    transform: translateX(10px);
    animation: slideInLeft 0.2s ease forwards;
}

.mobile-sidebar.active .mobile-sidebar-nav-item:nth-child(1) {
    animation-delay: 0.05s;
}

.mobile-sidebar.active .mobile-sidebar-nav-item:nth-child(2) {
    animation-delay: 0.1s;
}

.mobile-sidebar.active .mobile-sidebar-nav-item:nth-child(3) {
    animation-delay: 0.15s;
}

.mobile-sidebar.active .mobile-sidebar-nav-item:nth-child(4) {
    animation-delay: 0.2s;
}

.mobile-sidebar.active .mobile-sidebar-nav-item:nth-child(5) {
    animation-delay: 0.25s;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 360px) {
    .mobile-sidebar {
        width: 280px;
    }
    
    .mobile-sidebar-cart-item {
        padding: 10px 12px;
    }
    
    .mobile-sidebar-cart-item-image {
        width: 36px;
        height: 54px;
    }
}

/* Hide old mobile dropdown in favor of new sidebar */
@media (max-width: 767px) {
    .mobile-dropdown {
        display: none !important;
    }
}

/* FORCE HIDE OLD MOBILE DROPDOWN */
#mobile-dropdown {
    display: none !important;
}

/* Only show on mobile */
@media (min-width: 768px) {
    .mobile-sidebar,
    .mobile-sidebar-overlay {
        display: none !important;
    }
}

/* Hardware acceleration for smooth animations */
.mobile-sidebar,
.mobile-sidebar-overlay,
.mobile-sidebar-nav-item,
.mobile-sidebar-cart-item {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* Prevent body scroll when sidebar is open */
body.mobile-sidebar-open {
    overflow: hidden;
    /* REMOVED: position: fixed causes frozen header bug */
    /* position: fixed; */
    /* width: 100%; */
    /* height: 100%; */
} 