/* ========================================
   CALCULATORWIZARD - DYNAMIC CONTENT STYLES
   Version: 2.2 (Hydrator v2.2 Compatible)
   ======================================== */

/* CSS Variables for Easy Customization */
:root {
    --cw-primary: #00d4ff;
    --cw-primary-dark: #00a8cc;
    --cw-navy: #1a2332;
    --cw-navy-dark: #0f1419;
    --cw-slate: #64748b;
    --cw-slate-light: #94a3b8;
    --cw-bg-gradient-start: #f0f9ff;
    --cw-bg-gradient-end: #e0f7ff;
    --cw-bg-white: #ffffff;
    --cw-bg-light: #f8fafc;
    --cw-border: #e2e8f0;
    --cw-success: #10b981;
    --cw-warning: #f59e0b;
    --cw-danger: #ef4444;
    --cw-radius-sm: 12px;
    --cw-radius-md: 16px;
    --cw-shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --cw-shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --cw-shadow-lg: 0 8px 20px rgba(0, 212, 255, 0.2);
}

/* ── GLOBAL FIX: prevent all injected sections from overflowing ── */
#expert-insights,
#value-block-expert-choice,
#value-block-next-step,
#product-recommendations,
#dynamic-faqs,
#related-calculators {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    margin: 3rem 0;
}

/* ── All injected containers ── */
.expert-insights-section,
.expert-insights-card,
.value-block,
.value-block-next-step,
.product-recommendations-section,
.dynamic-faqs-section,
.related-calculators-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ========================================
   1. EXPERT INSIGHTS SECTION
   ======================================== */

.expert-insights-card,
.expert-insights-section {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    border-left: 6px solid var(--cw-primary);
    border-radius: var(--cw-radius-md);
    padding: 2rem;
    box-shadow: var(--cw-shadow-md);
    position: relative;
}

.expert-insights-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.expert-insights-icon {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.expert-insights-title {
    color: var(--cw-navy);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.expert-insights-content,
.expert-insights-text {
    color: var(--cw-slate);
    font-size: 1.05rem;
    line-height: 1.7;
    font-family: 'Outfit', sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.expert-insights-content p,
.expert-insights-text p {
    margin-bottom: 1rem;
}

.expert-insights-content p:last-child,
.expert-insights-text p:last-child {
    margin-bottom: 0;
}

.expert-insights-meta {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--cw-slate-light);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.insight-highlight {
    background: rgba(0, 212, 255, 0.08);
    border-left: 3px solid var(--cw-primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    font-weight: 500;
    box-sizing: border-box;
    max-width: 100%;
}

/* ========================================
   2. PRODUCT RECOMMENDATIONS SECTION
   ======================================== */

.product-recommendations-section {
    background: var(--cw-bg-white);
    border-radius: var(--cw-radius-md);
    padding: 2rem;
    box-shadow: var(--cw-shadow-md);
}

.product-recommendations-title {
    color: var(--cw-navy);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.product-grid,
.product-recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.product-card {
    background: var(--cw-bg-light);
    border: 2px solid var(--cw-border);
    border-radius: var(--cw-radius-sm);
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-sizing: border-box;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-card:hover {
    border-color: var(--cw-primary);
    transform: translateY(-4px);
    box-shadow: var(--cw-shadow-lg);
    background: var(--cw-bg-white);
}

.product-badge {
    display: inline-block;
    background: var(--cw-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    width: fit-content;
}

.product-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

.product-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.product-name {
    color: var(--cw-navy);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-price {
    color: var(--cw-success);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.product-rating {
    color: #f59e0b;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.product-reviews {
    color: var(--cw-slate-light);
    font-size: 0.85rem;
    font-family: 'Outfit', sans-serif;
}

.product-why {
    color: var(--cw-slate);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    flex-grow: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-description {
    color: var(--cw-slate);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    flex-grow: 1;
    font-family: 'Outfit', sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-cta,
.product-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--cw-primary);
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    width: fit-content;
    margin-top: auto;
}

.product-cta:hover,
.product-link:hover {
    background: var(--cw-primary-dark);
    transform: translateY(-1px);
}

/* ========================================
   3. DYNAMIC FAQs SECTION
   ======================================== */

.dynamic-faqs-section {
    background: var(--cw-bg-white);
    border-radius: var(--cw-radius-md);
    padding: 2rem;
    box-shadow: var(--cw-shadow-md);
}

.dynamic-faqs-title {
    color: var(--cw-navy);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.dynamic-faq-item {
    border-bottom: 1px solid var(--cw-border);
    padding: 1.5rem 0;
    box-sizing: border-box;
    max-width: 100%;
}

.dynamic-faq-item:first-child { padding-top: 0; }
.dynamic-faq-item:last-child { border-bottom: none; padding-bottom: 0; }

.dynamic-faq-question {
    color: var(--cw-navy);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-family: 'Outfit', sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.dynamic-faq-question .dynamic-faq-icon,
.dynamic-faq-question::before {
    content: '❓';
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1.4;
}

.dynamic-faq-answer {
    color: var(--cw-slate);
    font-size: 1rem;
    line-height: 1.7;
    padding-left: 2rem;
    font-family: 'Outfit', sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

/* ========================================
   4. RELATED CALCULATORS SECTION
   ======================================== */

.related-calculators-section {
    background: var(--cw-bg-white);
    border-radius: var(--cw-radius-md);
    padding: 2rem;
    box-shadow: var(--cw-shadow-md);
}

.related-calculators-title {
    color: var(--cw-navy);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.related-calculators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.related-calc-card {
    background: var(--cw-bg-light);
    border: 2px solid var(--cw-border);
    border-radius: var(--cw-radius-sm);
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-sizing: border-box;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.related-calc-card:hover {
    border-color: var(--cw-primary);
    transform: translateY(-4px);
    box-shadow: var(--cw-shadow-lg);
    background: var(--cw-bg-white);
}

.related-calc-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.related-calc-name {
    color: var(--cw-navy);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.related-calc-description {
    color: var(--cw-slate);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    #expert-insights,
    #value-block-expert-choice,
    #value-block-next-step,
    #product-recommendations,
    #dynamic-faqs,
    #related-calculators {
        margin: 2rem 0;
    }

    .expert-insights-section,
    .expert-insights-card,
    .product-recommendations-section,
    .dynamic-faqs-section,
    .related-calculators-section {
        padding: 1.25rem;
    }

    .expert-insights-title,
    .product-recommendations-title,
    .dynamic-faqs-title,
    .related-calculators-title {
        font-size: 1.4rem;
    }

    .expert-insights-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .product-grid,
    .product-recommendations-grid,
    .related-calculators-grid {
        grid-template-columns: 1fr;
    }

    .dynamic-faq-answer {
        padding-left: 1.5rem;
    }
}

/* ========================================
   UTILITY
   ======================================== */

.text-center { text-align: center; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

@media print {
    .expert-insights-section,
    .value-block,
    .product-recommendations-section,
    .dynamic-faqs-section,
    .related-calculators-section {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}
