/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    color: #333;
    background-color: #fff;
    margin: 0;
    padding: 0;
}

/* Color Variables */
:root {
    --red: #D32F2F;
    --green: #4CAF50;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --ripple-color: rgba(211, 47, 47, 0.3);
}

/* Header */
header {
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 0;
    background: var(--white);
}
.logo-image {
    height: 36px;
    object-fit: contain;
}
.user-actions {
    gap: 8px;
}
.user-actions a {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.user-actions a:hover {
    color: var(--red);
}
.user-actions .badge {
    background-color: var(--red);
    color: var(--white);
    font-size: 0.7rem;
    padding: 3px 7px;
    border-radius: 50%;
    border: 1px solid var(--white);
}
.btn-red {
    background-color: var(--red);
    border-color: var(--red);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 4px;
}
.btn-red:hover {
    background-color: #b71c1c;
    border-color: #b71c1c;
}
.dropdown-toggle {
    font-size: 0.9rem;
    padding: 6px 10px;
}
.mega-menu-dropdown {
    min-width: 200px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: var(--white);
}
.mega-menu-dropdown .dropdown-item {
    font-size: 0.9rem;
    padding: 8px 15px;
}
.mega-menu-dropdown .dropdown-item:hover {
    background-color: var(--light-gray);
    color: var(--red);
}
.form-control {
    border: 1px solid #ccc;
    border-radius: 25px;
    font-size: 0.95rem;
    padding: 8px 12px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}
.btn-red.search-btn {
    border-radius: 25px;
    padding: 8px 12px;
}

/* Second Nav */
.second-nav {
    background-color: var(--green);
    padding: 8px 0;
}
.second-nav .nav-link {
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
}
.second-nav .nav-link:hover {
    color: var(--red);
}
.second-nav .text-red {
    color: var(--red);
}
.second-nav .mega-menu {
    width: 100%;
    max-width: calc(100% - 40px);
    padding: 20px;
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.second-nav .dropdown-item {
    font-size: 0.9rem;
    padding: 6px 15px;
    color: #333;
}
.second-nav .dropdown-item.fw-bold {
    color: #000;
}
.second-nav .dropdown-item:hover {
    background-color: var(--light-gray);
    color: var(--red);
}

/* Sidebar (Desktop Only) */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    width: 300px;
    height: 100%;
    background: var(--white);
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1050;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}
.sidebar.active {
    transform: translateX(0);
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--green);
    color: var(--white);
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 500;
}
.sidebar-header .btn-link {
    color: var(--white);
    font-size: 1.2rem;
}
.sidebar-content {
    padding-bottom: 20px;
}
.sidebar-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
}
.sidebar-item:hover {
    background: var(--light-gray);
    color: var(--red);
}
.sidebar-heading {
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    background: var(--light-gray);
    margin: 0;
}
.accordion-button {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
}
.accordion-button:not(.collapsed) {
    background-color: var(--light-gray);
    color: var(--red);
}
.accordion-body {
    padding: 10px 20px;
}
.category-link {
    font-size: 0.9rem;
    color: #555;
    padding: 8px 0;
}
.category-link:hover {
    color: var(--red);
}
.see-all-link {
    font-size: 0.9rem;
    color: var(--red);
    font-weight: 500;
    padding: 8px 0;
}
.see-all-link:hover {
    text-decoration: underline;
}
.sidebar .form-control {
    font-size: 0.9rem;
    border-radius: 4px 0 0 4px;
}
.sidebar .btn-red {
    border-radius: 0 4px 4px 0;
}

/* Mobile Bottom Nav Bar */
.bottom-nav {
    padding: 10px 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.92) 100%);
    backdrop-filter: blur(15px);
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(211, 47, 47, 0.2);
}
.bottom-nav .nav-link {
    color: #555;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s ease, transform 0.1s ease;
    position: relative;
    padding: 12px 0;
    overflow: hidden;
}
.bottom-nav .nav-link:hover,
.bottom-nav .nav-link[data-active="true"] {
    color: var(--red);
}
.bottom-nav .nav-link[data-active="true"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 2px;
    background: var(--red);
    animation: underline 0.3s ease;
}
@keyframes underline {
    from { width: 0; }
    to { width: 50%; }
}
.bottom-nav .nav-link:active {
    transform: scale(0.95);
}
.bottom-nav .nav-pills .nav-link {
    border: none;
    border-radius: 0;
}
.bottom-nav small {
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.03em;
}
.bottom-nav .badge {
    background-color: var(--red);
    color: var(--white);
    font-size: 0.65rem;
    padding: 4px;
    border-radius: 50%;
    border: 1.5px solid var(--white);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.bottom-nav .icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--light-gray);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}
.bottom-nav .nav-link:hover .icon-wrapper,
.bottom-nav .nav-link[data-active="true"] .icon-wrapper {
    background: rgba(211, 47, 47, 0.15);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.bottom-nav .nav-link i {
    font-size: 1.3rem;
}
.bottom-nav .ripple {
    position: absolute;
    border-radius: 50%;
    background: var(--ripple-color);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Mobile Overlays */
.mobile-search-overlay,
.mobile-categories-overlay {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.mobile-categories-overlay {
    transform: translateY(100%);
    opacity: 0;
}
.mobile-categories-overlay.show {
    transform: translateY(0);
    opacity: 1;
}
.mobile-search-overlay.show {
    display: block !important;
}
.mobile-search-overlay .form-control {
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 1rem;
    border: 1px solid #ccc;
}
.mobile-search-overlay .btn-red {
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-categories-overlay .accordion-button {
    font-size: 1rem;
    padding: 15px;
}
.mobile-categories-overlay .accordion-body {
    padding: 10px 15px;
}
.mobile-categories-overlay .category-link,
.mobile-categories-overlay .see-all-link {
    padding: 10px 0;
    font-size: 0.95rem;
}
#closeCategoriesOverlay {
    font-size: 1.2rem;
    color: #333;
}

/* Footer */
footer {
    background-color: var(--green);
    color: var(--white);
    padding: 30px 0;
}
footer h5 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}
footer a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
}
footer a:hover {
    color: var(--red);
}
footer .social-icons a {
    font-size: 1.2rem;
    margin-right: 10px;
}
footer .list-unstyled li {
    margin-bottom: 8px;
}

/* Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background-color: var(--red);
    border-color: var(--red);
    color: var(--white);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.scroll-to-top.show {
    display: flex;
}
.scroll-to-top:hover {
    background-color: #b71c1c;
}

/* Responsive Design */
@media (max-width: 576px) {
    .logo-image {
        height: 30px;
    }
    .user-actions {
        gap: 6px;
    }
    .user-actions a, .user-actions .btn {
        font-size: 0.85rem;
    }
    .form-control {
        font-size: 0.9rem;
        padding: 6px 10px;
        height: 36px;
    }
    .btn-red.search-btn {
        padding: 6px 10px;
        height: 36px;
    }
    footer .row {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 6px 0;
    }
    .container {
        max-width: 100%;
        padding: 0 10px;
    }
    .second-nav {
        display: none !important;
    }
    .d-flex.align-items-center.flex-grow-1 {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin: 0 10px;
    }
    .form-control {
        width: 100%;
        border-radius: 25px;
    }
    .btn-red.search-btn {
        border-radius: 25px;
        padding: 6px 10px;
    }
    .user-actions {
        flex-direction: row;
        gap: 6px;
    }
    .user-actions .dropdown-toggle {
        padding: 4px 8px;
        font-size: 0.85rem;
    }
    .sidebar {
        display: none !important;
    }
    .bottom-nav {
        display: block !important;
    }
    main {
        padding-bottom: 80px;
    }
}

@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
    }
    main {
        padding-bottom: 0;
    }
}

@media (max-width: 992px) {
    .user-actions {
        font-size: 0.85rem;
    }
    .mega-menu-dropdown {
        width: 100%;
    }
}

/* Enhanced Header Styles */
.sticky-top {
    position: sticky;
    top: 0;
}

/* Enhanced Search Bar */
.search-container {
    max-width: 600px;
}

.search-group {
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.search-group:focus-within {
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.2);
    border-color: var(--red);
}

.search-input {
    border: none;
    border-radius: 0;
    padding: 12px 20px;
    font-size: 0.95rem;
    background: var(--white);
}

.search-input:focus {
    box-shadow: none;
    background: var(--white);
}

.search-btn {
    border-radius: 0 25px 25px 0;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateX(1px);
}

/* Search Suggestions */
.search-suggestions {
    border: 1px solid #e0e0e0;
    max-height: 300px;
    overflow-y: auto;
}

.suggestions-list .suggestion-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.suggestions-list .suggestion-item:hover {
    background-color: var(--light-gray);
    color: var(--red);
}

/* Enhanced User Menu */
.user-menu-btn {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.user-menu-btn:hover {
    background-color: var(--light-gray);
    border-color: #e0e0e0;
}

.user-avatar {
    transition: all 0.3s ease;
}

.user-menu-btn:hover .user-avatar {
    background-color: var(--red) !important;
}

.user-menu-btn:hover .user-avatar i {
    color: var(--white) !important;
}

/* Language Button */
.language-btn {
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.85rem;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.language-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

/* Menu Toggle Button */
.menu-toggle-btn {
    border-radius: 20px;
    transition: all 0.3s ease;
}

.menu-toggle-btn:hover {
    border-color: var(--red);
    color: var(--red);
    transform: rotate(90deg);
}

/* Enhanced Bottom Navigation */
.bottom-nav {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95) !important;
}

.bottom-nav .nav-link {
    padding: 12px 8px;
    border-radius: 16px;
    margin: 0 2px;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.bottom-nav .nav-link:hover,
.bottom-nav .nav-link[data-active="true"] {
    background: rgba(211, 47, 47, 0.08);
    color: var(--red);
    transform: translateY(-2px);
}

.bottom-nav .nav-link[data-active="true"]::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--red);
    border-radius: 50%;
}

/* Enhanced Nav Icons */
.nav-icon-wrapper {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.bottom-nav .nav-link:hover .nav-icon-wrapper,
.bottom-nav .nav-link[data-active="true"] .nav-icon-wrapper {
    background: rgba(211, 47, 47, 0.15);
    transform: scale(1.1);
}

/* Search Floating Button */
.search-floating-btn {
    width: 50px;
    height: 50px;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
    transition: all 0.3s ease;
}

#mobileSearchToggle:hover .search-floating-btn {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}

/* Cart Badge */
.cart-badge {
    font-size: 0.7rem;
    padding: 4px 6px;
    min-width: 18px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Nav Pulse Animation */
.nav-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: var(--red);
    opacity: 0;
    animation: none;
}

.bottom-nav .nav-link[data-active="true"] .nav-pulse {
    animation: navPulse 2s infinite;
}

@keyframes navPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    70% {
        transform: scale(1.4);
        opacity: 0;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Nav Labels */
.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.bottom-nav .nav-link:hover .nav-label,
.bottom-nav .nav-link[data-active="true"] .nav-label {
    color: var(--red);
    font-weight: 700;
}

/* Enhanced Dropdowns */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 8px;
}

.dropdown-item {
    border-radius: 8px;
    margin: 2px 0;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(211, 47, 47, 0.1);
    color: var(--red);
    transform: translateX(2px);
}

/* Smooth transitions for all interactive elements */
.logo-image:hover {
    transform: scale(1.05);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
    }
    
    .nav-icon-wrapper {
        width: 40px;
        height: 40px;
    }
    
    .search-floating-btn {
        width: 44px;
        height: 44px;
    }
    
    .bottom-nav .nav-link {
        padding: 10px 6px;
    }
}

@media (max-width: 576px) {
    .user-info {
        display: none !important;
    }
    
    .nav-label {
        font-size: 0.65rem;
    }
    
    .nav-icon-wrapper {
        width: 36px;
        height: 36px;
    }
}