.dfg-feedback-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    max-width: 1200px;
    margin: 16px auto;
}

.dfg-feedback-grid-product {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: none;
    margin: 16px 0;
}

.dfg-review-card {
    border: 0 !important;
    border-radius: 10px !important;
    background: #f5f5f5;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

.dfg-main-image-trigger {
    display: block;
    width: 100% !important;
    overflow: hidden;
    border-radius: 0 !important;
    -webkit-appearance: none;
    appearance: none;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent;
    line-height: 0;
    position: relative;
    cursor: pointer;
}

.dfg-main-image-wrap {
    position: relative;
    width: 100% !important;
    height: 210px !important;
    overflow: hidden;
    background: transparent;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}

.dfg-main-product-image {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block;
    border: 0;
    margin: 0 !important;
    padding: 0 !important;
}

/* Entrambe le orientazioni riempiono completamente lo spazio preview. */
.dfg-main-product-image.is-portrait {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    border: 0;
    margin: 0 !important;
    padding: 0 !important;
}

.dfg-main-product-image.is-landscape {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    border: 0;
    margin: 0 !important;
    padding: 0 !important;
}

/* Fallback forte contro override tema/lazyload sul tag img generico. */
.dfg-main-image-wrap > img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dfg-product-thumb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.dfg-modal-main-image {
    width: 100%;
    height: 100%;
    min-height: 260px;
    max-width: 100%;
    max-height: none;
    object-fit: cover;
    object-position: center;
    display: block;
    cursor: zoom-in;
    user-select: none;
    transition: width 0.15s ease;
}

.dfg-modal-media.is-zoomed .dfg-modal-main-image {
    cursor: zoom-out;
}

.dfg-review-main {
    padding: 10px;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.dfg-reviewer-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dfg-reviewer-avatar {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
}

.dfg-reviewer-name {
    font-size: 12px;
    font-weight: 600;
    color: #1a2530;
    line-height: 1;
}

.dfg-verified-badge {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #3cbf5a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    cursor: default;
    user-select: none;
    flex: 0 0 12px;
}

.dfg-verified-badge .dfg-icon-verified {
    width: 7px;
    height: 7px;
    display: block;
}

.dfg-zig {
    font-size: 8px;
    line-height: 1;
    transform: translateY(-0.3px);
}

.dfg-region-inline {
    font-size: 10px;
    border: 1px solid #cfd6de;
    border-radius: 10px;
    padding: 1px 5px;
    color: #445;
    background: #f7f9fc;
}

.dfg-review-stars {
    margin: 12px 0 10px;
    color: #f5b300;
    font-size: 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.dfg-stars-track {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.dfg-star-icon {
    width: 14px;
    height: 14px;
    color: #d1d5db;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.dfg-star-icon.is-filled {
    color: #f5b300;
}

.dfg-star-icon .dfg-icon-star {
    width: 14px;
    height: 14px;
    display: block;
}

.dfg-product-rating-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: #101820;
    font-size: 13px;
    line-height: 1.2;
}

.dfg-product-rating-stars {
    position: relative;
    width: 78px;
    height: 14px;
    display: inline-block;
    line-height: 0;
    flex: 0 0 78px;
}

.dfg-stars-layer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.dfg-stars-layer-base {
    width: 100%;
    color: #d1d5db;
}

.dfg-stars-layer-fill {
    width: 0;
    overflow: hidden;
    color: #f5b300;
}

.dfg-product-rating-stars .dfg-star-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
}

.dfg-product-rating-stars .dfg-star-icon .dfg-icon-star {
    width: 14px;
    height: 14px;
    display: block;
}

.dfg-product-rating-text {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.dfg-product-rating-count {
    color: #5a6570;
    font-weight: 500;
}

/* In price HTML (loop/single), forza il badge su nuova riga sotto al prezzo. */
.dfg-product-rating-inline-price {
    display: flex;
    width: 100%;
    margin-top: 6px;
}

.price .dfg-product-rating-inline-price {
    display: flex;
    margin-top: 6px;
}

.dfg-review-title {
    margin: 0;
    padding-top: 2px;
    color: #101820;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 700;
}

.dfg-review-content {
    margin-top: 3px;
    color: #111820;
    font-size: 12px;
    line-height: 1.4;
}

.dfg-review-content p {
    margin: 0 0 6px;
}

.dfg-review-content p:last-child {
    margin-bottom: 0;
}

.dfg-review-votes {
    margin-top: auto;
    padding-top: 7px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.dfg-vote-btn {
    border: 0;
    background: transparent;
    padding: 0;
    color: #5a6570;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    line-height: 1;
}

.dfg-vote-icon {
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.dfg-icon.dfg-icon-vote {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.dfg-vote-btn.is-active {
    color: #1a1a1a;
}

.dfg-vote-count {
    font-size: 11px;
}

.dfg-review-product-footer {
    margin: 8px 8px 9px;
    padding: 6px 7px;
    border: 1px solid #e3e3e3;
    border-radius: 9px;
    background: #efefef;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.dfg-review-product-name {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 11px;
    font-weight: 600;
    color: #101820;
    line-height: 1.2;
}

.dfg-review-product-thumb {
    order: 1;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    overflow: hidden;
    display: inline-flex;
    flex: 0 0 30px;
}

.dfg-feedback-empty {
    margin: 12px auto;
    max-width: 1200px;
    padding: 10px 12px;
    border: 1px solid #dbe2e8;
    background: #f8fbfd;
    border-radius: 8px;
    font-size: 14px;
}

.dfg-shortcode-wrap {
    max-width: 1200px;
    margin: 0 auto;
}

.dfg-load-more-wrap {
    display: flex;
    justify-content: center !important;
    align-items: center;
    width: 100%;
    margin: 8px auto 20px;
    text-align: center;
}

.dfg-load-more-btn {
    border: 1px solid #d6dbe0;
    background: #fff;
    color: #111;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    min-width: 120px;
}

.dfg-load-more-btn:hover {
    border-color: #111;
}

.dfg-load-more-btn.is-loading,
.dfg-load-more-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.dfg-product-feedback-wrap {
    margin-top: 30px;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.dfg-product-feedback-title {
    margin: 0 0 2px 10px;
    font-size: 22px;
}

.dfg-language-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 2px 10px;
}

.dfg-language-filter-btn {
    border: 1px solid #d6dbe0;
    background: #f7f9fb;
    color: #233445;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.dfg-language-filter-btn.is-active {
    border-color: #111;
    background: #fff;
    color: #111;
}

.dfg-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    overscroll-behavior: contain;
}

.dfg-modal[hidden] {
    display: none !important;
}

.dfg-modal:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

.dfg-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.74);
}

.dfg-modal-dialog {
    position: relative;
    --dfg-modal-max-h: min(88vh, 840px);
    width: min(720px, 100%);
    max-height: 88vh;
    margin: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    z-index: 2;
}

.dfg-modal-content {
    max-height: var(--dfg-modal-max-h);
    overflow: auto;
}

.dfg-modal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr);
    max-height: none;
    height: auto;
    min-height: 0;
    align-items: stretch;
}

.dfg-modal-media {
    background: #000;
    min-height: 0;
    max-height: var(--dfg-modal-max-h);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: stretch;
    cursor: zoom-in;
}

.dfg-modal-side {
    padding: 14px;
    overflow: auto;
    max-height: var(--dfg-modal-max-h);
}

.dfg-modal-side .dfg-review-title {
    font-size: 18px;
}

.dfg-modal-side .dfg-review-content {
    font-size: 14px;
}

.dfg-modal-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-radius: 0 !important;
    color: #111 !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
    cursor: pointer;
    z-index: 10 !important;
    display: none;
}

.dfg-modal-close .dfg-icon-close {
    width: 18px;
    height: 18px;
    display: block;
}

.dfg-modal-close:focus-visible {
    outline: 2px solid #1f2937;
    outline-offset: 2px;
}

.dfg-modal-media.is-zoomed {
    cursor: zoom-out;
    overflow: auto;
}

.dfg-modal-media.is-zoomed .dfg-modal-main-image {
    width: auto;
    height: auto;
    min-height: 0;
    object-fit: contain;
}

html.dfg-modal-open,
body.dfg-modal-open {
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
}

.dfg-modal-media,
.dfg-modal-side {
    overscroll-behavior: contain;
}

@media (max-width: 1200px) {
    .dfg-feedback-grid,
    .dfg-feedback-grid-product {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .dfg-feedback-grid,
    .dfg-feedback-grid-product {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dfg-modal {
        padding: 10px;
    }

    .dfg-modal-dialog {
        width: min(100%, calc(100vw - 10px));
        max-height: 90vh;
    }

    .dfg-modal-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .dfg-modal-media {
        max-height: 44vh;
    }

    .dfg-modal-main-image {
        min-height: 220px;
    }

    .dfg-modal-side {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .dfg-feedback-grid,
    .dfg-feedback-grid-product {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .dfg-main-image-wrap {
        height: 150px !important;
    }

    .dfg-review-main {
        padding: 8px;
    }

    .dfg-reviewer-name {
        font-size: 11px;
    }

    .dfg-review-stars {
        margin: 9px 0 7px;
    }

    .dfg-review-title {
        font-size: 12px;
    }

    .dfg-review-content {
        font-size: 11px;
        line-height: 1.35;
    }

    .dfg-review-product-footer {
        margin: 6px 6px 7px;
        padding: 5px 6px;
    }

    .dfg-product-rating-inline {
        font-size: 12px;
    }

    .dfg-modal {
        padding: 8px;
    }

    .dfg-modal-dialog {
        width: min(100%, calc(100vw - 8px));
        border-radius: 10px;
    }
}

@media (max-width: 767px) {
    .dfg-modal-close {
        display: inline-flex !important;
    }
}

@media (hover: none) and (pointer: coarse) {
    .dfg-modal-close {
        display: inline-flex !important;
    }
}
