/**
 * AIEO Product Needs — front-end styling.
 * Mirror of PPE's product-needs block so the visual stays identical
 * when the admin flips AIEO's frontend gate on.
 *
 * CSS variables (--aieo-pn-*) are emitted per page load by the PHP
 * side from the saved display settings — see build_css_vars() in
 * class-aieo-dmm-product-needs.php.
 */

.aieo-product-needs {
    display: flex;
    flex-direction: column;
    align-items: var(--aieo-pn-align, flex-start);
    margin-top: var(--aieo-pn-mt, 20px);
    margin-bottom: var(--aieo-pn-mb, 20px);
    padding: 15px 20px;
    background-color: var(--aieo-pn-bg, #f8f9fa);
    border: var(--aieo-pn-border-w, 1px) solid var(--aieo-pn-border, #e9ecef);
    border-radius: var(--aieo-pn-border-r, 0);
}

.aieo-product-needs-title {
    margin: 0 0 12px;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--aieo-pn-text, #333333);
}

.aieo-product-needs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
}

.aieo-product-needs-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--aieo-pn-text, #333333);
    cursor: default;
}
.aieo-product-needs-item[title] { cursor: help; }

.aieo-product-needs-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--aieo-pn-icon, #27ae60);
}
.aieo-product-needs-icon svg { width: 16px; height: 16px; }

.aieo-product-needs-text { color: var(--aieo-pn-text, #333333); }
.aieo-product-needs-link {
    color: var(--aieo-pn-link, #0073aa);
    text-decoration: none;
    transition: color 0.2s ease;
}
.aieo-product-needs-link:hover {
    color: var(--aieo-pn-text, #333333);
    text-decoration: underline;
}

/* Follow alignment for inner list items too. Flex box's align-items
 * was set on the outer block; the inner list needs its own rule so
 * list items center / right-align when the setting asks for it. */
.aieo-product-needs[style*="--aieo-pn-align: center"] .aieo-product-needs-list,
.aieo-product-needs[style*="--aieo-pn-align:center"] .aieo-product-needs-list {
    align-items: center;
}
.aieo-product-needs[style*="--aieo-pn-align: flex-end"] .aieo-product-needs-list,
.aieo-product-needs[style*="--aieo-pn-align:flex-end"] .aieo-product-needs-list {
    align-items: flex-end;
}

/* Tab variant — drop the box chrome since the WC tab panel frames us. */
.aieo-product-needs--tab {
    margin: 0;
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
}
.aieo-product-needs--tab .aieo-product-needs-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 15px;
}
.aieo-product-needs--tab .aieo-product-needs-item { gap: 6px; }

/* ---------------------------------------------------------------------------
 * Pill variant — needs shown as tag-like chips laid out side by side
 * (display_style = 'pills'). Per-pill background / border / radius / padding /
 * text size + the gap between pills are all operator-controlled through the
 * --aieo-pn-pill-* custom properties emitted by build_css_vars(). The
 * alignment dropdown maps to justify-content so the row of pills can sit
 * left / centre / right.
 * ------------------------------------------------------------------------- */
.aieo-product-needs--pills .aieo-product-needs-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: var(--aieo-pn-align, flex-start);
    gap: var(--aieo-pn-pill-gap, 8px);
}
.aieo-product-needs--pills .aieo-product-needs-item {
    gap: 6px;
    font-size: var(--aieo-pn-pill-fs, 13px);
    line-height: 1.2;
    padding: var(--aieo-pn-pill-pv, 6px) var(--aieo-pn-pill-ph, 12px);
    background-color: var(--aieo-pn-pill-bg, #eef1f4);
    border: var(--aieo-pn-pill-bw, 1px) solid var(--aieo-pn-pill-bc, #d6dbe1);
    border-radius: var(--aieo-pn-pill-r, 16px);
    color: var(--aieo-pn-pill-text, #333333);
}
.aieo-product-needs--pills .aieo-product-needs-text,
.aieo-product-needs--pills .aieo-product-needs-link {
    color: var(--aieo-pn-pill-text, #333333);
}
.aieo-product-needs--pills .aieo-product-needs-link:hover {
    text-decoration: underline;
}
.aieo-product-needs--pills .aieo-product-needs-icon {
    width: 16px;
    height: 16px;
    color: var(--aieo-pn-icon, #27ae60);
}
.aieo-product-needs--pills .aieo-product-needs-icon svg { width: 13px; height: 13px; }
