/* ONE SERVICE GROUP - OFFICIAL BRAND IDENTITY THEME */
:root {
    --primary-color: #1e242b;       /* Grafite / Dark Charcoal OSG */
    --accent-color: #d9232a;        /* Rosso Ufficiale One Service Group */
    --accent-hover: #b91c1c;        /* Rosso Scuro Hover */
    
    /* Palette Ufficiale 6 Macro Categorie (Manuale Brand) */
    --color-frozen: #0a71b4;        /* 1 - CONGELATO (Ocean Blue) */
    --color-fresh: #6cc9f0;         /* 2 - FRESCO (Sky Blue) */
    --color-secco: #cb8e27;         /* 3 - SECCO (Golden Ochre) */
    --color-wines: #872142;         /* 4 - VINI (Burgundy Red) */
    --color-beverage: #19a855;      /* 5 - BEVERAGE (Emerald Green) */
    --color-cleaning: #8877b5;      /* 6 - CARTA/DET (Cleaning Purple) */

    --bg-body: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #0f172a;
    --text-gray: #475569;
    --border-light: #e2e8f0;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
    --font-main: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.5;
}

/* HEADER SUPERIORE (Logo e Ricerca) */
header {
    background-color: var(--bg-white);
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo-container img {
    height: 140px;
    /* Logo più grande */
    object-fit: contain;
}

/* BARRA DI RICERCA ZONA STYLE */
.search-wrapper {
    flex: 1;
    max-width: 800px;
    min-width: 350px;
    position: relative;
    width: 100%;
}

.search-container {
    display: flex;
    align-items: center;
    background: #f0f0f0;
    border-radius: 6px;
    padding: 0 8px 0 14px;
    border: 1px solid #ddd;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.search-container:focus-within {
    border-color: #0080ff;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 128, 255, 0.15);
}

.search-container input {
    flex: 1 1 auto;
    width: 100%;
    border: none;
    background: transparent;
    padding: 12px 8px;
    font-size: 15px;
    color: #333;
    outline: none;
    min-width: 0;
    box-sizing: border-box;
}

.search-container button {
    background: transparent;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
}

/* NAVBAR NERA */
.nav-strip {
    background-color: var(--primary-color);
    color: white;
    padding: 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 50px;
    justify-content: center !important;
}

.btn-assortimento {
    background-color: #333;
    /* Grigio scuro per stacco */
    color: white;
    border: none;
    height: 50px;
    padding: 0 25px;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.nav-links {
    display: flex;
    gap: 40px !important;
    margin-left: 0 !important;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 10px;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* CART ICON */
.cart-icon-container {
    position: relative;
    cursor: pointer;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary-color);
}

.cart-icon-container svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-color);
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* PRODUCTS GRID */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.products-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    justify-content: flex-start;
    /* Ensure items start from left */
}

/* PRODUCT CARD - MODERN ACCELERATED & WARM LIST STYLE */
.product-card {
    width: 100%;
    flex: 1 1 400px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -4px rgba(0, 0, 0, 0.03);
    border-color: #cbd5e1;
    z-index: 1;
}

.product-card:hover .product-image {
    transform: none;
}

/* Clean Product Image - Left Side */
.product-image {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    margin-bottom: 0;
    margin-right: 16px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.04);
}

.product-info {
    padding: 2px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.product-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.3px;
}

.product-code-badge .badge-label {
    color: #64748b;
    font-weight: 600;
}

.product-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto;
    transition: color 0.15s ease;
}

.product-name:hover {
    color: var(--accent-color, #e31e24);
}

/* Breadcrumb interattivo "Ti trovi in" */
.product-crumb-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 12px;
    color: #334155;
    margin-top: 2px;
    margin-bottom: auto;
    background: #f8fafc;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    font-weight: 500;
    line-height: 1.4;
}

.crumb-lead {
    color: var(--accent-color, #e31e24);
    font-weight: 700;
    font-size: 11px;
    margin-right: 2px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.crumb-cat-btn,
.crumb-subcat-btn {
    color: #1e293b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 4px;
    padding: 1px 5px;
}

.crumb-cat-btn:hover,
.crumb-subcat-btn:hover {
    color: var(--accent-color, #e31e24);
    background: #fee2e2;
    text-decoration: underline;
}

.crumb-sep {
    color: #94a3b8;
    font-weight: bold;
    margin: 0 1px;
}

/* Riga Inferiore Azioni */
.product-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    gap: 10px;
}

.unit-iva-box {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.unit-iva-box b {
    color: #0f172a;
    font-weight: 700;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.dot-sep {
    color: #cbd5e1;
    font-weight: bold;
}

/* Pulsante Compatto Accedi per i prezzi (non più gigante) */
.btn-lock-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff5f5;
    color: var(--accent-color, #e31e24);
    border: 1.5px solid var(--accent-color, #e31e24);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(227, 30, 36, 0.08);
    white-space: nowrap;
}

.btn-lock-compact:hover {
    background: var(--accent-color, #e31e24);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.25);
}

.btn-lock-compact .lock-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.btn-lock-compact:hover .lock-icon {
    transform: scale(1.15);
}

/* BANNER STATO PROFILO (UNIFICATO PER PRIVATI E AZIENDE B2B) */
.profile-header-banner,
.b2b-header-banner {
    color: #ffffff;
    border-radius: 12px;
    padding: 12px 18px;
    margin: 15px 0 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
    gap: 10px;
    transition: all 0.3s ease;
}

/* Versione B2B / Aziende - Tema Blu Oceano Brand Book */
.banner-b2b,
.b2b-header-banner {
    background: linear-gradient(90deg, #084c7a 0%, #0a71b4 100%) !important;
    border: 1.5px solid #085a90 !important;
    box-shadow: 0 4px 16px rgba(10, 113, 180, 0.22) !important;
}

.banner-b2b .profile-badge,
.banner-b2b .b2b-badge,
.b2b-header-banner .b2b-badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.banner-b2b .profile-tag-right,
.banner-b2b .b2b-tag-right,
.b2b-header-banner .b2b-tag-right {
    background: #ffffff !important;
    color: #0a71b4 !important;
    font-weight: 800;
    font-size: 12px;
    padding: 5px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Versione Privati (B2C) - Tema Verde Smeraldo Brand Book */
.banner-b2c {
    background: linear-gradient(90deg, #0e6333 0%, #19a855 100%) !important;
    border: 1.5px solid #148744 !important;
    box-shadow: 0 4px 16px rgba(25, 168, 85, 0.22) !important;
}

.banner-b2c .profile-badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.banner-b2c .profile-tag-right {
    background: #ffffff !important;
    color: #19a855 !important;
    font-weight: 800;
    font-size: 12px;
    padding: 5px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.btn-pdf {
    font-size: 11px;
    margin-left: auto;
    text-decoration: none;
    color: white;
    /* White text */
    background: #000000;
    /* Black background */
    border: 1px solid #000000;
    padding: 2px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s;
    opacity: 1;
}

.btn-pdf:hover {
    background: #333333;
    /* Dark gray */
    color: white;
    border-color: #333333;
}

.btn-pdf:hover {
    opacity: 1;
}

/* PRICE BLOCK */
.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 10px;
}

.price-main {
    font-size: 20px;
    /* Adjusted for compact view */
    font-weight: 700;
    color: #0F1111;
}

/* Simulate superscript if needed, but simple flex is ok */

.price-iva {
    font-size: 11px;
    color: #767676;
}

.product-price-total {
    font-size: 11px;
    color: #565959;
    margin-bottom: 8px;
}

/* BADGE DISPONIBILITA' DINAMICO */
.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1.2;
    transition: all 0.2s ease;
    user-select: none;
    font-family: inherit;
    border: 1px solid transparent;
    outline: none;
}

.stock-badge.in-stock {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.stock-badge.out-of-stock {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.stock-badge.out-of-stock:hover {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.22);
}

.stock-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.stock-dot.in-stock {
    background-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.stock-dot.out-of-stock {
    background-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.94) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ACTIONS */
.product-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* QUANTITY SPINNER & ADD BUTTON */
.qty-spinner {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    /* Smooth rounded corners */
    overflow: hidden;
    height: 36px;
}

.qty-input {
    width: 40px;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    -moz-appearance: textfield;
    /* Remove default arrows Firefox */
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    /* Remove default arrows Chrome */
    margin: 0;
}

.qty-nav {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #ddd;
    width: 20px;
}

.qty-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    cursor: pointer;
    font-size: 8px;
    color: #555;
    transition: background 0.2s;
}

.qty-button:hover {
    background: #e0e0e0;
}

.qty-up {
    border-bottom: 1px solid #ddd;
}


/* PULSANTI AGGIUNGI CARRELLO & CHECKOUT (Privati: Verde #19a855 / B2B: Blu #0a71b4) */
.btn-add-cart {
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    height: 38px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    font-size: 13px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    color: #000000 !important; /* Scritta Aggiungi Nera */
}

/* Stile Privati (B2C) - Verde Smeraldo Ufficiale Brand Book con Scritta Nera */
.btn-user-b2c,
body.user-b2c .btn-add-cart,
body.user-b2c .btn-modal-add,
body:not(.user-b2b) .btn-add-cart:not(.btn-user-b2b) {
    background: #19a855 !important;
    background-color: #19a855 !important;
    color: #000000 !important;
    box-shadow: 0 2px 8px rgba(25, 168, 85, 0.25) !important;
}

body.user-b2c .btn-checkout {
    background: #19a855 !important;
    background-color: #19a855 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(25, 168, 85, 0.25) !important;
}

.btn-user-b2c:hover,
body.user-b2c .btn-add-cart:hover,
body.user-b2c .btn-modal-add:hover,
body:not(.user-b2b) .btn-add-cart:not(.btn-user-b2b):hover {
    background: #148744 !important;
    background-color: #148744 !important;
    color: #000000 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 168, 85, 0.35) !important;
}

body.user-b2c .btn-checkout:hover {
    background: #148744 !important;
    background-color: #148744 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 168, 85, 0.35) !important;
}

/* Stile B2B / Grossisti - Blu Oceano Ufficiale Brand Book */
.btn-user-b2b,
body.user-b2b .btn-add-cart,
body.user-b2b .btn-checkout,
body.user-b2b .btn-modal-add {
    background: #0a71b4 !important;
    background-color: #0a71b4 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(10, 113, 180, 0.25) !important;
}

.btn-user-b2b:hover,
body.user-b2b .btn-add-cart:hover,
body.user-b2b .btn-checkout:hover,
body.user-b2b .btn-modal-add:hover {
    background: #085a90 !important;
    background-color: #085a90 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 113, 180, 0.35) !important;
}

/* CATEGORY MENU - MODERN GRID (Wordpress Style) */
.menu-nav-container {
    background: transparent;
    padding: 0;
    box-shadow: none;
    margin-bottom: 40px;
}

.menu-section-title {
    color: var(--primary-color) !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 25px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.flex-wrap-gap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    justify-content: center;
}

.btn-macro {
    background: white !important;
    border: none !important;
    border-radius: 12px;
    color: var(--text-dark) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    min-height: 160px;
    position: relative;
    overflow: hidden;
}

.btn-macro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: height 0.3s;
}

.btn-macro:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.btn-macro.attivo {
    background: white !important;
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Icon Styles */
.macro-icon {
    font-size: 40px;
    margin-bottom: 15px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.03);
    transition: background 0.3s;
}

.btn-macro:hover .macro-icon {
    background: rgba(0, 0, 0, 0.06);
}

.macro-name {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
    color: #333;
    text-align: center;
}

.macro-count {
    font-size: 11px;
    color: #888;
    background: #f4f4f4;
    padding: 2px 8px;
    border-radius: 10px;
}

/* SFONDO DINAMICO PATTERN DIETRO ALLA PAGINA DELLE CATEGORIE */
body {
    transition: background-color 0.45s ease;
}

body.has-category-bg #watermark-logo-container {
    display: none !important;
}

body.has-category-bg .menu-section-title {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85) !important;
}

body.has-category-bg #livello-2-categorie {
    border-top: 1px solid rgba(255, 255, 255, 0.18) !important;
}

body.has-category-bg #livello-3-sottocategorie {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4) !important;
}

body.has-category-bg #breadcrumb-filtri {
    background: rgba(255, 255, 255, 0.94) !important;
    padding: 6px 16px !important;
    border-radius: 20px !important;
    display: inline-block !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
}

/* GRIGLIA & CARTE CATEGORIE LIVELLO 2 E LIVELLO 3 (Stile Identico alle Macro Categorie) */
#lista-categorie,
#lista-sottocategorie {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 15px !important;
}

.btn-categoria,
.btn-sottocategoria {
    background: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    color: var(--text-dark, #1e242b) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 25px 15px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    height: 100% !important;
    min-height: 160px !important;
    position: relative !important;
    overflow: hidden !important;
    text-align: center !important;
    outline: none !important;
}

.btn-categoria:hover,
.btn-sottocategoria:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.btn-categoria.attivo,
.btn-sottocategoria.attivo {
    background: #ffffff !important;
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
}

.cat-icon {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 15px !important;
    transition: background 0.3s, transform 0.3s !important;
    flex-shrink: 0 !important;
}

.btn-categoria:hover .cat-icon,
.btn-sottocategoria:hover .cat-icon {
    transform: scale(1.08) !important;
}

.cat-name {
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    margin-bottom: 5px !important;
    color: #333333 !important;
    text-align: center !important;
    line-height: 1.25 !important;
    word-break: break-word !important;
}

.cat-count {
    font-size: 11px !important;
    color: #888888 !important;
    background: #f4f4f4 !important;
    padding: 2px 8px !important;
    border-radius: 10px !important;
    border: none !important;
    margin-top: 2px !important;
}

/* CARRELLO MODALE */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: flex-end;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    height: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
}

.cart-item {
    background: white;
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    /* Add gap between elements */
}

.cart-item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-info {
    flex: 1;
    /* Allow info to take remaining space */
}

.cart-footer {
    background: white;
    padding: 20px;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.cart-total {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: right;
}

.btn-checkout {
    width: 100%;
    background: var(--accent-color, #0a71b4);
    color: white !important;
    padding: 14px 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toast {
    background: white;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* MOBILE OPTIMIZATION */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 12px;
        padding: 12px 15px;
    }

    .logo-container img {
        height: 60px;
        max-width: 180px;
        object-fit: contain;
    }

    .search-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .search-container {
        padding: 6px 12px;
    }

    .search-container input {
        font-size: 14px;
        padding: 8px 6px;
    }

    .user-actions {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 12px;
    }

    #user-logged-out {
        width: 100%;
        justify-content: center;
    }

    .nav-strip .nav-container {
        padding: 0 10px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        height: 44px;
    }

    .nav-strip .nav-container::-webkit-scrollbar {
        display: none;
    }

    .nav-links {
        display: flex !important;
        gap: 12px !important;
        overflow-x: auto;
        white-space: nowrap;
        padding: 0 5px;
        width: 100%;
        justify-content: center;
    }

    .nav-links a {
        padding: 6px 8px;
        font-size: 13px;
    }

    .btn-assortimento {
        padding: 0 12px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .products-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .product-card {
        width: 100%;
        max-width: none;
        padding: 10px;
        display: flex;
        flex-direction: column;
    }

    .product-image {
        height: 120px;
        padding: 5px;
    }

    .product-image img {
        max-height: 100%;
        object-fit: contain;
    }

    .product-info {
        padding: 5px 0 0 0;
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .product-name {
        font-size: 13px;
        line-height: 1.3;
        height: 36px;
        overflow: hidden;
        margin-bottom: 6px;
    }

    .price-main {
        font-size: 16px;
    }

    .btn-add-cart {
        font-size: 12px;
        padding: 6px 10px;
    }

    .btn-lock-price {
        font-size: 11px !important;
        padding: 7px 8px !important;
    }

    /* Menu Categorie Mobile */
    .menu-nav-container {
        padding: 10px;
    }

    /* Griglia Macro-categorie in 2 colonne su smartphone */
    .flex-wrap-gap {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .btn-macro {
        min-height: 110px !important;
        padding: 8px !important;
    }

    .macro-icon {
        font-size: 24px;
        width: 40px;
        height: 40px;
    }

    .macro-name {
        font-size: 11px;
        font-weight: bold;
    }

    .macro-count {
        font-size: 10px !important;
    }

    /* Griglia Categorie e Sottocategorie Mobile */
    #lista-categorie,
    #lista-sottocategorie {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .btn-categoria,
    .btn-sottocategoria {
        min-height: 110px !important;
        padding: 12px 6px !important;
    }

    .cat-icon {
        width: 38px !important;
        height: 38px !important;
        margin-bottom: 6px !important;
    }

    .cat-name {
        font-size: 11px !important;
    }

    .cat-count {
        font-size: 10px !important;
        padding: 1px 6px !important;
    }

    /* Auth modal mobile */
    .auth-modal {
        width: 95% !important;
        max-height: 85vh;
        margin: 10px;
    }

    .auth-body {
        padding: 15px !important;
    }
}

/* AUTH MODAL STYLES */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.auth-modal {
    background: white;
    width: 90%;
    max-width: 700px;
    /* Widened from 400px */
    border-radius: 12px;
    max-height: 90vh;
    /* Ensure it fits on screen */
    overflow-y: auto;
    /* Scroll if needed */
}



.auth-header {
    background: #f4f6f8;
    padding: 0;
    display: flex;
    border-bottom: 1px solid #ddd;
}

.auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.auth-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.auth-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

.form-control:focus {
    border-color: var(--accent-color);
    outline: none;
}

.btn-full {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.btn-full:hover {
    background: #b00000;
}

.user-type-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
}

.type-option {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* ==========================================================================
   BADGE PREZZO TOP (Tooltip & Asterisco)
   ========================================================================== */
.prezzo-top-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.prezzo-top-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #eab308;
    font-size: 19px;
    font-weight: 900;
    line-height: 1;
    margin-left: 5px;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: transform 0.2s ease, color 0.2s ease;
}

.prezzo-top-star:hover,
.prezzo-top-star:focus {
    transform: scale(1.25);
    color: #ca8a04;
}

.prezzo-top-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    z-index: 9999;
}

.prezzo-top-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
}

.prezzo-top-star:hover .prezzo-top-tooltip,
.prezzo-top-star:focus .prezzo-top-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}