/**
 * AIEO Product Needs — front-end styling.
 *
 * 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. A colour, a size or a corner is printed only when the operator
 * chose one (AIEO_DMM_Product_Needs::colour_vars(), ::number_vars()); otherwise the theme's tokens draw it, in the light
 * and the dark scheme, and no colour of ours stands behind them (11.3.10, the owner: no colour of our own; a theme
 * without a token gets the text's own colour, currentColor, or a mix of it).
 *
 * Two looks (Display, "Style"):
 * - "pills", every shop's default since 11.3.10 (the designer's direction B, "Good for"): one line, the title a muted
 *   word before the needs, each need a square outline chip at 44 px in the theme's control corners, no box, no icon
 *   unless the shop gave its own;
 * - "list": the needs stacked in a box on the subtle ground, a check before each.
 */

.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, var(--wp--preset--color--subtle, color-mix(in srgb, currentColor 4%, transparent)));
    border: var(--aieo-pn-border-w, 1px) solid var(--aieo-pn-border, var(--wp--preset--color--line, color-mix(in srgb, currentColor 16%, transparent)));
    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, var(--wp--preset--color--fg, currentColor));
}

.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, var(--wp--preset--color--fg, currentColor));
    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, var(--wp--preset--color--success, currentColor));
}
.aieo-product-needs-icon svg { width: 16px; height: 16px; }

.aieo-product-needs-text { color: var(--aieo-pn-text, var(--wp--preset--color--fg, currentColor)); }
.aieo-product-needs-link {
    color: var(--aieo-pn-link, var(--wp--preset--color--accent-text, currentColor));
    text-decoration: none;
    transition: color 0.2s ease;
}
.aieo-product-needs-link:hover {
    color: var(--aieo-pn-text, var(--wp--preset--color--fg, currentColor));
    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; }

/* ---------------------------------------------------------------------------
 * Pills, the designer's "Good for" (every shop's default since 11.3.10): the title a muted word, then the needs as
 * square outline chips, 44 px tall, in one row that wraps; the row's alignment follows the setting. No box. It carries
 * its own space above (the theme's spacing-4, as the meta table's blocks do): inside the info column's cluster
 * (display: contents) the column's gap does not reach it, and it sat flush under the categories line. A shop's own pill size, corners, padding, gap, ground, line and text colour still apply
 * (--aieo-pn-pill-*), printed only when changed from the shipped values. The chip is the link (or the word when
 * links are off), so the whole 44 px is the target.
 * ------------------------------------------------------------------------- */
.aieo-product-needs--pills {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: var(--aieo-pn-align, flex-start);
    gap: var(--aieo-pn-pill-gap, var(--wp--preset--spacing--2, 8px));
    margin-top: var(--aieo-pn-mt, var(--wp--preset--spacing--4, 16px));
    margin-bottom: var(--aieo-pn-mb, 0);
    padding: 0;
    background-color: transparent;
    border: 0;
    border-radius: 0;
    font-size: var(--wp--preset--font-size--sm, 0.875rem);
}
.aieo-product-needs--pills .aieo-product-needs-title {
    margin: 0 4px 0 0;
    font-size: inherit;
    font-weight: inherit;
    color: var(--wp--preset--color--muted, currentColor);
}
.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, var(--wp--preset--spacing--2, 8px));
    width: auto;
}
.aieo-product-needs--pills .aieo-product-needs-item {
    gap: 6px;
    font-size: inherit;
    line-height: 1.2;
}
.aieo-product-needs--pills :is(.aieo-product-needs-link, .aieo-product-needs-text) {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 44px;
    padding: var(--aieo-pn-pill-pv, 0) var(--aieo-pn-pill-ph, var(--wp--preset--spacing--3, 12px));
    border: var(--aieo-pn-pill-bw, 1px) solid var(--aieo-pn-pill-bc, var(--wp--preset--color--line, color-mix(in srgb, currentColor 20%, transparent)));
    border-radius: var(--aieo-pn-pill-r, var(--wp--custom--rooster--shape--control, 0));
    background-color: var(--aieo-pn-pill-bg, transparent);
    color: var(--aieo-pn-pill-text, var(--wp--preset--color--fg, currentColor));
    font-size: var(--aieo-pn-pill-fs, inherit);
    text-decoration: none;
}
.aieo-product-needs--pills .aieo-product-needs-link:is(:hover, :focus-visible) {
    border-color: var(--aieo-pn-pill-text, var(--wp--preset--color--fg, currentColor));
    text-decoration: none;
}
.aieo-product-needs--pills .aieo-product-needs-icon {
    width: 16px;
    height: 16px;
    color: var(--aieo-pn-icon, var(--wp--preset--color--success, currentColor));
}
.aieo-product-needs--pills .aieo-product-needs-icon img,
.aieo-product-needs--pills .aieo-product-needs-icon svg { width: 13px; height: 13px; }
