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

/* === RESPONSIVE DESIGN: TABELLA DESKTOP / CARDS MOBILE === */
.products-table-container {
    display: block;
}

.products-cards-container {
    display: none;
}

/* === LANDSCAPE MOBILE: nasconde tabella, mostra cards a 2 colonne === */
@media (max-height: 500px) {
    .products-table-container {
        display: none !important;
    }

    .products-cards-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 0 5px;
    }

    .product-card {
        padding: 10px !important;
        margin-bottom: 0 !important;
        border-radius: 10px !important;
    }

    .product-card-header {
        margin-bottom: 8px;
        gap: 6px;
    }

    .product-card-code {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .product-card-title {
        font-size: 0.85rem !important;
        margin: 6px 0 !important;
    }

    .product-card-description {
        font-size: 0.75rem !important;
        padding: 6px !important;
        margin: 6px 0 !important;
    }

    .product-card-image {
        max-width: 80px !important;
        max-height: 80px !important;
    }

    .product-card-oe {
        padding: 6px !important;
        margin: 6px 0 !important;
    }

    .product-card-image-container {
        margin-top: 8px !important;
        padding-top: 8px !important;
    }
}

/* === SEARCH FORM === */
/* === ZOOM IMMAGINI === */
.zoom-img-2 {
    max-width: 100px;
    transition: transform .2s;
}

.zoom-img-2:hover {
    transform: scale(2);
}

/* === STILI CARDS === */
.product-card {
    background: rgba(40, 40, 40, 0.95);
    border: 2px solid rgba(255, 107, 53, 0.5);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: #ff6b35;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    background: rgba(50, 50, 50, 0.98);
}

.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
    flex-wrap: wrap;
}

/* Codice come elemento a sé (struttura card aggiornata) */
.product-card > .product-card-code {
    margin-bottom: 12px;
}

/* Wrapper del pulsante "Aggiungi al carrello" */
.product-card-cart {
    text-align: center;
    margin-top: 14px;
}

input[type="checkbox"].product-card-checkbox {
    transform: scale(1.5);
    cursor: pointer;
    accent-color: #ff6b35;
    flex-shrink: 0;
}
button.product-card-checkbox {
    transform: none !important;
}

.product-card-code {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 10px 18px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.product-card-code:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.6);
    color: white;
}

.product-card-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffffff;
    margin: 15px 0;
    line-height: 1.4;
}

.product-card-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.5;
    margin: 12px 0;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
}

.product-card-oe {
    margin: 15px 0;
    background: rgba(255, 107, 53, 0.1);
    padding: 12px;
    border-radius: 10px;
    border-left: 3px solid #ff6b35;
}

.product-card-oe-title {
    color: #ff6b35;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 10px;
}

.product-card-oe-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-card-oe-code {
    background: rgba(255, 107, 53, 0.3);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 107, 53, 0.5);
    font-weight: 600;
}

.product-card-image-container {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 107, 53, 0.3);
}

.product-card-image {
    max-width: 150px;
    max-height: 150px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    background: white;
    padding: 5px;
}

.product-card-image:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.4);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .products-table-container {
        display: none !important;
    }

    .products-cards-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 0 8px;
        align-items: stretch;
    }

    /* CATEGORIES COMPACTING */
    .category-buttons,
    .subcategory-buttons {
        gap: 0.5rem;
    }

    .category-btn,
    .subcategory-btn {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.85rem !important;
        flex: 1 1 calc(50% - 0.5rem);
        box-sizing: border-box;
        text-align: center;
        width: 100%;
    }

    .order-container {
        text-align: center;
        margin: 15px 0;
    }

    .sharethis-sticky-share-buttons {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* === CARD MOBILE COERENTI CON IL DESKTOP === */
    .product-card {
        margin-bottom: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        height: 100%;
        display: flex;
        flex-direction: column;
        border-radius: 12px !important;
    }

    /* Immagine in alto, riquadro ad altezza fissa */
    .product-card-image-container {
        order: -1;
        margin: 0 0 8px 0 !important;
        padding: 0 !important;
        border-top: none !important;
        height: 150px;
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .product-card-image-container a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    .product-card-image {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 8px !important;
        box-sizing: border-box;
    }

    .product-card-image:hover {
        transform: none;
    }

    /* Codice centrato in alto */
    .product-card > .product-card-code {
        align-self: center;
        margin: 2px auto 6px auto !important;
        font-size: 0.78rem;
        padding: 5px 12px;
        max-width: 100%;
        word-break: normal;
    }

    /* Titolo più piccolo e centrato */
    .product-card-title {
        font-size: 0.85rem;
        line-height: 1.25;
        margin: 2px 0 4px 0;
        padding: 0 8px;
        text-align: center;
    }

    /* Descrizione piccola, centrata, senza riquadro */
    .product-card-description {
        font-size: 0.72rem;
        text-align: center;
        background: transparent !important;
        padding: 0 8px;
        margin: 0 0 6px 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Codici OE compatti su una riga, senza riquadro arancione */
    .product-card-oe {
        background: transparent !important;
        border: none !important;
        border-left: none !important;
        border-radius: 0 !important;
        margin: 2px 8px 6px 8px !important;
        padding: 0 !important;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 5px;
        overflow: hidden;
    }

    .product-card-oe-title {
        margin: 0 !important;
        font-size: 0.62rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .product-card-oe-codes {
        flex-wrap: nowrap;
        overflow: hidden;
        gap: 4px;
        min-width: 0;
    }

    .product-card-oe-code {
        padding: 2px 6px;
        font-size: 0.62rem;
        white-space: nowrap;
    }

    /* Pulsante carrello in fondo, centrato */
    .product-card-cart {
        order: 3;
        margin-top: auto;
        padding: 10px;
        text-align: center;
        border-top: 1px solid rgba(255, 107, 53, 0.2);
    }

    .product-card-cart .btn-add-cart,
    .product-card-cart .btn-soldout {
        padding: 6px 12px !important;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .product-card {
        padding: 0 !important;
        margin-bottom: 0 !important;
        border-width: 2px;
    }

    button.product-card-checkbox {
        transform: none !important;
    }

    .product-card-image-container {
        height: 120px;
    }

    .product-card > .product-card-code {
        font-size: 0.72rem;
        padding: 4px 10px;
        word-break: normal;
    }

    .product-card-title {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .product-card-description {
        font-size: 0.68rem;
    }
}