/**
 * Stili per le descrizioni complete dei prodotti nel carrello
 * 
 * Questo file CSS gestisce il problema del troncamento delle descrizioni dei prodotti
 * nelle pagine carrello e checkout di WooCommerce.
 * 
 * @version 1.0.0
 * @author Dareplus
 */

/* ==========================================================================
   Stili per WooCommerce Blocks (Cart e Checkout)
   ========================================================================== */

/* Descrizioni dei prodotti nei Block del carrello */
.wc-block-cart .wc-block-components-product-metadata__description,
.wc-block-cart .wc-block-components-product-metadata__description p,
.wc-block-checkout .wc-block-components-product-metadata__description,
.wc-block-checkout .wc-block-components-product-metadata__description p {
    display: block !important;
    overflow: visible !important;
    text-overflow: initial !important;
    white-space: normal !important;
    max-height: none !important;
    height: auto !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
}

/* Rimuovi eventuali limitazioni di altezza sui contenitori */
.wc-block-cart .wc-block-components-product-metadata,
.wc-block-checkout .wc-block-components-product-metadata {
    max-height: none !important;
    overflow: visible !important;
}

/* ==========================================================================
   Stili per Template Classici di WooCommerce
   ========================================================================== */

/* Descrizioni nei template classici */
.woocommerce-cart-form .product-description,
.woocommerce-checkout-review-order-table .product-description,
.cart_item_description {
    display: block !important;
    overflow: visible !important;
    text-overflow: initial !important;
    white-space: normal !important;
    max-height: none !important;
    height: auto !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
}

/* ==========================================================================
   Stili Generici per Compatibilità
   ========================================================================== */

/* Selettori generici per massima compatibilità */
[data-product-description],
.product-description,
.cart_item_description,
.woocommerce-cart-item__description {
    display: block !important;
    overflow: visible !important;
    text-overflow: initial !important;
    white-space: normal !important;
    max-height: none !important;
    height: auto !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
}

/* ==========================================================================
   Stili per Elementi Figli
   ========================================================================== */

/* Assicura che anche gli elementi figli non vengano troncati */
.wc-block-components-product-metadata__description p,
.wc-block-components-product-metadata__description div,
.wc-block-components-product-metadata__description span,
.product-description p,
.product-description div,
.product-description span,
.cart_item_description p,
.cart_item_description div,
.cart_item_description span {
    display: block !important;
    overflow: visible !important;
    text-overflow: initial !important;
    white-space: normal !important;
    max-height: none !important;
    height: auto !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
}

/* ==========================================================================
   Stili per Responsive Design
   ========================================================================== */

/* Mobile e tablet */
@media (max-width: 768px) {

    .wc-block-components-product-metadata__description,
    .product-description,
    .cart_item_description {
        font-size: 14px !important;
        line-height: 1.4 !important;
        margin: 8px 0 !important;
    }
}

/* Desktop */
@media (min-width: 769px) {

    .wc-block-components-product-metadata__description,
    .product-description,
    .cart_item_description {
        font-size: 15px !important;
        line-height: 1.5 !important;
        margin: 10px 0 !important;
    }
}

/* ==========================================================================
   Stili per Temi Popolari
   ========================================================================== */

/* Astra Theme */
.ast-separate-container .wc-block-components-product-metadata__description,
.ast-separate-container .product-description {
    max-height: none !important;
    overflow: visible !important;
}

/* GeneratePress Theme */
.generatepress .wc-block-components-product-metadata__description,
.generatepress .product-description {
    max-height: none !important;
    overflow: visible !important;
}

/* OceanWP Theme */
.oceanwp .wc-block-components-product-metadata__description,
.oceanwp .product-description {
    max-height: none !important;
    overflow: visible !important;
}

/* Storefront Theme */
.storefront .wc-block-components-product-metadata__description,
.storefront .product-description {
    max-height: none !important;
    overflow: visible !important;
}

/* ==========================================================================
   Stili per Plugin di Terze Parti
   ========================================================================== */

/* Elementor */
.elementor .wc-block-components-product-metadata__description,
.elementor .product-description {
    max-height: none !important;
    overflow: visible !important;
}

/* Beaver Builder */
.fl-builder .wc-block-components-product-metadata__description,
.fl-builder .product-description {
    max-height: none !important;
    overflow: visible !important;
}

/* ==========================================================================
   Stili per Elementi Creati Dinamicamente
   ========================================================================== */

/* Elementi descrizione creati dal plugin */
.dareplus-product-description,
.dareplus-full-description {
    display: block !important;
    overflow: visible !important;
    text-overflow: initial !important;
    white-space: normal !important;
    max-height: none !important;
    height: auto !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    margin-top: 8px !important;
    font-size: 14px !important;
    color: #666 !important;
    line-height: 1.4 !important;
}

/* Stili per elementi figli delle descrizioni create */
.dareplus-product-description p,
.dareplus-product-description div,
.dareplus-product-description span,
.dareplus-full-description p,
.dareplus-full-description div,
.dareplus-full-description span {
    display: block !important;
    overflow: visible !important;
    text-overflow: initial !important;
    white-space: normal !important;
    max-height: none !important;
    height: auto !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
}

/* ==========================================================================
   Stili per Debug (solo quando WP_DEBUG è attivo)
   ========================================================================== */

/* Evidenzia gli elementi processati in modalità debug */
body.wp-debug [data-full-desc-applied="1"],
body.wp-debug .dareplus-full-description {
    border-left: 3px solid #00a0d2 !important;
    background-color: rgba(0, 160, 210, 0.05) !important;
}

/* ==========================================================================
   Stili per Accessibilità
   ========================================================================== */

/* Migliora la leggibilità per screen reader */
.wc-block-components-product-metadata__description,
.product-description,
.cart_item_description {
    /* Assicura che il testo sia leggibile */
    color: inherit !important;
    background-color: transparent !important;

    /* Migliora il contrasto se necessario */
    text-shadow: none !important;

    /* Rimuovi eventuali filtri che potrebbero nascondere il testo */
    filter: none !important;
    opacity: 1 !important;
}

/* ==========================================================================
   Stili per Print
   ========================================================================== */

@media print {

    .wc-block-components-product-metadata__description,
    .product-description,
    .cart_item_description {
        display: block !important;
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        page-break-inside: avoid !important;
    }
}