/* ─────────────────────────────────────────────────────────────────────────────
   MWN Quote Form — Product Selector Styles
   Adjust custom properties to match the site theme.
───────────────────────────────────────────────────────────────────────────── */

:root {
    --mwn-ps-accent:       #1d6ef5;
    --mwn-ps-accent-hover: #1557d0;
    --mwn-ps-bg:           #ffffff;
    --mwn-ps-border:       #e0e0e0;
    --mwn-ps-border-sel:   #1d6ef5;
    --mwn-ps-shadow:       0 2px 8px rgba(0,0,0,.08);
    --mwn-ps-shadow-sel:   0 0 0 3px rgba(29,110,245,.25);
    --mwn-ps-text:         #111111;
    --mwn-ps-subtext:      #666666;
    --mwn-ps-radius:       10px;
    --mwn-ps-swatch-size:  80px;
    --mwn-ps-tick-size:    22px;
}

/* ── Wrapper ── */
.mwn-product-selector {
    margin: 24px 0;
    font-family: inherit;
}

.mwn-ps-header {
    margin-bottom: 16px;
}

.mwn-ps-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--mwn-ps-text);
    margin: 0 0 4px;
}

.mwn-ps-hint {
    font-size: 0.85rem;
    color: var(--mwn-ps-subtext);
    margin: 0;
}

/* ── Group label (taxonomy) ── */
.mwn-ps-group-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--mwn-ps-subtext);
    margin: 20px 0 10px;
}

/* ── Grid ── */
.mwn-ps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

@media (max-width: 480px) {
    .mwn-ps-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Individual item ── */
.mwn-ps-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    background: var(--mwn-ps-bg);
    border: 2px solid var(--mwn-ps-border);
    border-radius: var(--mwn-ps-radius);
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
    text-align: center;
    font: inherit;
}

.mwn-ps-item:hover {
    border-color: var(--mwn-ps-border-sel);
    transform: translateY(-2px);
    box-shadow: var(--mwn-ps-shadow);
}

.mwn-ps-item.is-selected,
.mwn-ps-item[aria-pressed="true"] {
    border-color: var(--mwn-ps-border-sel);
    box-shadow: var(--mwn-ps-shadow-sel);
}

/* ── Swatch ── */
.mwn-ps-swatch {
    width: var(--mwn-ps-swatch-size);
    height: var(--mwn-ps-swatch-size);
    border-radius: 6px;
    overflow: hidden;
    display: block;
    background: #f0f0f0;
    flex-shrink: 0;
}

.mwn-ps-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mwn-ps-colour-block {
    display: block;
    width: 100%;
    height: 100%;
}

.mwn-ps-no-colour {
    background: repeating-linear-gradient(
        45deg,
        #e0e0e0,
        #e0e0e0 5px,
        #f5f5f5 5px,
        #f5f5f5 10px
    );
}

/* ── Label ── */
.mwn-ps-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--mwn-ps-text);
    line-height: 1.3;
    word-break: break-word;
}

/* ── Tick indicator ── */
.mwn-ps-tick {
    position: absolute;
    top: 6px;
    right: 6px;
    width: var(--mwn-ps-tick-size);
    height: var(--mwn-ps-tick-size);
    background: var(--mwn-ps-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transform: scale(.5);
    transition: opacity .2s ease, transform .2s cubic-bezier(.34, 1.56, .64, 1);
    pointer-events: none;
}

.mwn-ps-tick svg {
    width: 12px;
    height: 12px;
}

.mwn-ps-item.is-selected .mwn-ps-tick,
.mwn-ps-item[aria-pressed="true"] .mwn-ps-tick {
    opacity: 1;
    transform: scale(1);
}

/* ── Selection summary ── */
.mwn-ps-selection-summary {
    margin-top: 14px;
    padding: 10px 14px;
    background: #f7f9ff;
    border-left: 3px solid var(--mwn-ps-accent);
    border-radius: 0 6px 6px 0;
    font-size: 0.875rem;
    color: var(--mwn-ps-text);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mwn-ps-summary-label {
    font-weight: 600;
    color: var(--mwn-ps-subtext);
    flex-shrink: 0;
}

.mwn-ps-summary-items {
    color: var(--mwn-ps-text);
}

/* ── Validation error state ── */
.mwn-product-selector.has-error .mwn-ps-grid {
    outline: 2px solid #e53e3e;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ── File upload area (CF7 file field enhancement) ── */
.wpcf7-form .mwn-file-upload-wrap {
    margin: 20px 0;
}

.wpcf7-form input[type="file"] {
    display: block;
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--mwn-ps-border);
    border-radius: var(--mwn-ps-radius);
    background: #fafafa;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--mwn-ps-subtext);
    transition: border-color .2s ease;
}

.wpcf7-form input[type="file"]:hover,
.wpcf7-form input[type="file"]:focus {
    border-color: var(--mwn-ps-accent);
    outline: none;
    background: #f0f5ff;
}

/* ── Step labels (optional section headings inside the form) ── */
.mwn-form-section {
    margin: 32px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--mwn-ps-border);
}

.mwn-form-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--mwn-ps-text);
}

.mwn-form-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--mwn-ps-accent);
    color: #fff;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── No products message ── */
.mwn-no-products {
    color: var(--mwn-ps-subtext);
    font-style: italic;
    padding: 12px;
    border: 1px solid var(--mwn-ps-border);
    border-radius: var(--mwn-ps-radius);
}
