/* =========================================
   RESET GLOBALE (comune a tutte le pagine)
   ========================================= */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Menu aperto: blocca lo scroll della pagina sotto, senza spostare
   il body (così il pannello copre sempre tutto lo schermo) */
html.menu-aperto,
html.menu-aperto body {
    overflow: hidden;
    overscroll-behavior: none;
}

/* =========================================================
   FOOTER (comune a tutte le pagine)
   ========================================================= */
.site-footer {
    background-color: #111111;
    color: #ffffff;
    padding: 40px 20px 20px;
    margin-top: 40px;
}

.footer-columns {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.footer-brand h3 {
    font-size: 18px;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.footer-brand p {
    font-size: 14px;
    color: #bbbbbb;
    max-width: 320px;
}

.footer-col h4 {
    font-size: 14px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: #bbbbbb;
    font-size: 14px;
}

.footer-col ul li a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-bottom {
    max-width: 1000px;
    margin: 30px auto 0;
    padding-top: 20px;
    border-top: 1px solid #333333;
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: #888888;
}

@media (min-width: 768px) {
    .footer-columns {
        flex-direction: row;
        justify-content: space-between;
    }
    .footer-bottom {
        text-align: left;
    }
}

/* =========================================================
   MODALE GENERICA (usata dal popup "Aggiunto al carrello")
   ========================================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 1000;
}

.modal-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

/* =========================================================
   MODALE "CONFERMI L'ORDINE?" (checkout)
   ========================================================= */
.confirm-order-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.confirm-order-text {
    font-size: 14px;
    color: #444444;
    line-height: 1.5;
    margin-bottom: 20px;
}

.confirm-order-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =========================================================
   POPUP "AGGIUNTO AL CARRELLO"
   ========================================================= */
.added-to-cart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.added-to-cart-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #1a9c4a;
    color: #ffffff;
    font-size: 13px;
    font-weight: bold;
    flex-shrink: 0;
}

.added-to-cart-title {
    font-weight: bold;
    font-size: 16px;
    flex: 1;
}

.added-to-cart-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #757575;
}

.added-to-cart-product {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    text-align: left;
}

.added-to-cart-product img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    background-color: #f5f5f5;
    flex-shrink: 0;
}

.added-to-cart-product h4 {
    font-size: 14px;
    margin-bottom: 3px;
}

.added-to-cart-product p {
    font-size: 13px;
    color: #757575;
    margin-bottom: 2px;
}

.added-to-cart-product .price {
    display: block;
    font-weight: bold;
    font-size: 14px;
    margin-top: 4px;
}

.added-to-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =========================================
   BARRA DI NAVIGAZIONE (comune a tutte le pagine)
   ========================================= */
.navbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 8px 20px;
    background-color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #eaeaea;
    transition: padding 0.25s ease, box-shadow 0.25s ease;
}

/* Quando si scorre la pagina verso il basso, la navbar si
   restringe leggermente e prende un'ombra sottile */
.navbar.scrolled {
    padding: 4px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.logo {
    text-align: center;
    justify-self: center;
}

.logo-img {
    height: 64px;
    width: auto;
    display: block;
    transition: height 0.25s ease;
}

.navbar.scrolled .logo-img {
    height: 46px;
}

.menu-toggle {
    font-size: 24px;
    cursor: pointer;
    display: inline-block;
    justify-self: start;
}

.cart-icon {
    justify-self: end;
}

.cart-icon a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-icon-svg {
    width: 24px;
    height: 24px;
    color: #111111;
}

.cart-icon .cart-count {
    position: absolute;
    top: -7px;
    right: -9px;
    background-color: #111111;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* =========================================================
   PULSANTI TAGLIA (pagina prodotto)
   ========================================================= */
.size-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.size-btn {
    width: 100%;
    height: 44px;
    border: 1px solid #b4b0b0;
    border-radius: 3px;
    color: rgb(33, 31, 31);
    background-color: white;
    font-size: 17px;
    cursor: pointer;
}

/* La taglia selezionata ha solo il bordo più marcato, non lo
   sfondo pieno - come nel selettore taglie di Nike */
.size-btn.selected {
    border: 2px solid #111111;
    font-weight: 600;
    color: black;
}

/* =========================================================
   PULSANTI PRINCIPALI (comuni a tutte le pagine)
   ========================================================= */
.btn {
    display: inline-block;
    background-color: #111111;
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    border: none;
    cursor: pointer;
}

.btn-full {
    width: 100%;
    font-size: 18px;
    padding: 18px;
}

/* Variante bianca/nera di .btn, es. per "Visualizza carrello" */
.btn-outline {
    background-color: #ffffff;
    color: #111111;
    border: 1px solid #111111;
}

/* =========================================================
   STEPPER QUANTITÀ (comune a pagina prodotto e carrello)
   ========================================================= */
.qty-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
    border: 1px solid #111111;
    border-radius: 30px;
    overflow: hidden;
}

.qty-stepper button {
    width: 40px;
    height: 40px;
    background-color: #ffffff;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    color: #111111;
}

.qty-stepper span {
    width: 36px;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
}

/* Versione più piccola, usata nella riga di ogni articolo del carrello */
.qty-stepper-small button {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

.qty-stepper-small span {
    width: 26px;
    font-size: 13px;
}

/* =========================================================
   MENU HAMBURGER
   ========================================================= */
.nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    text-align: left;
    padding: 20px 20px;
    background-color: #ffffff;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.35s ease;
    z-index: 150;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Logo in cima al menu hamburger, stessa immagine/posizione
   (centrata) del logo nella navbar principale */
.nav-menu-logo {
    text-align: center;
    padding-top: 8px;
    margin-bottom: 20px;
}

.nav-menu-logo .logo-img {
    height: 52px;
    width: auto;
    margin: 0 auto;
}

.nav-menu.active {
    transform: translateX(0);
}

.nav-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #111111;
}

.nav-search {
    position: relative;
    margin-bottom: 8px;
}

.nav-search-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: #757575;
    pointer-events: none;
}

.nav-search input {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border: 1px solid transparent;
    background-color: #f4f4f4;
    border-radius: 24px;
    font-size: 15px;
    font-family: inherit;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-search input::placeholder {
    color: #9a9a9a;
}

.nav-search input:focus {
    outline: none;
    background-color: #ffffff;
    border-color: #111111;
}

.nav-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    text-align: left;
    max-height: 240px;
    overflow-y: auto;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.nav-search-results:empty {
    box-shadow: none;
}

.nav-search-result {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    border-bottom: 1px solid #eeeeee;
}

.nav-search-result:last-child {
    border-bottom: none;
}

.nav-search-result:hover {
    background-color: #f4f4f4;
}

.nav-search-empty {
    font-size: 13px;
    color: #757575;
    padding: 10px 14px;
}

/* Categorie principali: righe a tutta larghezza con una riga
   divisoria tra una e l'altra, come in un vero sito e-commerce */
.nav-categories {
    list-style: none;
    margin-bottom: 8px;
}

.nav-categories li {
    border-bottom: 1px solid #eaeaea;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.nav-categories a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 4px;
    font-weight: bold;
    font-size: 24px;
    letter-spacing: 0.3px;
}

.nav-category-arrow {
    display: flex;
    align-items: center;
    color: #b4b0b0;
}

.nav-category-arrow svg {
    width: 18px;
    height: 18px;
}

/* Effetto "a cascata": ogni voce di menu appare con un piccolo
   ritardo rispetto alla precedente, invece di comparire tutte insieme */
.nav-menu.active .nav-categories li {
    opacity: 1;
    transform: translateY(0);
}

.nav-menu.active .nav-categories li:nth-child(1) { transition-delay: 0.05s; }
.nav-menu.active .nav-categories li:nth-child(2) { transition-delay: 0.1s; }
.nav-menu.active .nav-categories li:nth-child(3) { transition-delay: 0.15s; }

/* Contatore articoli accanto a "Carrello" (visibile anche con 0) */
.nav-menu-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-left: 10px;
    padding: 0 6px;
    border-radius: 11px;
    background-color: #111111;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0;
    vertical-align: middle;
}

/* Marche: griglia a due colonne di riquadri */
.nav-section-title {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #757575;
    margin: 22px 4px 12px;
}

.nav-brands {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

.nav-brand {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px;
    background-color: white;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    line-height: 1.25;
    text-transform: uppercase;
}

/* Foto della marca: nascosta finché non è stata caricata */
.nav-brand-img {
    display: none;
    width: 100%;
    height: 110px;
    object-fit: contain;
    background-color: #ffffff;
    border-radius: 6px;
}

.nav-brand-img.caricata {
    display: block;
}

/* Blocco fiducia + contatti in fondo al menu */
.nav-trust {
    background-color: #f4f4f4;
    border-radius: 12px;
    padding: 18px;
    margin: 24px 0 8px;
}

.nav-trust-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-trust-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #222222;
}

.nav-trust-list svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: none;
    stroke: #111111;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-trust-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #dddddd;
    font-size: 13px;
    color: #555555;
}
