/* ========== Sezione 1: Logo + Search + Profilo/Wishlist ========== */
.header-top-section {
    background-color: #f0f2f5;
    border-bottom: 1px solid #e0e0e0;
    width: 100%;
}

.header-logo-img {
    max-width: 180px;
    height: auto;
}

/* Search Box */
.search-box-new {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

.category-select-search {
    border: none;
    border-right: 1px solid #e0e0e0;
    background-color: #fff;
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    min-width: 180px;
    border-radius: 0;
    flex-shrink: 0;
}

.category-select-search:focus {
    box-shadow: none;
    outline: none;
    border-color: #e0e0e0;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-input-new {
    border: none;
    padding: 12px 50px 12px 16px;
    font-size: 14px;
    width: 100%;
}

.search-input-new:focus {
    box-shadow: none;
    outline: none;
}

.search-input-new::placeholder {
    color: #999;
    font-style: italic;
}

.btn-search-icon {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #0088b3;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header Actions (Profilo/Wishlist) */
.header-actions {
    gap: 20px;
}

.header-action-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
}

.header-action-link:hover {
    color: #0088b3;
}

.header-action-link i {
    font-size: 22px;
}

.badge-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background-color: #0088b3;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ========== Sezione 2: Categorie + Menu + Carrello (STICKY) ========== */
.header-bottom-section {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    width: 100%;
    transition: all 0.3s ease;
    z-index: 999;
}

.header-bottom-section.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Pulsante Categorie */
.category-dropdown-wrapper {
    position: relative;
}

.btn-categories-new {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid #dee2e6;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 150px;
}

.btn-categories-new:hover,
.btn-categories-new.active {
    background-color: #f8f9fa;
    border-color: #0088b3;
    color: #0088b3;
}

.btn-categories-new i:first-child {
    font-size: 20px;
}

.btn-categories-new i:last-child {
    font-size: 14px;
    transition: transform 0.3s;
}

.btn-categories-new.active i:last-child {
    transform: rotate(180deg);
}

/* Dropdown Categorie */
.category-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 280px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.category-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.category-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.category-item {
    position: relative;
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.category-link:hover {
    background-color: #f8f9fa;
    color: #0088b3;
}

.category-link i {
    font-size: 14px;
    color: #999;
}

/* Submenu Categorie */
.category-item.has-submenu:hover .category-submenu {
    opacity: 1;
    visibility: visible;
}

.category-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 220px;
    padding: 8px 0;
    margin-left: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1001;
}

.category-sublist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-sublist li a {
    display: block;
    padding: 10px 20px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
}

.category-sublist li a:hover {
    background-color: #f8f9fa;
    color: #0088b3;
    padding-left: 24px;
}

/* Menu Navigazione */
.main-nav-menu {
    width: 100%;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item.active .nav-link {
    color: #0088b3;
    font-weight: 600;
}

.nav-link {
    color: #666;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.3s;
    white-space: nowrap;
}

.nav-link:hover {
    color: #0088b3;
}

/* Carrello Totale Button */
.cart-total-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #0580B9;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

.cart-total-button:hover {
    color: white;
}

.cart-total-button i {
    font-size: 22px;
}

.cart-text {
    font-weight: 400;
}

.cart-text strong {
    font-weight: 600;
}

/* Mobile Menu Button */
.btn-mobile-menu {
    background: none;
    border: none;
    color: #333;
    font-size: 28px;
    padding: 0;
    cursor: pointer;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 991px) {
    .header-logo-img {
        max-width: 140px;
    }
    
    /*
    .header-action-link span {
        display: none !important;
    }
        */
    
    .header-action-link i {
        font-size: 24px;
    }
    
    .cart-total-button {
        padding: 10px 14px;
    }
    
    .cart-text {
        display: none;
    }
    
    .cart-total-button i {
        font-size: 24px;
    }
}

@media (max-width: 767px) {
    .header-top-section .py-3 {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    .header-bottom-section .py-2 {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    .badge-count {
        top: -4px;
        right: -6px;
        min-width: 16px;
        height: 16px;
        font-size: 9px;
    }
}

/* ========== MEGA MENU DESKTOP FULL WIDTH ========== */

/* Header deve avere position relative per contenere il megamenu */
.header {
    position: relative;
}

/* Nav items - posizionamento statico per megamenu full width */
.main-nav-menu .nav-list {
    position: static;
}

.main-nav-menu .nav-list > li {
    position: static;
}

/* Mega Menu Full Width - SOLO DESKTOP */
.mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    width: 100%;
    background: white;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
    z-index: 9999;
    padding: 40px 0;
}

.mega-menu.show {
    display: block;
}

/* Container interno del mega menu */
.mega-menu .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Titoli colonne */
.mega-menu h6 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: #333;
    letter-spacing: 0.5px;
}

/* Liste */
.mega-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu ul li {
    margin-bottom: 10px;
}

.mega-menu ul li a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
    display: block;
}

.mega-menu ul li a:hover {
    color: #0088b3;
}

/* Link "Vedi tutti" */
.mega-menu ul li a.view-all {
    color: #0088b3;
    font-weight: 600;
}

.mega-menu ul li a.view-all:hover {
    color: #006699;
}

/*
.product-card {
    text-align: center;
    transition: transform 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-card p {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    text-transform: lowercase;
    margin: 0;
}
*/

/* Sezione immagini prodotti */
.products-section {
    padding-left: 30px;
    border-left: 1px solid #e0e0e0;
}

/* Badge per credito utente */
.badge-count-bg-blue {
    background-color: #0088b3;
}

.badge-count-bg-red {
    background-color: #dc3545;
}

/* ========== MOBILE SIDEBAR MENU ========== */

/* Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: #f8f9fa;
    z-index: 10001;
    transition: right 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    right: 0;
}

/* Header sidebar */
.mobile-sidebar-header {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.mobile-sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Container per i pannelli */
.panels-container {
    position: relative;
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Menu panels */
.menu-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    background: #f8f9fa;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.menu-panel.active {
    transform: translateX(0);
}

.menu-panel.prev {
    transform: translateX(-100%);
}

/* Menu items - ALTEZZA UNIFORME */
.mobile-menu-item {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 18px 20px;
    min-height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 500;
}

.mobile-menu-item:hover {
    background: #f8f9fa;
    color: #333;
}

.mobile-menu-item.has-submenu::after {
    content: '›';
    font-size: 24px;
    color: #999;
}

/* Panel header con back button - COMPLETAMENTE CLICCABILE */
.panel-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.panel-back-btn {
    width: 100%;
    background: #0580B9;
    border: none;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    text-align: left;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.panel-back-btn:hover {
    background: #0580B9;
}

.panel-back-icon {
    font-size: 24px;
    line-height: 1;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0;
}

/* Submenu section */
.submenu-section {
    margin: 20px 0;
}

.submenu-section-title {
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
}

.submenu-item {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 20px;
    min-height: 50px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 13px;
}

.submenu-item:hover {
    background: #f8f9fa;
    color: #333;
}

/* User info nel footer sidebar */
.mobile-sidebar-footer {
    background: #000;
    color: #fff;
    padding: 20px;
    flex-shrink: 0;
}

.mobile-sidebar-footer a {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Nascondi mega menu su mobile */
@media (max-width: 991px) {
    .mega-menu {
        display: none !important;
    }
}

/* Mostra mega menu solo su desktop */
@media (min-width: 992px) {
    .mobile-menu-overlay,
    .mobile-sidebar {
        display: none !important;
    }
}