/* ========================================
   RESET E BASE
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Sticky footer con flexbox */
form {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding-top: 80px;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
    margin-top: 0; /* rimuove margine superfluo */
}

/* Container principale */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    padding-top: 0;
}

.featured {
    padding: 2rem 2rem 4rem;  /* già presente, eventualmente aumenta il padding-bottom */
    margin-bottom: 2rem;      /* aggiungi margine inferiore */
}

/* ========================================
   HEADER (DESKTOP FIRST)
======================================== */
/* Header fisso con transizione */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: #1a1a2e;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background 0.3s, backdrop-filter 0.3s;
}

/* Classe per header trasparente durante lo scroll */
header.header-transparent {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(5px);
}

.logo h1 a {
    color: #f72585;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 700;
}

.main-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}
.main-nav a:hover {
    color: #f72585;
}

/* Allinea verticalmente le icone dell'header */
.header-icons {
    display: flex;
    align-items: center;  /* Centra verticalmente tutti gli elementi */
    gap: 1rem;            /* Mantieni lo spazio tra le icone */
}

.user-dropdown,
.cart-summary {
    display: flex;
    align-items: center;
    line-height: 1;        /* Azzera altezza di linea extra */
}

.user-dropdown .dropdown-toggle,
.cart-summary .cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;     /* Forza la stessa dimensione */
    height: 24px;           /* Altezza fissa per uniformità */
    width: 24px;            /* Larghezza fissa */
    padding: 0;
    background: none;
    border: none;
    color: white;
}

/* Se l'icona del carrello ha un wrapper, assicurati che anche quello sia centrato */
.cart-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-icon a,
.cart-icon {
    color: white;
    font-size: 1.5rem; /* stessa dimensione per entrambe */
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Badge carrello */
.cart-icon-wrapper {
    position: relative;
    display: inline-block;
}
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f72585;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ========================================
   MOBILE (max-width: 768px)
======================================== */
@media (max-width: 768px) {
    header {
        padding: 1rem;
        flex-wrap: wrap;
    }

    .hamburger {
        display: block;
        order: 1;
        font-size: 1.8rem;
        cursor: pointer;
        color: white;
    }

    .logo {
        order: 2;
        flex: 1;
        text-align: center;
    }

    .header-icons {
        order: 3;
        gap: 0.8rem;
    }

    .main-nav {
        display: none;
        order: 4;
        width: 100%;
        margin-top: 1rem;
        background: #1a1a2e;
        padding: 1rem;
    }

    #menu-toggle:checked ~ .main-nav {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    .main-nav li {
        border-bottom: 1px solid #444;
    }
    .main-nav li:last-child {
        border-bottom: none;
    }
    .main-nav a {
        display: block;
        padding: 1rem;
        font-size: 1.2rem;
    }
    .main-nav a:hover {
        background: #f72585;
        color: white;
    }

    /* Mostra link mobili */
    .mobile-only {
        display: block;
    }

    /* Regola badge per mobile */
    .cart-badge {
        top: -6px;
        right: -6px;
        min-width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
}

/* Nasconde link mobili su desktop */
@media (min-width: 769px) {
    .mobile-only {
        display: none;
    }
}

/* ========================================
   MENU HAMBURGER (solo mobile)
======================================== */
.menu-toggle {
    display: none;
}

.hamburger {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: white;
    order: 1;
}

/* Placeholder per menu mobile (visibili solo su mobile) */
#phLoginMobile, #phLogoutMobile {
    display: none; /* default nascosti, gestiti da server */
}

/* ========================================
   HERO SECTION (a tutta larghezza)
======================================== */
.hero {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 6rem 2rem;
    margin-bottom: 3rem;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.hero .btn {
    background: #f72585;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
    display: inline-block;
}

.hero .btn:hover {
    background: #e94560;
}

/* ========================================
   COMPONENTI COMUNI
======================================== */
/* Titoli sezione */
.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #1a1a2e;
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: #f72585;
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* Bottoni */
.btn {
    background: #f72585;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #e94560;
}

.btn-secondary {
    background: #4cc9f0;
}

.btn-secondary:hover {
    background: #3aa8d0;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #1a1a2e;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #f72585;
    box-shadow: 0 0 0 3px rgba(247,37,133,0.1);
}

/* Layout a due colonne per form */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group.half {
    flex: 1;
}

/* Pagine utente (login, registrazione, profilo) */
.user-page {
    max-width: 600px;
    margin: 3rem auto;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.user-page h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #1a1a2e;
}

/* Tabelle (carrello, ordini) */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.cart-table th {
    background: #1a1a2e;
    color: white;
    padding: 1rem;
    text-align: left;
}

.cart-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.cart-table tr:last-child td {
    border-bottom: none;
}

.cart-table input[type="text"] {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
}

.cart-table .btn {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

.cart-total {
    font-size: 1.5rem;
    text-align: right;
    margin: 2rem 0;
}

.cart-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* ========================================
   PRODOTTI EVIDENZA HOME
======================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.product-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.product-card:hover img {
    transform: scale(1.05);
}
.sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #f72585;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 2;
}
.product-info {
    padding: 1rem 1.5rem;
}
.product-info h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}
.price-container {
    margin-bottom: 0.5rem;
}
.old-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 0.5rem;
}
.sale-price {
    color: #dc3545;
    font-weight: bold;
}
.price {
    font-weight: bold;
    color: #f72585;
}
.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem 1.5rem 1.5rem;
    margin-top: auto;        /* spinge il footer in basso */
    border-top: 1px solid #eee;
}
.product-details-link {
    color: #f72585;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.product-details-link:hover {
    text-decoration: underline;
    transform: translateX(3px);
}
.add-to-cart-icon {
    font-size: 1.2rem;
    color: #f72585;
    text-decoration: none;
    transition: color 0.3s, transform 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
}
.add-to-cart-icon:hover {
    color: #e94560;
    transform: scale(1.1);
}
/* ========================================
   PAGINA PRODOTTO
======================================== */
.product-detail {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: pointer;
}

.thumbnail-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: border-color 0.3s;
    cursor: pointer;
}

.thumbnail:hover {
    border-color: #f72585;
}

.product-info {
    padding: 20px;
}

.product-info h1 {
    font-size: 2.5rem;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.price-container {
    margin: 15px 0;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 1rem;
    margin-right: 10px;
}

.sale-price {
    color: #dc3545;
    font-size: 1.8rem;
    font-weight: bold;
}

.price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #f72585;
}

.product-conditions, .product-availability, .product-features, .product-measures, .product-description, .product-additional {
    margin: 10px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.product-conditions strong, .product-availability strong, .product-features strong, .product-measures strong, .product-description strong, .product-additional strong {
    color: #1a1a2e;
    display: block;
    margin-bottom: 5px;
}

.quantity-selector {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-selector label {
    font-weight: 500;
    color: #1a1a2e;
    margin-bottom: 0;
}

.quantity-selector .form-control {
    width: auto;
    display: inline-block;
}

/* Sezione extra (descrizione, info) a due colonne */
.product-extras {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
    padding: 0 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.extra-column {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
}

.extra-column h3 {
    color: #1a1a2e;
    font-size: 1.3rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #f72585;
    padding-bottom: 8px;
}

.extra-content {
    line-height: 1.8;
    color: #555;
}

/* ========================================
   CHECKBOX PERSONALIZZATE
======================================== */
.invoice-checkbox, .shipping-checkbox {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: #1a1a2e;
    position: relative;
    padding-left: 2rem;
    min-height: 2rem;
}

.invoice-checkbox input[type="checkbox"],
.shipping-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
    margin: 0;
}

.invoice-checkbox .checkmark,
.shipping-checkbox .checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 1.25rem;
    width: 1.25rem;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1;
}

.invoice-checkbox:hover .checkmark,
.shipping-checkbox:hover .checkmark {
    border-color: #f72585;
}

.invoice-checkbox input:checked ~ .checkmark,
.shipping-checkbox input:checked ~ .checkmark {
    background-color: #f72585;
    border-color: #f72585;
}

.invoice-checkbox .checkmark:after,
.shipping-checkbox .checkmark:after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    display: none;
    color: white;
    font-size: 0.8rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.invoice-checkbox input:checked ~ .checkmark:after,
.shipping-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.invoice-checkbox label,
.shipping-checkbox label {
    margin-left: 0.5rem;
    cursor: pointer;
    z-index: 1;
    position: relative;
    pointer-events: none;
}

/* Pannelli fatturazione/spedizione */
.billing-section, .shipping-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.billing-section h3, .shipping-section h3 {
    margin-top: 0;
    color: #1a1a2e;
    border-bottom: 2px solid #f72585;
    padding-bottom: 8px;
    margin-bottom: 20px;
}

/* ========================================
   FOOTER
======================================== */
footer {
    background: #1a1a2e;
    color: white;
    padding: 3rem 2rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #f72585;
}

.footer-section p, .footer-section a {
    color: #ccc;
    text-decoration: none;
    line-height: 2;
}

.footer-section a:hover {
    color: #f72585;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #444;
    color: #aaa;
}

/* ========================================
   RESPONSIVE MOBILE
======================================== */
@media (max-width: 768px) {
    header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
    }

    .hamburger {
        display: block;
        order: 1; /* hamburger a sinistra */
        font-size: 1.8rem;
        cursor: pointer;
        color: white;
    }

    .logo {
        order: 2; /* logo al centro */
        flex: 1;
        text-align: center;
    }

    .mobile-user-icon {
        order: 3; /* icona utente a destra (prima del carrello) */
        margin-right: 10px;
    }

    .mobile-user-icon a {
        color: white;
        font-size: 1.5rem;
        text-decoration: none;
    }

    .cart-summary {
        order: 4; /* carrello a destra */
    }

    .header-right {
        display: none; /* nasconde l'area desktop su mobile */
    }

    .main-nav {
        position: absolute;
        top: 100%; /* si posiziona subito sotto l'header */
        left: 0;
        width: 100%;
        height: calc(100vh - 100%); /* occupa il resto della viewport */
        background: rgba(26, 26, 46, 0.95); /* semi-trasparente */
        backdrop-filter: blur(5px); /* effetto sfocato (opzionale) */
        padding: 2rem 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 1000;
        display: none;
        overflow-y: auto; /* se il menu è lungo, si scrolla */
    }

    #menu-toggle:checked ~ .main-nav {
        display: block;
    }

    .main-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
        flex-direction: column;
    }

    .main-nav li {
        border-bottom: 1px solid #444;
    }

    .main-nav li:last-child {
        border-bottom: none;
    }

    .main-nav a {
        display: block;
        padding: 1rem;
        color: white;
        text-decoration: none;
        font-size: 1.2rem;
    }

    .main-nav a:hover {
        background: #f72585;
        color: white;
    }

    /* Stili pagina prodotto su mobile (già presenti, eventualmente li integri) */
    .product-detail {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0;
    }
    .product-gallery {
        width: 100%;
        margin: 0;
    }
    .main-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        border-radius: 0;
    }
    .thumbnail-list {
        justify-content: center;
        margin-top: 10px;
        padding: 0 10px;
    }
    .thumbnail {
        width: 70px;
        height: 70px;
    }
    .product-info {
        padding: 0 15px;
    }
    .product-info h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    .price-container {
        margin: 10px 0;
    }
    .price, .sale-price {
        font-size: 1.8rem;
    }
    .product-extras {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 20px;
        padding: 0 15px;
    }
    .extra-column {
        padding: 15px;
    }
    .quantity-selector {
        margin: 15px 0;
        justify-content: flex-start;
        padding: 0 15px;
    }
}

/* Nasconde elementi mobile su desktop */
@media (min-width: 769px) {
    .mobile-user-icon {
        display: none;
    }
    .main-nav .mobile-only {
        display: none;
    }
}

/* ========================================
   UTILITY
======================================== */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* Wrapper per posizionare il badge */
.cart-icon-wrapper {
    position: relative;
    display: inline-block;
}

/* Icona carrello senza sfondo */
.cart-icon {
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    background: none !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Badge notifica */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f72585; /* colore magenta */
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    line-height: 1;
    font-family: sans-serif;
}

/* Rimuovi eventuali stili precedenti del carrello */
.cart-summary a {
    background: none !important;
    padding: 0 !important;
}

/* Su mobile, se vuoi ridimensionare leggermente */
@media (max-width: 768px) {
    .cart-icon {
        font-size: 1.4rem;
    }
    .cart-badge {
        top: -6px;
        right: -6px;
        min-width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
}

.mobile-icons {
    order: 3; /* posiziona il gruppo a destra */
    display: flex;
    align-items: center;
    gap: 8px;  /* spazio tra le icone (regolabile) */
    margin-right: 0;
}

.mobile-user-icon {
    margin-right: 0; /* elimina eventuali margini precedenti */
}

.cart-summary {
    order: unset;  /* toglie l'order precedente, ora è dentro il flex */
}

/* Assicura che le icone non abbiano margini extra */
.mobile-user-icon a,
.cart-summary a {
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 1.4rem;  /* dimensione uniforme */
}

.user-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-width: 180px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
    color: #f72585;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}

/* Mostra dropdown quando attivo (gestito da JS) */
.user-dropdown.active .dropdown-menu {
    display: block;
}

/* ========================================
   TABELLE RESPONSIVE (CARD LAYOUT)
======================================== */
@media (max-width: 768px) {
    /* Trasforma la tabella in blocchi */
    .cart-table tr {
        display: block;
    }

    /* Stile per l'etichetta mobile */
    .mobile-label {
        font-weight: bold;
        color: #1a1a2e;
        margin-right: 1rem;
    }
    
}

/* Su desktop, nasconde le etichette mobili */
@media (min-width: 769px) {
    .mobile-label {
        display: none;
    }
}

/* Stili per le card degli ordini */
.order-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.order-row:last-child {
    border-bottom: none;
}

.order-label {
    font-weight: bold;
    color: #1a1a2e;
}

.order-value {
    color: #555;
}

/* Su desktop, se vuoi le card più larghe e centrate */
@media (min-width: 769px) {
    .order-card {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

.empty-message {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.2rem;
}

/* Card del carrello */
.cart-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.cart-row:last-child {
    border-bottom: none;
}

.cart-label {
    font-weight: bold;
    color: #1a1a2e;
}

.cart-value {
    color: #555;
}

.cart-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-input {
    width: 70px !important;
    text-align: center;
}

.cart-actions {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
    justify-content: flex-end;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

.cart-total {
    font-size: 1.5rem;
    text-align: right;
    margin: 2rem 0;
    font-weight: bold;
    color: #1a1a2e;
}

.empty-message {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.2rem;
}

/* Su desktop, se vuoi le card più larghe e centrate */
@media (min-width: 769px) {
    .cart-card {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

.cart-iva {
    text-align: right;
    font-size: 0.9rem;
    color: #666;
    margin-top: -2.0rem;
    margin-bottom: 1.5rem;
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
}
.sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #f72585;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.product-details-arrow {
    display: inline-block;
    margin-top: 10px;
    color: #f72585;
    font-size: 1.2rem;
    transition: transform 0.3s;
}
.product-card:hover .product-details-arrow {
    transform: translateX(5px);
}

.coupon-section {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}
.coupon-section .form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.coupon-section .form-group {
    flex: 1;
    margin-bottom: 0;
}
.coupon-section .btn {
    white-space: nowrap;
}
.coupon-message {
    margin-top: 10px;
    font-size: 0.9rem;
}
.coupon-message.success {
    color: green;
}
.coupon-message.error {
    color: red;
}
.cart-discount {
    font-size: 1.2rem;
    text-align: right;
    color: #dc3545;
    margin: 10px 0;
}

.cart-discount {
    font-size: 1.2rem;
    text-align: right;
    color: #dc3545;
    margin: 10px 0;
}

.cart-subtotal, .cart-discount, .cart-shipping {
    font-size: 1.2rem;
    text-align: right;
    margin: 5px 0;
}
.cart-discount {
    color: #dc3545;
}
.cart-shipping {
    color: #28a745;
}
.shipping-section {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}
.shipping-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.shipping-options input[type="radio"] {
    margin-right: 10px;
}

/* Overlay di caricamento */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;          /* Importante: deve essere none */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    text-align: center;
    color: white;
    flex-direction: column;
}

.loading-overlay .spinner {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay .message {
    font-size: 1.2rem;
    background: rgba(0,0,0,0.5);
    padding: 0.5rem 1rem;
    border-radius: 30px;
}

/* Responsive per i pulsanti del carrello */
@media (max-width: 768px) {
    .cart-actions {
        flex-direction: column;
        gap: 10px;
    }
    .cart-actions .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .cart-table,
    .cart-table thead,
    .cart-table tbody,
    .cart-table tr,
    .cart-table th,
    .cart-table td {
        display: block;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tr {
        margin-bottom: 1rem;
        border: none;               /* elimina il bordo della riga */
        background: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* leggera ombra al posto del bordo */
        border-radius: 8px;
        padding: 0;
    }

    .cart-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #eee;
    }

    .cart-table td:last-child {
        border-bottom: none;
    }

    .cart-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #1a1a2e;
        margin-right: 1rem;
    }

    .cart-table {
        border: none;
    }
}

/* Allineamento pulsanti di scelta */
.checkout-options {
    text-align: center;
    margin: 2rem 0;
}
.checkout-options h3 {
    margin-bottom: 1.5rem; /* aumenta lo spazio sotto il titolo */
}
.checkout-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.checkout-buttons .btn {
    min-width: 180px;
}

/* Link "Continua con gli acquisti" */
.continue-shopping {
    margin-top: 1.5rem;
    text-align: center;
}
.continue-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #f72585;
    text-decoration: none;
    font-weight: 500;
    transition: gap 0.2s;
}
.continue-link:hover {
    gap: 12px;
    text-decoration: underline;
}
.continue-link i {
    font-size: 0.9rem;
    transition: transform 0.2s;
}
.continue-link:hover i {
    transform: translateX(3px);
}

/* Responsive mobile */
@media (max-width: 768px) {
    .checkout-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }
    .checkout-buttons .btn {
        width: 100%;
        text-align: center;
    }
    .continue-shopping {
        margin-top: 2rem;
    }
}

.profile-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.delete-link {
    color: #dc3545;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.delete-link:hover {
    color: #c82333;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .profile-actions {
        flex-direction: column;
        gap: 1rem;
    }
    .delete-link {
        align-self: flex-end;
    }
}

/* ========================================
   CAROSELLO HERO
======================================== */
.hero-carousel {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: calc(100vh - 80px);
    overflow: hidden;
    margin-bottom: 0;
}

.slides-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Overlay scuro */
.slide-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1;
}

.slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 20px;
}

.slide-content h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.slide-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
    .slide-content h2 {
        font-size: 2rem;
    }
    .slide-content p {
        font-size: 1rem;
    }
    .hero-carousel {
    height: calc(100vh - 70px);
    }
}

/* Puntini */
.carousel-dots {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 30;
    background: rgba(0,0,0,0.5);
    padding: 8px 15px;
    border-radius: 30px;
    backdrop-filter: blur(4px);
}

.dot {
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.dot.active {
    background: #f72585;
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .slide-content h2 {
        font-size: 2rem;
    }
    .slide-content p {
        font-size: 1rem;
    }
    .carousel-dots {
        bottom: 30px;
        padding: 5px 12px;
        gap: 8px;
    }
    .dot {
        width: 10px;
        height: 10px;
    }
}

/* Notifiche personalizzate */
.custom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.custom-notification.show {
    transform: translateX(0);
}

.custom-notification.success {
    background: #28a745;
}

.custom-notification.error {
    background: #dc3545;
}

.custom-notification.warning {
    background: #ffc107;
    color: #333;
}

.custom-notification.info {
    background: #17a2b8;
}

.custom-notification i {
    font-size: 1.2rem;
}

/* Su mobile, posizionamento al centro in alto */
@media (max-width: 768px) {
    .custom-notification {
        top: 70px;
        right: 50%;
        transform: translateX(50%) translateX(120%);
        white-space: nowrap;
        font-size: 0.9rem;
    }
    .custom-notification.show {
        transform: translateX(50%) translateX(0);
    }
}