﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background-color: #f9f9f9;
    color: #333;
}

header {
    display: flex;
    width: 100%!important;
    top: 0!important;
    left: 0!important;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    /*background-color: #20232a;*/
    background-color: transparent;
    color: #20232a;
    position: fixed;
    z-index: 1000;
}
    header.scrolled {
        background-color: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(6px); /* effetto vetro opaco */
    }

.logo {
    font-size: 1.5em;
    font-weight: bold;
}

/* 🔘 Menu toggle (hamburger) */
.menu-toggle {
    font-size: 1.8em;
    background: none;
    border: none;
    color: #20232a;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
    display: none;
    position: relative;
}

    /* ☰ default → ✖ when active */
    .menu-toggle::before {
        content: "☰";
        transition: all 0.3s ease;
    }

    .menu-toggle.active::before {
        content: "✖";
    }

/* 📁 Navigation styles */
nav {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

    nav ul {
        display: flex;
        list-style: none;
        gap: 20px;
    }

    nav a {
        color: #20232a;
        text-decoration: none;
        font-weight: 500;
    }

.logged-menu {
    background-color: #e3e3e3;
    padding: 15px 30px;
    border-bottom: 2px solid #ccc;
}

    .logged-menu ul {
        list-style: none;
        display: flex;
        gap: 25px;
        justify-content: center;
        padding: 0;
        margin: 0;
    }

    .logged-menu a {
        text-decoration: none;
        color: #20232a;
        font-weight: 600;
        transition: color 0.3s ease;
    }

        .logged-menu a:hover {
            color: #0077cc;
        }

.user-menu {
    position: relative;
    display: inline-block;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: #0078D4;
    color: white;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 160px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

    .dropdown.open {
        transform: scaleY(1);
        opacity: 1;
        pointer-events: auto;
    }

    .dropdown ul {
        list-style: none;
        margin: 0;
        /*padding: 10px 0;*/
        display: block;
        padding-left: 0;
    }

    .dropdown li {
        display: block!important;
        padding: 10px 20px;
    }

        .dropdown li:hover {
            background-color: #f5f5f5;
        }

        .dropdown li a, .dropdown li > button {
            color: black!important;
        }

.logout-form {
    margin: 0;
    padding: 0;
}

    .logout-form button.btn-logout {
        background: none;
        border: none;
        color: black;
        font-weight: 500;
        cursor: pointer;
        font-size: 1em;
        padding: 0;
        text-decoration: none;
        transition: color 0.3s ease;
    }

        .logout-form button.btn-logout:hover {
            color: #ffa500;
        }

/* ⬇️ Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: #20232a;
    color: white;
}

#cookie-banner {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: #e3f2fd;
    padding: 15px;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
    margin: 0;
}

#carrello-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: red;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
}

.notifica {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 99999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

    .notifica.show {
        opacity: 1;
        transform: translateY(0);
    }

/* 📱 Mobile menu */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-end;
        width: 100vw;
    }

    .menu-toggle {
        display: block;
    }

    nav {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: #20232a;
        border-radius: 0 0 8px 8px;
        display: flex;
        flex-direction: column;
        padding: 20px;
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-20px);
    }

        nav.visible {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(15px);
        }

        nav ul {
            flex-direction: column;
            gap: 15px;
            margin-top: 10px;
        }

        nav ul li a {
            color: white;
        }

    .logged-menu ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .dropdown {
        /*position: fixed;
        top: 0;
        left: 0;*/
        width: 100%;
        /*height: 100%;*/
        background-color: white;
        z-index: 2000;
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
        /*padding-top: 80px;*/
        opacity: 0;
        pointer-events: none;
    }

        .dropdown.open {
            transform: translateY(0);
            opacity: 1;
            pointer-events: auto;
        }

        .dropdown ul {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: start;
            height: 100%;
        }

        .dropdown li {
            width: 100%;
            font-size: 1.2em;
            padding: 0 10px;
            text-align: left;
        }

            .dropdown li:hover {
                background-color: #f0f0f0;
            }

    .navbar-hidden {
        display: none !important;
    }

    #navbar.visible {
        display: block;
    }
}