/* WAMS Fitment Resolver — picker
 *
 * Palette and banner construction deliberately mirror wams-validator.css so the
 * resolver and the validator read as one system on the product page.
 *
 * All sizing is px, never rem. The Argent theme sets html{font-size} below 16px,
 * so rem-based sizing renders too small. This has bitten front-end work here
 * before; do not "clean it up" into rem.
 */

.wfr-picker {
    /* Force full width whatever the picker is dropped into. Options plugins render
       fields inside tables, flex rows and narrow cells, and the picker relocates
       itself into that markup — so it cannot rely on inheriting a sensible width.
       Mirrors the same defence in wams-validator.css. */
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex-basis: 100%;
    flex-grow: 1;
    align-self: stretch;
    grid-column: 1 / -1;
    clear: both;
    /* Tight underneath: whatever field follows brings its own spacing, and the
       picker sitting a long way above the sign-off it relates to reads as
       unfinished. */
    margin: 14px 0 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #2d3748;
}

.wfr-head {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 2px;
}

.wfr-req { color: #e53e3e; font-weight: 600; }

.wfr-hint {
    font-size: 12px;
    color: #718096;
    margin: 0 0 12px;
}

.wfr-hint a { color: #2b6cb0; text-decoration: underline; }

.wfr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.wfr-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 5px;
}

.wfr-field select {
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.4;
    padding: 9px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    background-color: #fff;
    color: #2d3748;
    max-width: none;
}

.wfr-field select:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.18);
}

.wfr-field select:disabled {
    background-color: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

.wfr-field option:disabled { color: #a0aec0; }

/* A dimension with only one possible answer is shown as settled, not asked. */
.wfr-fixed {
    font-size: 13px;
    padding: 9px 10px;
    border: 1px dashed #cbd5e0;
    border-radius: 5px;
    background: #f7fafc;
    color: #4a5568;
}

.wfr-fixed strong { color: #22543d; }

/* Banner — same construction as #wams-pv-banner */
.wfr-banner {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 14px 0 0;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    border-left: 5px solid transparent;
    transition: background 0.2s ease;
}

.wfr-banner .wfr-sub {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.85;
}

.wfr-banner.is-prompt { background: #ebf8ff; border-color: #3182ce; color: #2a4365; }
.wfr-banner.is-ok     { background: #f0fff4; border-color: #38a169; color: #22543d; }
.wfr-banner.is-warn   { background: #fffbeb; border-color: #d97706; color: #7c4a03; font-weight: 500; }
.wfr-banner.is-error  { background: #fff5f5; border-color: #e53e3e; color: #742a2a; }

.wfr-price {
    margin: 12px 0 0;
    font-size: 13px;
    color: #4a5568;
}

.wfr-price strong {
    font-size: 18px;
    color: #2d3748;
    font-weight: 700;
}

/* Row-level advisory. Amber and boxed so it reads as a caution rather than part
   of the green confirmation above it, but calm enough not to look like an error. */
.wfr-warning {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 10px 0 0;
    padding: 12px 14px;
    border: 1px solid #d97706;
    border-left-width: 4px;
    border-radius: 4px;
    background: #fffbeb;
    color: #7c4a03;
    font-size: 14px;
    line-height: 1.5;
}
.wfr-warning strong { color: #7c4a03; }
.wfr-warn-rule { border: 0; border-top: 1px solid #f0c674; margin: 10px 0; }
.wfr-warning a { color: #7c4a03; text-decoration: underline; }
.wfr-warning p { margin: 0 0 8px; }
.wfr-warning p:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
    .wfr-warning { padding: 11px 13px; font-size: 13px; }
}

/* When the picker is injected as its own table row, the table's cell padding
   would add a second gap on top of the picker's margin. */
tr.wfr-host-row > td.wfr-host-cell {
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
}

tr.wfr-host-row > td.wfr-host-cell .wfr-picker {
    margin: 10px 0 2px;
}

/* Sitting between two option tables: keep the picker visually attached to the
   field above it and the sign-off below, rather than floating between them. */
.wfr-picker + table.extra-options,
table.extra-options + .wfr-picker {
    margin-top: 0;
}

/* Mobile. Selects go full width and stack; 16px on inputs specifically, because
   iOS Safari zooms the viewport on focus for anything smaller. */
@media (max-width: 600px) {
    .wfr-grid { grid-template-columns: 1fr; gap: 10px; }
    .wfr-field select,
    .wfr-fixed { font-size: 16px; padding: 11px 10px; }
    .wfr-picker { margin: 14px 0; }
    .wfr-banner { padding: 11px 13px; font-size: 13px; }
    .wfr-price strong { font-size: 17px; }
    .wfr-head { font-size: 15px; }
}

/* Narrow containers: a table cell the picker was dropped into can be far narrower
   than the viewport, so match on the element rather than the screen. */
@container (max-width: 420px) {
    .wfr-grid { grid-template-columns: 1fr; }
}
