/* Modern Navbar Styles */
.modern-nav-container * {
    box-sizing: border-box;
}

.modern-nav-container {
    background: #cc0001;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);

    position: relative;
    z-index: 999;
}

.modern-nav-wrapper {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
}

.modern-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.modern-nav-item {
    position: relative;
}

.modern-nav-link {
    display: block;
    padding: 14px 14px;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s ease;
    font-size: 14px;
}

.modern-nav-link:hover,
.modern-nav-item:hover>.modern-nav-link,
.modern-nav-link:focus {
    background-color: rgba(255, 255, 255, 0.15);
    /* Yumuşak beyaz katman */
    color: #fff;
    text-decoration: none;
}

.modern-nav-link i.fa-chevron-down {
    font-size: 10px;
    margin-left: 6px;
    margin-top: 3px;
    float: right;
    transition: transform 0.4s ease;
}

.modern-nav-item:hover>.modern-nav-link i.fa-chevron-down {
    transform: rotate(180deg);
}

.modern-nav-link i:not(.fa-chevron-down) {
    margin-right: 6px;
    font-size: 15px;
    vertical-align: middle;
}

/* Dropdown */
.modern-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 230px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 0 8px 8px 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.4s ease;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    border-top: 3px solid #cc0001;
}

.modern-nav-item:hover>.modern-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.modern-dropdown-menu li a {
    display: block;
    padding: 12px 20px;
    color: #222;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 700;
    white-space: normal;
    word-break: break-word;
}

.modern-dropdown-menu li:last-child a {
    border-bottom: none;
}

.modern-dropdown-menu li a:hover {
    background: #fdfdfd;
    color: #cc0001;
    padding-left: 24px;
}

.modern-nav-toggle {
    display: none;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: none;
    border: none;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-nav-toggle:hover {
    color: #ffd0d0;
}

/* Mobile Sidebar Drawer */
@media (max-width: 991px) {
    .modern-nav-wrapper {
        justify-content: flex-start;
        padding: 0;
    }

    .modern-nav-toggle {
        display: block;
    }

    .modern-sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        border-bottom: 1px solid #ebebeb;
        margin-bottom: 5px;
    }

    .modern-sidebar-logo {
        max-height: 45px;
        width: auto;
        object-fit: contain;
    }

    .modern-nav-list {
        display: block;
        position: fixed;
        top: 0;
        left: -320px;
        /* Hidden to the left */
        width: 280px;
        height: 100%;
        background: #fff;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        padding-top: 0;
        transition: left 0.5s ease;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 1001;
    }

    .modern-nav-list.active {
        left: 0;
        /* Slide in */
    }

    .modern-nav-item {
        width: 100%;
        border-bottom: 1px solid #f9f9f9;
        transition: background-color 0.3s ease;
    }

    .modern-nav-item:last-child {
        border-bottom: none;
    }

    .modern-nav-link {
        border-bottom: none;
        padding: 15px 20px;
        color: #333;
        border-left: 4px solid transparent;
        transition: all 0.3s ease;
        font-size: 16px;
    }

    .modern-nav-link:hover,
    .modern-nav-item:hover>.modern-nav-link,
    .modern-nav-link:focus {
        background-color: #fafafa;
        color: #cc0001;
        border-left: 4px solid #cc0001;
    }

    .modern-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        visibility: visible;
        opacity: 1;
        transform: none;
        background: #fdfdfd;
        padding: 0;
        display: block;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease;
    }

    .modern-dropdown-menu li a {
        font-size: 15px;
        padding: 12px 20px 12px 30px;
    }

    .modern-dropdown-menu.show {
        /* JS applies scrollHeight dynamically */
    }

    .modern-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: none;
        opacity: 0;
        transition: opacity 0.4s ease;
    }

    .modern-nav-overlay.active {
        display: block;
        opacity: 1;
    }

    .modern-close-btn {
        font-size: 22px;
        background: none;
        border: none;
        color: #555;
        display: block;
        cursor: pointer;
        padding: 5px;
        transition: color 0.3s ease;
    }

    .modern-close-btn:hover {
        color: #cc0001;
    }
}

@media (min-width: 992px) {
    .modern-close-btn {
        display: none;
    }

    .modern-nav-overlay {
        display: none;
    }

    .modern-sidebar-header {
        display: none;
    }
}

/* User Account Dropdown Profile Button */
.modern-user-dropdown {
    position: relative;
    /* Removed float right explicitly to let flexbox handle alignment */
}

.modern-user-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

.modern-user-btn {
    background-color: #fff;
    color: #000;
    padding: 6px 18px 6px 12px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #f2f2f2;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
  
}

.modern-user-btn i {
    transition: transform 0.4s ease;
    font-size: 11px;
}

.modern-user-btn:hover {
    background-color: #cc0001;
    color: #fff;
    border-color: #cc0001;
    box-shadow: 0 4px 12px rgba(204, 0, 1, 0.3);
}

.modern-user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    min-width: 240px;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    border-top: 3px solid #cc0001;
    display: flex;
    flex-direction: column;
}

/* Scrollable links container */
.modern-user-links {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 6px 0;
}

/* Custom scrollbar for links area */
.modern-user-links::-webkit-scrollbar {
    width: 5px;
}

.modern-user-links::-webkit-scrollbar-track {
    background: transparent;
}

.modern-user-links::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.modern-user-links::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.modern-user-menu::before {
    content: '';
    position: absolute;
    top: -25px;
    /* bridges the physical hover gap */
    left: 0;
    width: 100%;
    height: 25px;
    background: transparent;
}

.modern-user-dropdown:hover .modern-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.modern-user-links a {
    color: #444;
    padding: 12px 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease, padding-left 0.2s ease, color 0.2s ease;
}

.modern-user-links a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #888;
    transition: color 0.2s ease;
}

.modern-user-links a:hover {
    background-color: #fdfdfd;
    color: #cc0001;
    padding-left: 24px;
}

.modern-user-links a:hover i {
    color: #cc0001;
}

/* User Menu Profile Header Styles - Fixed, not scrollable */
.modern-user-profile-header {
    padding: 7px 9px 9px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #fafafa 0%, #fff 100%);
    border-radius: 12px 12px 0 0;
}

.modern-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(204, 0, 1, 0.15);
}

.modern-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modern-user-info {
    flex: 1;
    min-width: 0;
}

.modern-user-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modern-user-email {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.modern-user-balance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fff4;
    color: #22a35a;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #dcfce7;
}

.modern-user-balance i {
    font-size: 12px;
}

.modern-user-links .logout-item {
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
    padding-top: 10px;
    color: #cc0001;
}

.modern-user-links .logout-item i {
    color: #cc0001;
}

.modern-user-links .logout-item:hover {
    background-color: #fff0f0;
    padding-left: 24px;
}

/* Cart Button */
.modern-cart-btn {
    background-color: #fff;
    color: #333;
    padding: 6px 18px 6px 12px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #f2f2f2;
    border-radius: 10px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;

    cursor: pointer;
}

.modern-cart-btn:hover {
    background-color: #cc0001;
    color: #fff;
    border-color: #cc0001;
    box-shadow: 0 4px 12px rgba(204, 0, 1, 0.3);
    text-decoration: none;
}

.modern-cart-badge {
    background-color: white;
    color: #cc0001;
    border-radius: 50%;
    padding: 2px 7px;
    font-size: 13px;
    font-weight: bold;
    min-width: 22px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.5);
}