/* Unified Mobile-First Navigation System */
:root {
    --primary-orange: #ff6b35;
    --secondary-orange: #f7931e;
    --white: #ffffff;
    --black: #000000;
    --gray-text: #666666;
    --light-gray: #f5f5f5;
    --border-light: #e0e0e0;
    --shadow-header: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-bottom-nav: 0 -2px 10px rgba(0,0,0,0.1);
}

/* Modern Header Styles */
.modern-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-header);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.business-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
}

.business-name h1 {
    font-size: 1.5rem;
    color: var(--black);
    margin: 0;
}

/* Logo Styling */
.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    max-width: 120px;
    transition: all 0.3s ease;
}

/* Business name link styling */
.business-name-link {
    display: block;
    transition: all 0.3s ease;
}

.business-name-link:hover {
    text-decoration: none !important;
}

.business-name-link h1 {
    transition: all 0.3s ease;
}

.business-name-link:hover h1 {
    color: var(--primary-orange) !important;
}

/* Logo hover effect */
.business-name-link:hover .logo-image {
    transform: scale(1.05);
}

/* Responsive logo sizing */
@media (max-width: 480px) {
    .logo-image {
        height: 35px;
        max-width: 100px;
    }
    
    .business-name h1 {
        font-size: 1.2rem;
    }
}

@media (min-width: 768px) {
    .logo-image {
        height: 45px;
        max-width: 140px;
    }
}

/* Cart Icon in Header */
.cart-icon {
    text-decoration: none;
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-orange);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Search Section */
.search-section {
    background: var(--light-gray);
    padding: 15px 0;
}

.search-container {
    max-width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-icon {
    color: var(--gray-text);
    margin-right: 12px;
    font-size: 1rem;
}

.search-input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    background: transparent;
    color: var(--black);
}

.search-input::placeholder {
    color: var(--gray-text);
}

/* Main Content Spacing */
.main-content {
    padding-bottom: 80px; /* Space for bottom navigation */
    min-height: calc(100vh - 140px); /* Adjust based on header height */
}

/* Bottom Navigation - Updated and Unified */
.bottom-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: var(--shadow-bottom-nav);
    height: 70px;
}

.bottom-navigation .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-text);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 12px;
    min-width: 60px;
    position: relative;
}

.bottom-navigation .nav-item i {
    font-size: 1.4rem;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.bottom-navigation .nav-item span {
    font-size: 0.7rem;
    line-height: 1;
}

.bottom-navigation .nav-item:hover,
.bottom-navigation .nav-item.active {
    color: var(--primary-orange);
    background: rgba(255, 107, 53, 0.1);
}

.bottom-navigation .nav-item:hover i,
.bottom-navigation .nav-item.active i {
    transform: translateY(-2px);
}

/* Hide desktop elements in mobile view */
@media (max-width: 768px) {
    /* Show footer in mobile with proper spacing */
    footer.bg-dark {
        display: block !important;
        margin-bottom: 80px; /* Space for bottom navigation */
    }
    
    /* Ensure bottom nav is always visible */
    .bottom-navigation {
        display: flex !important;
    }
}

/* Tablet and Desktop Adjustments */
@media (min-width: 769px) {
    .modern-header {
        max-width: 480px;
        margin: 0 auto;
        border-left: 1px solid var(--border-light);
        border-right: 1px solid var(--border-light);
    }
    
    .main-content {
        max-width: 480px;
        margin: 0 auto;
        border-left: 1px solid var(--border-light);
        border-right: 1px solid var(--border-light);
        min-height: calc(100vh - 140px);
    }
    
    .bottom-navigation {
        max-width: 480px;
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
        border-left: 1px solid var(--border-light);
        border-right: 1px solid var(--border-light);
    }
    
    /* Show desktop footer on larger screens */
    footer.bg-dark {
        display: block !important;
        max-width: 480px;
        margin: 0 auto;
    }
}

/* Large Desktop */
@media (min-width: 1024px) {
    .modern-header,
    .main-content,
    .bottom-navigation,
    footer.bg-dark {
        max-width: 520px;
    }
}

/* Active state management */
.nav-item.active {
    color: var(--primary-orange) !important;
}

/* SINGLE CART BADGE IMPLEMENTATION - Remove all other cart badge CSS */
.bottom-navigation .nav-item[data-cart-count]:not([data-cart-count=""]):not([data-cart-count="0"])::after {
    content: attr(data-cart-count) !important;
    position: absolute !important;
    top: 2px !important;
    right: 8px !important;
    background: #ff3b30 !important;
    color: white !important;
    border-radius: 50% !important;
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    min-width: 18px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    border: 2px solid white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    z-index: 1001 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Prevent any other cart badge styles */
.bottom-navigation .nav-item .badge,
.bottom-navigation .nav-item > .badge,
.bottom-navigation .nav-item span.badge {
    display: none !important;
}

/* Override any conflicting styles */
.bottom-navigation .nav-item[data-cart-count=""]::after,
.bottom-navigation .nav-item[data-cart-count="0"]::after,
.bottom-navigation .nav-item:not([data-cart-count])::after {
    display: none !important;
}

/* Smooth transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Safe area adjustments for newer phones */
@supports (padding: max(0px)) {
    .bottom-navigation {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* Search functionality enhancement */
.search-input:focus {
    outline: none;
}

.search-input-wrapper:focus-within {
    box-shadow: 0 2px 12px rgba(255, 107, 53, 0.3);
    border: 1px solid var(--primary-orange);
}

/* Loading states */
.nav-item:active {
    transform: scale(0.95);
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .nav-item,
    .nav-item i,
    .search-input-wrapper {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modern-header,
    .bottom-navigation {
        border-color: var(--black);
    }
    
    .nav-item:hover,
    .nav-item.active {
        background: var(--black);
        color: var(--white);
    }
}