/* --- CSS DG PRO AUDIO: COMPLETO v4 (FIX NERO + WRAP + RANKING MOBILE) --- */

/* 1. CONTENITORE PRINCIPALE */
.product-affiliate-container {
    width: 100% !important;
    max-width: 533px !important;
    margin: 20px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    border: none !important;
    background: none !important;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    box-sizing: border-box !important;
}
.product-affiliate-container * { box-sizing: border-box !important; }

/* 2. CARD AFFILIATO */
.product-affiliate {
    width: 100% !important;
    background-color: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 240px !important;
    padding: 0 !important;
    margin: 0 !important;
}

.product-affiliate__body {
    display: flex !important;
    flex: 1 !important;
    flex-direction: row !important; /* Desktop: Riga */
    align-items: center !important;
    padding: 15px 20px !important;
    gap: 20px !important;
    background: transparent !important;
    margin: 0 !important;
}

.product-affiliate__media { flex-shrink: 0 !important; margin: 0 !important; }
.product-affiliate__image { display: block !important; border: none !important; }
.product-affiliate__img {
    width: 130px !important;
    height: 130px !important;
    object-fit: contain !important;
    margin: 0 !important;
}

.product-affiliate__content {
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    text-align: left !important;
    min-width: 0 !important;
}

.product-affiliate__title-link { text-decoration: none !important; color: #333 !important; }
.product-affiliate__title {
    font-size: 18px !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    color: #333 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}
.product-affiliate__brand {
    color: #666 !important;
    font-weight: 600 !important;
    display: block !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    margin-bottom: 5px !important;
}

.product-affiliate__meta { margin-top: 5px !important; width: 100% !important; }
.product-affiliate__cta {
    background-color: #ff9900 !important;
    color: #fff !important;
    padding: 10px 15px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    text-align: center !important;
    display: inline-block !important;
    white-space: nowrap !important;
    transition: background-color 0.2s !important;
}

a.product-affiliate__cta,
a.product-affiliate__cta:visited,
a.product-affiliate__cta:active,
a.product-affiliate__cta:focus {
    color: #fff !important;
    background-color: #ff9900 !important;
}
.product-affiliate__cta:hover { background-color: #e68a00 !important; }

.product-affiliate__footer {
    background-color: #f9f9f9 !important;
    border-top: 1px solid #eee !important;
    padding: 8px 15px !important;
    width: 100% !important;
    min-height: 45px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
.affiliate-disclaimer {
    font-size: 10px !important;
    color: #777 !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    text-align: center !important;
}

/* Nota Trasparente Esterna */
.product-affiliate-transparent-note {
    width: 100% !important;
    background-color: transparent !important;
    text-align: right !important;
    padding-top: 6px !important;
    padding-right: 5px !important;
}
.product-affiliate__note-text {
    font-size: 9px !important;
    color: #888 !important;
    font-style: italic !important;
    /* keep font-size (do not resize) but allow wrapping to two lines */
    display: inline-block !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    max-width: 360px !important; /* limit width so text breaks into two lines */
    width: auto !important;
    word-break: break-word !important;
}

/* Ensure the controlled break is honoured and doesn't collapse */
.product-affiliate__note-text .dgp-note-break { display: block; }

/* Higher-specificity override to beat other styles that set display:block !important */
.product-affiliate-transparent-note .product-affiliate__note-text {
    display: inline-block !important;
    max-width: 360px !important;
    white-space: normal !important;
    word-break: break-word !important;
    /* Left align the note and prevent centering from parent rules */
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    align-self: flex-start !important;
}

/* Make CTA button go to its own line on small screens */
@media (max-width:525px) {
    .product-affiliate {
        min-height: 0 !important;
        height: auto !important;
        border-radius: 16px !important;
    }

    .product-affiliate__body {
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        padding: 16px !important;
        gap: 14px !important;
    }

    .product-affiliate__media,
    .product-affiliate__image {
        width: 100% !important;
    }

    .product-affiliate__img {
        display: block !important;
        width: 100% !important;
        max-width: 180px !important;
        height: auto !important;
        max-height: 180px !important;
        margin: 0 auto !important;
    }

    .product-affiliate__content {
        width: 100% !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
    }

    .product-affiliate__title {
        font-size: 17px !important;
        margin-bottom: 8px !important;
        -webkit-line-clamp: unset !important;
        overflow: visible !important;
    }

    .product-affiliate__brand {
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }

    .product-affiliate__meta {
        margin-top: 10px !important;
        width: 100% !important;
    }

    .product-affiliate__meta a.product-affiliate__cta,
    .product-affiliate__meta a.product-affiliate__button,
    .product-affiliate__meta .product-affiliate__cta {
        display: flex !important;
        width: 100% !important;
        min-height: 48px !important;
        padding: 12px 14px !important;
        box-sizing: border-box !important;
        margin-top: 8px !important;
        align-items: center !important;
        justify-content: center !important;
        align-self: stretch !important;
        text-align: center !important;
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.25 !important;
    }

    .product-affiliate__footer {
        min-height: 0 !important;
        padding: 10px 12px !important;
    }

    .affiliate-disclaimer {
        font-size: 9px !important;
        line-height: 1.35 !important;
    }

    .product-affiliate-transparent-note {
        padding-top: 8px !important;
        padding-right: 0 !important;
        text-align: left !important;
    }

    .product-affiliate__note-text {
        max-width: none !important;
        font-size: 9px !important;
    }
}

/* Forced break element used when user cannot run DevTools snippet */
.dgp-cta-break { display: none !important; }
@media (max-width:525px) {
    .dgp-cta-break { display: block !important; width: 100% !important; line-height: 0 !important; margin: 0 !important; }
    .product-affiliate__meta .product-affiliate__cta { text-align: center !important; }
}

/* 3. STILI TABELLE */
.dgp-pro-cons-wrapper { gap: 15px !important; }
.dgp-col, .dgp-table-wrapper {
    width: 100% !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
    margin: 0 !important;
}
.dgp-header {
    padding: 10px !important;
    text-align: center !important;
    font-weight: 700 !important;
    color: #fff !important;
    text-transform: uppercase !important;
    font-size: 14px !important;
}
.dgp-header-pro { background-color: #4CAF50 !important; }
.dgp-header-con { background-color: #d32f2f !important; }
.dgp-pro-cons-wrapper .dgp-header-pro { background-color: #4CAF50 !important; }
.dgp-pro-cons-wrapper .dgp-header-con { background-color: #d32f2f !important; }
.dgp-list { list-style: none !important; margin: 0 !important; padding: 15px !important; }
/* FIX RICHIESTO: TESTO NERO ASSOLUTO NEI PRO/CONTRO */
.dgp-list li {
    display: flex !important; align-items: flex-start !important;
    margin-bottom: 8px !important; font-size: 14px !important;
    color: #000000 !important; /* Nero Assoluto */
    line-height: 1.4 !important;
}
.dgp-list li::before { content: none !important; }
.dgp-icon-pro, .dgp-icon-con { margin-right: 8px !important; flex-shrink: 0 !important; }
.dgp-icon-pro { fill: #4CAF50 !important; } .dgp-icon-con { fill: #d32f2f !important; }

/* Zebra per liste PRO/CONTRO se necessario */
.dgp-list li:nth-child(odd) { background-color: #f9f9f9 !important; }
.dgp-list li:nth-child(even) { background-color: #ffffff !important; }

/* Tabella Zebra */
.dgp-zebra-title {
    background-color: #333 !important; color: #fff !important;
    margin: 0 !important; padding: 10px 15px !important;
    font-size: 16px !important; font-weight: 600 !important;
    text-align: left !important; border-bottom: 1px solid #444 !important;
}
.dgp-zebra-table { width: 100% !important; border-collapse: collapse !important; margin: 0 !important; }
.dgp-zebra-table tr:nth-child(odd) { background-color: #f9f9f9 !important; }
.dgp-zebra-table tr:nth-child(even) { background-color: #ffffff !important; }
.dgp-zebra-table td {
    padding: 10px 15px !important; font-size: 14px !important;
    color: #333 !important; border-bottom: 1px solid #eee !important;
    vertical-align: top !important;
}
.dgp-zebra-table td:first-child { font-weight: 600 !important; color: #555 !important; width: 40% !important; }

/* Legacy ranking/fallback blocks removed.
   Ranking layout is now defined only in FINAL RANKING STANDARD LOCK. */

.product-affiliate__body {
    display: flex !important;
    flex: 1 !important;
    flex-direction: row !important; /* Desktop: Riga */
    align-items: center !important;
    padding: 15px 20px !important;
    gap: 20px !important;
    background: transparent !important;
    margin: 0 !important;
}

.product-affiliate__media { flex-shrink: 0 !important; margin: 0 !important; }
.product-affiliate__image { display: block !important; border: none !important; }
.product-affiliate__img {
    width: 130px !important;
    height: 130px !important;
    object-fit: contain !important;
    margin: 0 !important;
}

.product-affiliate__content {
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    text-align: left !important;
    min-width: 0 !important;
}

.product-affiliate__title-link { text-decoration: none !important; color: #333 !important; }
.product-affiliate__title {
    font-size: 18px !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    color: #333 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}
.product-affiliate__brand {
    color: #666 !important;
    font-weight: 600 !important;
    display: block !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    margin-bottom: 5px !important;
}

.product-affiliate__meta { margin-top: 5px !important; width: 100% !important; }
.product-affiliate__cta {
    background-color: #ff9900 !important;
    color: #fff !important;
    padding: 10px 15px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    text-align: center !important;
    display: inline-block !important;
    white-space: nowrap !important;
    transition: background-color 0.2s !important;
}
.product-affiliate__cta:hover { background-color: #e68a00 !important; }

.product-affiliate__footer {
    background-color: #f9f9f9 !important;
    border-top: 1px solid #eee !important;
    padding: 8px 15px !important;
    width: 100% !important;
    min-height: 45px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
.affiliate-disclaimer {
    font-size: 10px !important;
    color: #777 !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    text-align: center !important;
}
.product-affiliate-transparent-note {
    width: 100% !important;
    background-color: transparent !important;
    text-align: right !important;
    padding-top: 6px !important;
    padding-right: 5px !important;
}
.product-affiliate__note-text {
    font-size: 9px !important;
    color: #888 !important;
    font-style: italic !important;
    display: block !important;
    line-height: 1.3 !important;
}

/* 3. STILI TABELLE */
.dgp-pro-cons-wrapper { gap: 15px !important; }
.dgp-col, .dgp-table-wrapper {
    width: 100% !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
    margin: 0 !important;
}
.dgp-header {
    padding: 10px !important;
    text-align: center !important;
    font-weight: 700 !important;
    color: #fff !important;
    text-transform: uppercase !important;
    font-size: 14px !important;
}
.dgp-header-pro { background-color: #4CAF50 !important; }
.dgp-header-con { background-color: #d32f2f !important; }
.dgp-list { list-style: none !important; margin: 0 !important; padding: 15px !important; }
.dgp-list li {
    display: flex !important; align-items: flex-start !important;
    margin-bottom: 8px !important; font-size: 14px !important;
    color: #333 !important; line-height: 1.4 !important;
}
.dgp-list li::before { content: none !important; }
.dgp-icon-pro, .dgp-icon-con { margin-right: 8px !important; flex-shrink: 0 !important; }
.dgp-icon-pro { fill: #4CAF50 !important; } .dgp-icon-con { fill: #d32f2f !important; }

/* Tabella Zebra */
.dgp-zebra-title {
    background-color: #333 !important; color: #fff !important;
    margin: 0 !important; padding: 10px 15px !important;
    font-size: 16px !important; font-weight: 600 !important;
    text-align: left !important; border-bottom: 1px solid #444 !important;
}
.dgp-zebra-table { width: 100% !important; border-collapse: collapse !important; margin: 0 !important; }
.dgp-zebra-table tr:nth-child(odd) { background-color: #f9f9f9 !important; }
.dgp-zebra-table tr:nth-child(even) { background-color: #ffffff !important; }
.dgp-zebra-table td {
    padding: 10px 15px !important; font-size: 14px !important;
    color: #333 !important; border-bottom: 1px solid #eee !important;
    vertical-align: top !important;
}
.dgp-zebra-table td:first-child { font-weight: 600 !important; color: #555 !important; width: 40% !important; }

/* Legacy duplicated ranking blocks removed.
   Ranking styles are now centralized in FINAL RANKING STANDARD LOCK. */

/* Aggancio fallback per markup che viene renderizzato con inline styles (es. <div style="display: flex; ...">) */
@media (max-width: 690px) {
    /* Target diretto: qualsiasi figlio con style che contiene "display:flex" dentro il container */
    .product-affiliate-container > [style*="display:flex"],
    .product-affiliate-container [style*="display:flex"] {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: none !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }

    .product-affiliate-container > [style*="display:flex"] img,
    .product-affiliate-container [style*="display:flex"] img {
        width: 80px !important;
        height: 80px !important;
        object-fit: cover !important;
    }

    .product-affiliate-container > [style*="display:flex"] strong,
    .product-affiliate-container [style*="display:flex"] strong,
    .product-affiliate-container > [style*="display:flex"] .rank-name,
    .product-affiliate-container [style*="display:flex"] .rank-name {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        white-space: normal !important;
        word-break: break-word !important;
        margin-top: 8px !important;
    }

    .product-affiliate-container > [style*="display:flex"] span[style*="color:"],
    .product-affiliate-container [style*="display:flex"] span[style*="color:"] {
        margin: 0 !important;
    }
}

    /* Legacy 959px sizing override removed for ranking to avoid cross-rule conflicts. */

/* -------------------------------------------------------------
   FINAL RANKING STANDARD LOCK
   Ensures all ranking cards have consistent dimensions and image sizing.
   ------------------------------------------------------------- */
.entry-content .ranking-item,
.entry-content .custom-ranking-item,
.entry-content .product-affiliate-container.ranking-item,
.ranking-item,
.custom-ranking-item,
.product-affiliate-container.ranking-item {
    width: 100% !important;
    max-width: 533px !important;
    min-width: 0 !important;
    margin: 0 0 10px 0 !important;
    overflow: hidden !important;
    background: #fff !important;
    box-sizing: border-box !important;
}

.entry-content .ranking-item .ranking-inner,
.entry-content .custom-ranking-item .ranking-inner,
.entry-content .ranking-item > div,
.entry-content .custom-ranking-item > div,
.ranking-item .ranking-inner,
.custom-ranking-item .ranking-inner,
.ranking-item > div,
.custom-ranking-item > div {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.entry-content .ranking-item img,
.entry-content .custom-ranking-item img,
.entry-content .ranking-item .dgp-rank-img,
.entry-content .custom-ranking-item .dgp-rank-img,
.ranking-item img,
.custom-ranking-item img,
.ranking-item .dgp-rank-img,
.custom-ranking-item .dgp-rank-img {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
    flex: 0 0 60px !important;
    display: block !important;
}

.entry-content .ranking-item .dgp-rank-name,
.entry-content .custom-ranking-item .dgp-rank-name,
.entry-content .ranking-item strong,
.entry-content .custom-ranking-item strong,
.ranking-item .dgp-rank-name,
.custom-ranking-item .dgp-rank-name,
.ranking-item strong,
.custom-ranking-item strong {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

.entry-content .ranking-item .dgp-rank-score,
.entry-content .custom-ranking-item .dgp-rank-score,
.entry-content .ranking-item .dgp-rank-vote,
.entry-content .custom-ranking-item .dgp-rank-vote,
.ranking-item .dgp-rank-score,
.custom-ranking-item .dgp-rank-score,
.ranking-item .dgp-rank-vote,
.custom-ranking-item .dgp-rank-vote {
    white-space: nowrap !important;
    flex: 0 0 auto !important;
}

.entry-content .ranking-item .dgp-rank-pos,
.entry-content .custom-ranking-item .dgp-rank-pos,
.ranking-item .dgp-rank-pos,
.custom-ranking-item .dgp-rank-pos {
    background: #333 !important;
    color: #fff !important;
    padding: 4px 10px !important;
    border-radius: 999px !important;
    min-width: 34px !important;
    text-align: center !important;
    font-weight: 700 !important;
    flex: 0 0 auto !important;
}

.entry-content .ranking-item .dgp-rank-name a,
.entry-content .custom-ranking-item .dgp-rank-name a,
.ranking-item .dgp-rank-name a,
.custom-ranking-item .dgp-rank-name a {
    color: #2c3e50 !important;
    text-decoration: none !important;
    border: 0 !important;
}

@media (max-width: 690px) {
    .entry-content .ranking-item .ranking-inner,
    .entry-content .custom-ranking-item .ranking-inner,
    .entry-content .ranking-item > div,
    .entry-content .custom-ranking-item > div,
    .ranking-item .ranking-inner,
    .custom-ranking-item .ranking-inner,
    .ranking-item > div,
    .custom-ranking-item > div {
        flex-direction: column !important;
        text-align: center !important;
    }

    .entry-content .ranking-item .dgp-rank-score,
    .entry-content .custom-ranking-item .dgp-rank-score,
    .ranking-item .dgp-rank-score,
    .custom-ranking-item .dgp-rank-score {
        justify-content: center !important;
    }
}

/* Hard safety override for small screens: keep product name and CTA always visible */
@media (max-width: 760px) {
    .gp-aff-card-item .product-affiliate,
    .product-affiliate-container .product-affiliate {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .gp-aff-card-item .product-affiliate__body,
    .product-affiliate-container .product-affiliate__body {
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        overflow: visible !important;
    }

    .gp-aff-card-item .product-affiliate__content,
    .product-affiliate-container .product-affiliate__content {
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
        text-align: left !important;
    }

    .gp-aff-card-item .product-affiliate__title,
    .gp-aff-card-item .product-affiliate__title-link,
    .product-affiliate-container .product-affiliate__title,
    .product-affiliate-container .product-affiliate__title-link {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #222 !important;
        -webkit-line-clamp: unset !important;
        overflow: visible !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    .gp-aff-card-item .product-affiliate__meta,
    .product-affiliate-container .product-affiliate__meta {
        display: block !important;
        width: 100% !important;
        overflow: visible !important;
    }

    .gp-aff-card-item .product-affiliate__cta,
    .gp-aff-card-item .product-affiliate__meta .product-affiliate__cta,
    .product-affiliate-container .product-affiliate__cta,
    .product-affiliate-container .product-affiliate__meta .product-affiliate__cta {
        display: flex !important;
        width: 100% !important;
        min-height: 48px !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #fff !important;
        background-color: #ff9900 !important;
        white-space: normal !important;
        word-break: break-word !important;
        text-align: center !important;
        line-height: 1.25 !important;
    }
}