/**
 * WooCommerce Product Feature Blocks - Frontend Styles
 *
 * @package WPFB
 * @since 1.0.0
 */

/* ==========================================================================
   Main Container
   ========================================================================== */

.wpfb {
    margin: 24px 0 0;
    padding: 0;
}

/* Add margin before related products section */
.wpfb + .related.products,
.wpfb ~ .related.products {
    margin-top: 60px;
}

/* ==========================================================================
   Features Row
   ========================================================================== */

.wpfb__features {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 32px;
    margin-bottom: 24px;
    padding: 0;
}

/* ==========================================================================
   Single Feature
   ========================================================================== */

.wpfb__feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    text-align: center;
    max-width: 120px;
}

.wpfb__feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background-color: #f8f9fa;
    border-radius: 50%;
    padding: 10px;
}

.wpfb__feature-icon-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Support for SVG icons */
.wpfb__feature-icon-img[src$=".svg"] {
    width: 100%;
    height: 100%;
}

.wpfb__feature-text {
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    font-weight: 400;
}

/* ==========================================================================
   Checklist
   ========================================================================== */

.wpfb__checklist {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wpfb__checklist-item {
    position: relative;
    display: block;
    padding-left: 32px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* Check icon via ::before pseudo-element */
.wpfb__checklist-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1px;
    width: 20px;
    height: 20px;
    background-color: #22c55e;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 12px 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.wpfb__checklist-text {
    display: block;
}

/* Allow basic formatting in checklist text */
.wpfb__checklist-text strong,
.wpfb__checklist-text b {
    font-weight: 700;
    color: #111;
}

.wpfb__checklist-text em,
.wpfb__checklist-text i {
    font-style: italic;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Tablet */
@media screen and (max-width: 768px) {
    .wpfb__features {
        gap: 16px 24px;
    }

    .wpfb__feature {
        max-width: 100px;
    }

    .wpfb__feature-icon {
        width: 48px;
        height: 48px;
        padding: 8px;
    }

    .wpfb__feature-text {
        font-size: 12px;
    }

    .wpfb__checklist {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .wpfb__checklist-item {
        font-size: 13px;
        padding-left: 28px;
    }

    .wpfb__checklist-item::before {
        width: 18px;
        height: 18px;
        background-size: 11px 11px;
    }
}

/* Mobile */
@media screen and (max-width: 480px) {
    .wpfb__features {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px 16px;
    }

    .wpfb__feature {
        max-width: 90px;
    }

    .wpfb__feature-icon {
        width: 44px;
        height: 44px;
        padding: 8px;
    }

    .wpfb__feature-text {
        font-size: 11px;
    }

    .wpfb__checklist-item {
        padding-left: 26px;
    }

    .wpfb__checklist-item::before {
        width: 16px;
        height: 16px;
        background-size: 10px 10px;
        top: 2px;
    }
}

/* ==========================================================================
   Theme Compatibility
   ========================================================================== */

/* Reset common theme overrides */
.woocommerce .wpfb__checklist,
.woocommerce-page .wpfb__checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce .wpfb__checklist-item,
.woocommerce-page .wpfb__checklist-item {
    list-style: none;
}

.woocommerce .wpfb__checklist-item::marker,
.woocommerce-page .wpfb__checklist-item::marker {
    content: none;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .wpfb,
    .wpfb * {
        animation: none !important;
        transition: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wpfb__checklist-item::before {
        background-color: #000;
        border: 2px solid #000;
    }

    .wpfb__feature-text,
    .wpfb__checklist-text {
        color: #000;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .wpfb__features {
        display: block;
    }

    .wpfb__feature {
        display: inline-flex;
        margin-right: 20px;
        margin-bottom: 10px;
    }

    .wpfb__checklist-item::before {
        background-color: #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
