/* =========================
   HEADER / TOPBAR
========================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #000;
    border-bottom: 1px solid #1f1f1f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 0 24px;
}

.topbar-inner {
    max-width: 1600px;
    margin: 0 auto;
    min-height: 96px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

/* =========================
   LEFT / RIGHT SLOTS
========================= */

.brand-slot,
.cart-slot {
    display: flex;
    align-items: center;
    min-width: 0;
}

.brand-slot {
    justify-content: flex-start;
    gap: 14px;
}

.cart-slot {
    justify-content: flex-end;
}

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

.brand {
    display: flex;
    align-items: center;
}

.logo-wrap {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo-media {
    display: flex;
    align-items: center;
    width: 106px;
}

.logo-media img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* =========================
   MENU DESKTOP
========================= */

.main-menu {
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-menu-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: clamp(18px, 2.2vw, 34px);
    white-space: nowrap;
}

.main-menu-list a {
    color: #fff;
    text-decoration: none;
    font-size: clamp(16px, 1.35vw, 19px);
    font-weight: 700;
    transition: color 0.22s ease, opacity 0.22s ease;
}

.main-menu-list a:hover {
    color: #ffc400;
    opacity: 1;
}

/* =========================
   CART
========================= */

.cart-area {
    position: relative;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.cart-icon {
    padding-top: 16px;
    font-size: 34px;
    color: #fff;
}

.cart-count {
    position: absolute;
    top: 0;
    right: -8px;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    border-radius: 999px;
    background: #d90000;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   HAMBURGER
========================= */

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
}

/* =========================
   SIDE MENU
========================= */

.mobile-side-menu {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: 0.25s ease;
    z-index: 1200;
}

.mobile-side-menu-panel {
    width: min(320px, 82vw);
    height: 100%;
    background: #000;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    padding: 0 20px 24px;
    display: flex;
    flex-direction: column;
}

.mobile-side-menu-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 96px; /* uguale alla topbar */
    padding: 0;
}

.mobile-side-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-side-menu.is-open .mobile-side-menu-panel {
    transform: translateX(0);
}

.mobile-side-menu-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: color 0.22s ease, opacity 0.22s ease, transform 0.22s ease;
}

.mobile-side-menu-close:hover {
    color: #ffc400;
    opacity: 1;
}

.mobile-side-menu-nav {
    display: flex;
    flex-direction: column;
}

.mobile-side-menu-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 14px 0;
    border-bottom: 1px solid #262626;
    transition: color 0.22s ease, opacity 0.22s ease;
}

.mobile-side-menu-nav a:hover {
    color: #ffc400;
}

/* =========================
   BODY LOCK
========================= */

body.menu-open {
    overflow-x: hidden;
}
/* =========================
   MOBILE
========================= */

@media (max-width: 640px) {

    .topbar-inner {
        grid-template-columns: auto 1fr auto;
        gap: 12px;
    }

    .main-menu {
        display: none;
    }

    .brand-slot {
        display: contents;
    }

    .menu-toggle {
        display: inline-flex;
        justify-self: start;
        align-items: center;
        justify-content: center;
    }

    .brand {
        grid-column: 2;
        justify-self: center;
    }

    .cart-slot {
        grid-column: 3;
        justify-self: end;
    }

    .logo-media {
        justify-content: center;
    }
}