/* ==============================
   HEADER PRINCIPALE
============================== */

#sup-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #242929;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding:15px 0;
}

#sup-header > .container {
    position: relative;
}

#header-container {
    display: flex;
    align-items: center;
    height: 80px;
    width: 100%;
    padding: 0 15px;
    margin: 0;
}

/* ==============================
   COLONNE
============================== */

.header-left,
.header-center,
.header-right {
    justify-content: flex-end;
}

.header-left {
    justify-content: flex-start;
}

.header-center {
    justify-content: center;
}

/* Posizione della colonna destra */
#header-container .header-right {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    justify-content: flex-end;
    margin-left: auto !important;
    padding-right: 12px;
}

/* ==============================
   LOGO CENTRALE
============================== */

.header-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
}

#logo,
.header-logo {
    display: block;
    height: 60px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* ==============================
   RICERCA E ICONE
============================== */

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
    width: auto;
    margin-left: 0;
}

/* Form di ricerca */

.header-search-form {
    display: flex;
    align-items: center;
    flex: 1 1 180px;
    min-width: 0;
    max-width: 230px;
    margin: 0;
}

.header-search-form .input-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    margin: 0;
}

.header-search-form .form-control {
    height: 40px;
    min-width: 0;
}

.header-search-form .btn {
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==============================
   PULSANTI ICONA
============================== */

.header-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 40px;
    padding: 0;
    margin: 0;
    background: transparent;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 21px;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.header-icon-btn:hover {
    background: #3b4141;
    color: #fe8001;
}

.header-icon-btn i {
    display: block;
    line-height: 1;
}

/* Carrello: allineamento originale funzionante */
.btn-white{background: #ffffff !important; border:0;}
.header-icon-btn.cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transform: translateY(2px);
}

.header-icon-btn.cart-btn > i {
    display: block;
    line-height: 1;
    margin: 0;
}

/* Badge quantità carrello */

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 20px;
    background: #fe8001;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
}

.header-icon-btn.cart-btn .cart-count {
    top: -4px;
    right: -4px;
    transform: none;
}

/* ==============================
   VECCHIE CLASSI AUTENTICAZIONE
============================== */

#auth-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 0;
    padding-left: 0;
}

.auth-btn {
    background-color: #fe8001;
    color: #ffffff !important;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.3s ease;
    border: 0;
}

.auth-btn:hover {
    background-color: #d89caf;
}

.menu-icon {
    margin-right: 6px;
    color: #ffffff;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* ==============================
   TABLET
============================== */

@media (max-width: 991.98px) {
    #header-container {
        height: 70px;
        padding: 0 8px;
    }

    #logo,
    .header-logo {
        height: 52px;
    }

    .header-actions {
        gap: 4px;
    }

    .header-search-form {
        max-width: 160px;
    }

    .header-icon-btn {
        flex-basis: 32px;
        width: 32px;
        font-size: 18px;
    }
}

/* ==============================
   SMARTPHONE
============================== */

@media (max-width: 767.98px) {
    #header-container {
        height: 65px;
        padding: 0 5px;
    }

    #logo,
    .header-logo {
        height: 43px;
    }

    #header-container .header-right {
        padding-right: 5px;
    }

    .header-actions {
        gap: 2px;
    }

    /* Su smartphone mostra solo la lente */

    .header-search-form {
        flex: 0 0 32px;
        width: 32px;
        max-width: 32px;
    }

    .header-search-form .form-control {
        display: none;
    }

    .header-search-form .input-group {
        width: 32px;
    }

    .header-search-form .btn {
        width: 32px;
        min-width: 32px;
        height: 36px;
        padding: 0;
    }

    .header-icon-btn {
        flex-basis: 29px;
        width: 29px;
        height: 36px;
        font-size: 16px;
    }

    .cart-count {
        top: -2px;
        right: -3px;
        min-width: 16px;
        height: 16px;
        font-size: 10px;
    }
}
