/* Stili per l'area B2B - Login e Dashboard */

@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.b2b-login-body {
    min-height: 100vh;
    background: radial-gradient(circle at center, #707070 0%, #505050 50%, #303030 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-container {
    width: 100%;
    max-width: 350px;
    position: relative;
    z-index: 1;
}

.login-wrapper {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    margin-bottom: 1rem;
}

.login-logo .logo-img {
    max-width: 150px;
    height: auto;
    max-height: 60px;
}

.login-header h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-subtitle {
    color: #2c3e50;
    font-size: 1rem;
    margin: 0;
    font-weight: 400;
    text-align: center;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #fee;
    color: #c33;
    border-left: 4px solid #e74c3c;
}

.alert-success {
    background-color: #efe;
    color: #3c3;
    border-left: 4px solid #27ae60;
}

.alert i {
    font-size: 1.1rem;
}

/* Form */
.login-form {
    margin-top: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group label i {
    margin-right: 0.5rem;
    color: #667eea;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
    color: #2c3e50;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: #bdc3c7;
}

/* Password wrapper */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.1rem;
    transition: color 0.3s;
    z-index: 10;
}

.password-toggle:hover {
    color: #667eea;
}

.password-toggle:focus {
    outline: none;
}

/* Form options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.forgot-password {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Button */
.btn {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #2c3e50;
    color: #fff;
    box-shadow: none;
}

.btn-primary:hover {
    background: #1a252f;
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

.btn i {
    font-size: 1rem;
}

/* Login footer */
.login-footer {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.login-footer p {
    margin-bottom: 0.75rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.back-link {
    margin-top: 1rem;
}

.back-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #7f8c8d;
    font-size: 0.85rem;
}

.back-link a:hover {
    color: #667eea;
}

/* ============================================
   RESPONSIVE - TABLET (768px - 1024px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .login-box {
        padding: 2.5rem;
    }
    
    .login-header h1 {
        font-size: 2.2rem;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (< 768px)
   ============================================ */
@media (max-width: 767px) {
    .b2b-login-body {
        padding: 0.5rem;
    }
    
    .login-box {
        padding: 2rem 1.5rem;
        border-radius: 15px;
    }
    
    .login-header h1 {
        font-size: 1.75rem;
    }
    
    .login-subtitle {
        font-size: 0.9rem;
    }
    
    .login-logo .logo-img {
        max-width: 120px;
        max-height: 50px;
    }
    
    .form-control {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .forgot-password {
        align-self: flex-end;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE (< 480px)
   ============================================ */
@media (max-width: 480px) {
    .login-box {
        padding: 1.5rem 1.25rem;
        border-radius: 12px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .login-logo .logo-img {
        max-width: 100px;
        max-height: 40px;
    }
    
    .form-control {
        padding: 0.7rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION
   ============================================ */
@media (max-width: 767px) and (orientation: landscape) {
    .b2b-login-body {
        padding: 0.5rem;
    }
    
    .login-box {
        padding: 1.5rem;
    }
    
    .login-header {
        margin-bottom: 1rem;
    }
    
    .login-logo {
        margin-bottom: 0.5rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
}

/* ============================================
   TOUCH OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .form-control,
    .password-toggle {
        min-height: 44px;
    }
    
    .checkbox-label {
        min-height: 44px;
        padding: 0.5rem 0;
    }
}

/* ============================================
   DASHBOARD B2B
   ============================================ */

.b2b-dashboard-body {
    min-height: 100vh;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
}

.b2b-header {
    background: linear-gradient(135deg, var(--theme-header-color, #667eea) 0%, var(--theme-header-rgba-90, rgba(102, 126, 234, 0.9)) 30%, var(--theme-header-dark-rgba-90, rgba(118, 75, 162, 0.9)) 70%, var(--theme-header-color-dark, #764ba2) 100%);
    color: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.b2b-header .header-content {
    max-width: 100%;
    margin: 0 auto;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Barra di ricerca nella header */
.header-search {
    flex: 1;
    min-width: 250px;
    max-width: 500px;
}

.search-form-inline {
    width: 100%;
}

.search-wrapper-inline {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-wrapper-inline .search-icon {
    color: var(--theme-button-color, #667eea);
    margin-right: 0.5rem;
    font-size: 1rem;
}

.search-input-inline {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
    background: transparent;
    color: #2c3e50;
}

.search-input-inline::placeholder {
    color: #95a5a6;
}

.search-clear-inline {
    color: #7f8c8d;
    margin-right: 0.5rem;
    padding: 0.25rem;
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.search-clear-inline:hover {
    color: #e74c3c;
}

.search-btn-inline {
    background: linear-gradient(135deg, var(--theme-button-color, #667eea) 0%, var(--theme-button-color-dark, #764ba2) 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.search-btn-inline:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.b2b-header .logo-img {
    max-height: 40px;
    width: auto;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Link carrello nella header */
.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    font-weight: 500;
}

.cart-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.cart-badge {
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 24px;
}

/* Menu principale B2B */
.b2b-main-menu {
    background: linear-gradient(135deg, var(--theme-header-rgba-15, rgba(102, 126, 234, 0.15)) 0%, var(--theme-header-rgba-10, rgba(102, 126, 234, 0.1)) 30%, var(--theme-header-dark-rgba-10, rgba(118, 75, 162, 0.1)) 70%, var(--theme-header-dark-rgba-15, rgba(118, 75, 162, 0.15)) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
    padding: 0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.b2b-main-menu .menu-items {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
}

.b2b-main-menu .menu-items li {
    margin: 0;
    padding: 0;
}

.b2b-main-menu .menu-items li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    white-space: nowrap;
}

.b2b-main-menu .menu-items li a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.b2b-main-menu .menu-items li a.active {
    background: rgba(255, 255, 255, 0.15);
    border-bottom-color: #fff;
    font-weight: 600;
}

.b2b-main-menu .menu-items li a i {
    font-size: 0.9rem;
}

.b2b-main {
    flex: 1;
    padding: 2rem;
    width: 100%;
}

.dashboard-welcome {
    margin-bottom: 2rem;
    text-align: center;
}

.dashboard-welcome h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.company-name {
    color: #7f8c8d;
    font-size: 1.2rem;
    font-weight: 500;
}

.dashboard-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.info-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.info-card h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #667eea;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.info-item strong {
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-item strong i {
    color: #667eea;
}

.info-item span {
    color: #555;
    font-weight: 500;
}

.b2b-footer {
    background-color: var(--theme-footer-color, #2c3e50);
    color: #fff;
    padding: 1.5rem 0;
    text-align: center;
    margin-top: auto;
}

.b2b-footer {
    padding: 1.5rem 2rem;
}

.b2b-footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive Dashboard */
@media (max-width: 767px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-search {
        width: 100%;
        max-width: 100%;
        order: 2;
    }
    
    .header-nav {
        width: 100%;
        justify-content: space-between;
        order: 3;
    }
    
    .logo {
        order: 1;
    }
    
    .dashboard-welcome h1 {
        font-size: 1.75rem;
    }
    
    .dashboard-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .info-card {
        padding: 1.5rem;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ============================================
   PRODOTTI IN EVIDENZA
   ============================================ */

.search-bar {
    background: linear-gradient(135deg, var(--theme-header-color, #667eea) 0%, var(--theme-header-rgba-90, rgba(102, 126, 234, 0.9)) 30%, var(--theme-header-dark-rgba-90, rgba(118, 75, 162, 0.9)) 70%, var(--theme-header-color-dark, #764ba2) 100%);
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.search-form {
    max-width: 100%;
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.search-icon {
    color: var(--theme-button-color, #667eea);
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.5rem;
    background: transparent;
    color: #2c3e50;
}

.search-input::placeholder {
    color: #95a5a6;
}

.search-clear {
    color: #7f8c8d;
    margin-right: 0.5rem;
    padding: 0.25rem;
    text-decoration: none;
    transition: color 0.3s;
}

.search-clear:hover {
    color: #e74c3c;
}

.search-btn {
    background: linear-gradient(135deg, var(--theme-button-color, #667eea) 0%, var(--theme-button-color-dark, #764ba2) 100%);
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.page-header {
    text-align: left;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
    width: 100%;
}

.page-title-small {
    color: #2c3e50;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    padding: 0;
}

.search-results {
    color: #7f8c8d;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.search-results strong {
    color: #667eea;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
}

/* Grid prodotti in evidenza: dimensione fissa 200px, centrati */
.prodotti-evidenza-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 200px));
    gap: 1rem;
    justify-content: center;
}

/* Grid catalogo: riempie la larghezza disponibile */
.catalogo-prodotti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.product-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.product-image {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #fff;
}

.product-image a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform 0.3s;
}

.product-image:hover img {
    transform: scale(1.05);
}


.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--theme-button-color, #198754);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
}

.product-body {
    padding: 1rem;
    flex: 1;
}

.product-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.product-code {
    color: #6c757d;
    font-size: 0.8rem;
}

.product-category {
    color: #7f8c8d;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.product-title {
    margin-bottom: 0.75rem;
    line-height: 1.3;
    min-height: 2.5em;
}

.product-title a {
    color: #2c3e50;
    font-size: 0.95rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}

.product-title a:hover {
    color: #667eea;
}

.product-price {
    color: var(--price-accent-color, var(--theme-header-color, #667eea)) !important;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.product-price-listino {
    font-size: 0.85rem;
    color: #6c757d;
    text-decoration: line-through;
}

.btn-add-cart {
    width: 100%;
    background: linear-gradient(135deg, var(--theme-button-color, #667eea) 0%, var(--theme-button-color-dark, #764ba2) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.text-decoration-none {
    text-decoration: none !important;
}

.text-dark {
    color: #2c3e50 !important;
}

.no-products {
    text-align: center;
    padding: 4rem 2rem;
    color: #7f8c8d;
}

.no-products i {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 1rem;
}

.no-products h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.no-products p {
    margin-bottom: 1.5rem;
}

/* Responsive Products Grid - Fluido e adattivo */
@media (min-width: 1920px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (min-width: 1600px) and (max-width: 1919px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (min-width: 1200px) and (max-width: 1599px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .b2b-header {
        padding: 1rem;
    }
    
    .b2b-main {
        padding: 1rem;
    }
    
    .search-bar {
        padding: 1rem;
    }
    
    .search-wrapper {
        flex-direction: column;
        border-radius: 12px;
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .search-input {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .search-btn {
        width: 100%;
        justify-content: center;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
        gap: 1rem;
    }
    
    .product-card {
        margin-bottom: 0;
    }
    
    .b2b-footer {
        padding: 1rem;
    }
    
    .b2b-main-menu .menu-items {
        flex-direction: column;
    }
    
    .b2b-main-menu .menu-items li a {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-left: 3px solid transparent;
    }
    
    .b2b-main-menu .menu-items li a.active {
        border-left-color: #fff;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 1rem 0;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .product-body {
        padding: 1rem;
    }
}

/* ============================================
   PAGINA DETTAGLIO PRODOTTO
   ============================================ */

.product-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.product-detail-header {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--theme-button-color, #667eea);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.back-link:hover {
    color: var(--theme-button-color-dark, #764ba2);
    transform: translateX(-5px);
}

.product-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.product-detail-image {
    width: 100%;
    text-align: center;
}

.product-detail-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-detail-title {
    font-size: 2rem;
    color: #2c3e50;
    margin: 0;
}

.product-detail-code {
    color: #7f8c8d;
    font-size: 1rem;
}

.product-detail-price {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    font-size: 1.5rem;
}

.price-label {
    color: #7f8c8d;
    font-size: 1rem;
}

.price-value {
    color: var(--theme-button-color, #667eea);
    font-weight: 700;
    font-size: 2rem;
}

.product-detail-specs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #2c3e50;
}

.blocco-badge {
    background: #e74c3c;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.add-to-cart-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-selector label {
    font-weight: 600;
    color: #2c3e50;
}

.quantity-input {
    width: 100px;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
}

.quantity-input:focus {
    outline: none;
    border-color: var(--theme-button-color, #667eea);
}

.btn-add-to-cart {
    background: linear-gradient(135deg, var(--theme-button-color, #667eea) 0%, var(--theme-button-color-dark, #764ba2) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ============================================
   PAGINA CARRELLO
   ============================================ */

/* Box articoli carrello con background bianco */
.cart-items .card-modern,
.col-lg-8 .card-modern,
.col-lg-4 .card-modern {
    background: #fff;
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.cart-header h1 {
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-clear-cart {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-clear-cart:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.cart-empty i {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 1rem;
}

.cart-empty h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.cart-empty p {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.btn-continue-shopping {
    background: linear-gradient(135deg, var(--theme-button-color, #667eea) 0%, var(--theme-button-color-dark, #764ba2) 100%);
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-continue-shopping:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.cart-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 8px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-title {
    margin: 0;
    font-size: 1.1rem;
}

.cart-item-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
}

.cart-item-title a:hover {
    color: var(--theme-button-color, #667eea);
}

.cart-item-code {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.cart-item-price {
    color: var(--theme-button-color, #667eea);
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

.cart-item-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-control label {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.quantity-input-small {
    width: 60px;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
}

.quantity-input-small:focus {
    outline: none;
    border-color: var(--theme-button-color, #667eea);
}

.cart-item-total {
    font-size: 1.2rem;
    color: #2c3e50;
}

.btn-remove-item {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-remove-item:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.cart-summary {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.cart-summary-header {
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.cart-summary-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.cart-summary-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

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

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

.cart-total {
    font-size: 1.5rem;
    color: var(--theme-button-color, #667eea);
}

.cart-summary-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-checkout {
    background: linear-gradient(135deg, var(--theme-button-color, #667eea) 0%, var(--theme-button-color-dark, #764ba2) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Stili aggiuntivi per pagina prodotto con codpro - Full Width */
.product-detail-container-full {
    width: 100%;
    padding: 2rem;
}

.product-info-section-full {
    width: 100%;
    margin-bottom: 2rem;
}

.product-main-info-full {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 3rem;
    align-items: start;
}

.product-main-image-full {
    width: 100%;
    text-align: center;
}

.product-main-image-full img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.product-details-full {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-description-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.product-description {
    flex: 1;
    color: #555;
    line-height: 1.6;
}

.product-brand-image-right {
    flex-shrink: 0;
    width: 150px;
    height: auto;
}

.product-brand-image-right img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.articoli-section-full {
    width: 100%;
    padding: 0;
}

.articoli-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.articoli-header h2 {
    margin: 0;
    color: #2c3e50;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls label {
    font-weight: 600;
    color: #2c3e50;
}

.sort-controls select {
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.sort-controls select:focus {
    outline: none;
    border-color: var(--theme-button-color, #667eea);
}

.articoli-table-container {
    overflow-x: auto;
}

.articoli-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

.articoli-table thead {
    background: #f8f9fa;
}

.articoli-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.9rem;
}

.articoli-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
    font-size: 0.9rem;
}

.table-compact th,
.table-compact td {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
}

.articolo-row-image {
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.articolo-thumb {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.articoli-table tbody tr:hover {
    background: #f8f9fa;
}

.price-cell {
    color: var(--theme-button-color, #667eea);
    font-weight: 600;
    font-size: 1.1rem;
}

.sconto-badge {
    background: #e74c3c;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.add-to-cart-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-input-table {
    width: 60px;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
}

.quantity-input-table:focus {
    outline: none;
    border-color: var(--theme-button-color, #667eea);
}

.btn-add-cart-table {
    background: linear-gradient(135deg, var(--theme-button-color, #667eea) 0%, var(--theme-button-color-dark, #764ba2) 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-cart-table:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.no-articoli {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

/* Responsive per prodotto e carrello */
@media (max-width: 968px) {
    .product-detail-content {
        grid-template-columns: 1fr;
    }
    
    .product-main-info-full {
        grid-template-columns: 1fr;
    }
    
    .product-main-image-full {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .product-description-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .product-brand-image-right {
        width: 120px;
        margin: 0 auto;
    }
    
    .articoli-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .articoli-table {
        font-size: 0.9rem;
    }
    
    .articoli-table th,
    .articoli-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .cart-content {
        grid-template-columns: 1fr;
    }
    
    .cart-summary {
        position: static;
    }
}

@media (max-width: 767px) {
    .cart-item {
        grid-template-columns: 80px 1fr;
    }
    
    .cart-item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .cart-item-image {
        width: 80px;
        height: 80px;
    }
}

/* Font Awesome fallback - rimosso @import (ora all'inizio del file) */

/* ============================================
   TEMPLATE MODERNO BOOTSTRAP 5 B2B
   ============================================ */

.b2b-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #dee2e6;
}

/* Header Moderno */
.b2b-header-modern {
    background: linear-gradient(to right, var(--theme-header-color, #667eea) 0%, var(--theme-footer-color, #2c3e50) 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.75rem 0;
}

.b2b-header-modern .b2b-header-row {
    padding: 0.75rem 0;
}

.logo-header-wrapper {
    margin-left: 5mm;
}

/* Ricerca header: dimensioni solo desktop (>=992px), su mobile/tablet gestito sotto */
@media (min-width: 992px) {
    #form-ricerca-header.b2b-header-search-form {
        min-width: 200px;
        max-width: 400px;
    }
}

.logo-img-modern {
    max-height: 68px;
    height: auto;
    width: auto;
    filter: brightness(0) invert(1);
}

.search-form-modern .input-group {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    overflow: hidden;
}

.search-form-modern .input-group-text {
    border: none;
    background: #fff;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.search-form-modern .form-control {
    border: none;
    box-shadow: none;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.search-form-modern .form-control:focus {
    box-shadow: none;
    border: none;
}

.search-form-modern .btn-primary {
    border-radius: 0 50px 50px 0;
    padding: 0.375rem 1rem;
    background: var(--theme-button-color, #667eea);
    border: none;
    font-size: 0.875rem;
}

.search-form-modern .btn-primary:hover {
    background: var(--theme-button-color-dark, #764ba2);
}

/* Bottoni navigazione header */
.b2b-header-modern .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.b2b-header-modern .btn-outline-light:hover,
.b2b-header-modern .btn-outline-light.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.b2b-header-modern .navbar-dark {
    background: linear-gradient(135deg, var(--theme-header-rgba-20, rgba(102, 126, 234, 0.2)) 0%, var(--theme-header-rgba-15, rgba(102, 126, 234, 0.15)) 30%, var(--theme-header-dark-rgba-15, rgba(118, 75, 162, 0.15)) 70%, var(--theme-header-dark-rgba-20, rgba(118, 75, 162, 0.2)) 100%) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Menu navbar con gradiente sfumato */
.b2b-header-modern .navbar.bg-dark.bg-opacity-25,
.b2b-header-modern nav.navbar-dark {
    background: linear-gradient(135deg, var(--theme-header-rgba-25, rgba(102, 126, 234, 0.25)) 0%, var(--theme-header-rgba-20, rgba(102, 126, 234, 0.2)) 30%, var(--theme-header-dark-rgba-20, rgba(118, 75, 162, 0.2)) 70%, var(--theme-header-dark-rgba-25, rgba(118, 75, 162, 0.25)) 100%) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.b2b-header-modern .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: all 0.3s;
    border-radius: 6px;
    margin: 0 0.25rem;
}

.b2b-header-modern .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

.b2b-header-modern .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
    font-weight: 600;
}

.b2b-header-modern .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.b2b-header-modern .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Main Content Moderno */
.b2b-main-modern {
    flex: 1;
    min-height: calc(100vh - 200px);
}

/* Footer Moderno */
.b2b-footer-modern {
    background: linear-gradient(to right, var(--theme-footer-color, #2c3e50) 0%, var(--theme-header-color, #667eea) 100%);
    color: #fff;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Cards Moderne */
.card-modern {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-modern:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-modern .card-header {
    background: linear-gradient(135deg, var(--theme-header-color, #667eea) 0%, var(--theme-header-color-dark, #764ba2) 100%);
    color: #fff;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

/* Product Cards Moderne */
.product-card-modern {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-modern:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

.product-image-modern {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #fff;
}

.product-image-modern a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-modern img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform 0.3s;
}

.product-card-modern:hover .product-image-modern img {
    transform: scale(1.05);
}

.product-badge-modern {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--theme-button-color, #198754);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
}

.product-body-modern {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category-modern {
    color: #6c757d;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-title-modern {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title-modern a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.product-title-modern a:hover {
    color: var(--theme-button-color, #667eea);
}

.product-price-modern {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--price-accent-color, var(--theme-header-color, #667eea)) !important;
    margin-top: auto;
    margin-bottom: 1rem;
}

.btn-modern,
.btn-b2b {
    background: var(--theme-button-color, #198754);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-modern:hover,
.btn-b2b:hover {
    background: var(--theme-footer-color, #2c3e50);
    color: white;
    transform: none;
    box-shadow: none;
}

.btn-modern-outline {
    background: transparent;
    border: 2px solid var(--theme-button-color, #667eea);
    color: var(--theme-button-color, #667eea);
}

.btn-modern-outline:hover {
    background: var(--theme-button-color, #667eea);
    color: #fff;
}

/* Bottoni "Vedi Dettagli" più piccoli e senza bold */
.btn-dettagli {
    font-size: 0.75rem;
    padding: 0.1rem 0.6rem;
    font-weight: normal !important;
    line-height: 1.4;
    min-height: auto;
}

/* Titolo Dashboard moderno e stilizzato */
.dashboard-title-modern {
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-transform: none;
    color: #2c3e50;
    font-size: 1.75rem;
}

/* Grid Prodotti Moderno */
.products-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* Indice Alfabetico */
.indice-alfabeto {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
}

.indice-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
}

.indice-autocomplete {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.indice-autocomplete-left {
    justify-content: flex-start;
}

.indice-autocomplete-right {
    justify-content: flex-end;
}

.indice-autocomplete .input-group {
    width: 100%;
    max-width: 100%;
}

.indice-autocomplete .form-select {
    width: 100%;
    min-width: 150px;
}

/* Stili semplici e puliti per i select */
.select-styled {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #495057;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
    min-width: 150px;
}

.select-styled:hover {
    border-color: var(--theme-header-color, #667eea);
}

.select-styled:focus {
    border-color: var(--theme-header-color, #667eea);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.indice-centro {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 1rem;
}

.indice-label {
    font-variant: small-caps;
    letter-spacing: 1px;
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.indice-alfabeto .d-flex {
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.indice-alfabeto .indice-char {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.indice-alfabeto .indice-char:hover {
    transform: scale(1.08);
}

.indice-alfabeto .indice-char.btn-b2b,
.indice-alfabeto .indice-char.btn-outline-secondary:focus {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Bottoni indice: colore primario (header) */
.indice-alfabeto .indice-char.btn-b2b {
    background-color: var(--theme-header-color, #667eea) !important;
    border-color: var(--theme-header-color, #667eea) !important;
    color: white !important;
}

.indice-alfabeto .indice-char.btn-outline-secondary {
    border-color: var(--theme-header-color, #667eea);
    color: var(--theme-header-color, #667eea);
}

.indice-alfabeto .indice-char.btn-outline-secondary:hover {
    background-color: var(--theme-header-color, #667eea) !important;
    border-color: var(--theme-header-color, #667eea) !important;
    color: white !important;
}

/* Form filtri nell'indice */
.indice-alfabeto form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.indice-alfabeto form label {
    white-space: nowrap;
    font-size: 0.875rem;
}

.indice-alfabeto form .input-group {
    flex-shrink: 0;
}

.indice-alfabeto form .form-select {
    flex-shrink: 0;
}

/* Responsive per indice alfabetico */
@media (max-width: 991.98px) {
    .indice-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .indice-autocomplete {
        width: 100%;
        max-width: 100%;
    }
    
    .indice-autocomplete-left,
    .indice-autocomplete-right {
        justify-content: center;
    }
    
    .indice-centro {
        margin: 0;
        order: -1; /* L'indice viene prima su mobile */
    }
}

/* Sidebar Filtri */
.card-b2b {
    border: none;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

.card-b2b .card-header {
    background: var(--theme-button-color, #198754);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

.card-header-filtri {
    background-color: var(--theme-button-color, #198754) !important;
    border-color: var(--theme-button-color, #198754) !important;
}

/* Lista Famiglie */
.list-group-famiglie .list-group-item.active {
    background-color: var(--theme-header-color, #667eea) !important;
    border-color: var(--theme-header-color, #667eea) !important;
    color: white !important;
}

.list-group-famiglie .list-group-item {
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.list-group-famiglie .list-group-item:hover {
    background-color: #f8f9fa;
    border-left-color: var(--theme-header-color, #667eea);
}

.list-group-famiglie .list-group-item.active {
    border-left-color: var(--theme-header-color, #667eea);
}

/* B2B header: solo tablet/mobile (breakpoint Bootstrap lg; desktop >=992px invariato) */
@media (max-width: 991.98px) {
    .b2b-header-modern {
        padding: 0.5rem 0;
    }

    .b2b-header-modern .b2b-header-row {
        flex-wrap: wrap;
        row-gap: 0.75rem;
        align-items: flex-start;
    }

    .b2b-header-modern .b2b-header-row > .col-auto:first-child {
        order: 1;
    }

    .b2b-header-modern .b2b-header-row > .col-auto.ms-auto {
        order: 2;
        margin-left: auto !important;
        flex: 0 0 auto;
        width: auto;
        max-width: none;
    }

    .b2b-header-modern .b2b-header-row > .b2b-header-main-col {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 0;
    }

    .b2b-header-modern .logo-header-wrapper {
        margin-left: 0;
    }

    .b2b-header-modern .logo-img-modern {
        max-height: 52px;
    }

    #form-ricerca-header.b2b-header-search-form {
        width: 100%;
        max-width: none;
        min-width: 0;
        flex: 0 0 auto;
    }

    .b2b-header-modern .b2b-header-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem !important;
        flex-wrap: nowrap;
    }

    .b2b-header-modern .b2b-header-nav {
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        gap: 0.35rem 0.45rem;
    }

    .b2b-header-modern .b2b-header-nav > .btn,
    .b2b-header-modern .b2b-header-nav > .dropdown > .btn {
        flex: 0 0 auto;
        min-width: 2.75rem;
        min-height: 2.75rem;
        padding: 0.35rem 0.5rem;
        font-size: 0.95rem;
    }

    .b2b-header-modern .b2b-header-nav > a.badge {
        flex: 1 1 100%;
        min-height: 2.5rem;
        justify-content: center;
        font-size: 0.75rem !important;
        padding: 0.45rem 0.65rem !important;
    }

    .b2b-header-modern .col-auto.ms-auto .btn-outline-light {
        min-width: 2.75rem;
        min-height: 2.75rem;
        padding: 0.4rem 0.65rem;
    }

    .b2b-header-modern .header-user-toggle {
        max-width: min(52vw, 200px);
    }

    .b2b-header-modern .header-username {
        max-width: 7.5rem;
        font-size: 0.8rem;
    }

    #form-ricerca-header .form-control,
    #form-ricerca-header .btn {
        font-size: 1rem;
        min-height: 44px;
        height: 44px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .products-grid-modern,
    .prodotti-evidenza-grid,
    .catalogo-prodotti-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
}

@media (min-width: 1200px) {
    .products-grid-modern,
    .catalogo-prodotti-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Utilities Moderne */
.text-gradient {
    background: linear-gradient(135deg, var(--theme-header-color, #667eea) 0%, var(--theme-header-color-dark, #764ba2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-modern {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
}

.shadow-modern-lg {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
}

/* Badge Moderni */
.badge-modern {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Table Moderne */
.table-modern {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.table-modern thead {
    background: linear-gradient(135deg, var(--theme-header-color, #667eea) 0%, var(--theme-header-color-dark, #764ba2) 100%);
    color: #fff;
}

.table-modern thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table-modern tbody tr {
    transition: background 0.3s;
}

.table-modern tbody tr:hover {
    background: #f8f9fa;
}

.table-modern tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #e9ecef;
}

/* ============================================
   HERO BANNER SECTION (Dashboard)
   ============================================ */

.hero-banner-section {
    width: 100%;
    margin-top: 0;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
    z-index: 10;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero-banner-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.hero-banner-link {
    display: block;
    width: 100%;
    text-decoration: none;
    transition: opacity 0.3s ease;
    line-height: 0;
}

.hero-banner-link:hover {
    opacity: 0.9;
}

.hero-banner-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-width: 100%;
}

/* Responsive Hero Banner */
@media (max-width: 768px) {
    .hero-banner-image {
        max-height: 300px;
        object-fit: cover;
    }
}

@media (min-width: 769px) {
    .hero-banner-image {
        max-height: 500px;
        object-fit: cover;
    }
}