/* CS Product Options — frontend styles */

/* ---------- Container ---------- */
.cspo-options {
    margin: 24px 0;
    padding: 22px 22px 18px;
    background: #ffffff;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.cspo-options__heading {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.cspo-options__intro {
    margin: 0 0 18px;
    color: #64748b;
    font-size: 13px;
}

.cspo-options__list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cspo-required {
    color: #dc2626;
    font-weight: 700;
    margin-left: 2px;
}

/* ---------- Generic field container ---------- */
.cspo-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Conditional fields fade in/out smoothly so the form doesn't snap. */
.cspo-field {
    transition: opacity .18s ease;
}
.cspo-field--hidden {
    display: none !important;
}

.cspo-field__label {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.cspo-field__desc {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.cspo-field__error {
    margin: 4px 0 0;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 500;
}

.cspo-field.cspo-field--invalid .cspo-input,
.cspo-field.cspo-field--invalid .cspo-textarea,
.cspo-field.cspo-field--invalid .cspo-select,
.cspo-field.cspo-field--invalid .cspo-file__face,
.cspo-field.cspo-field--invalid .cspo-radio__face,
.cspo-field.cspo-field--invalid .cspo-check__face {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .15) !important;
}

/* ---------- Inputs ---------- */
.cspo-input,
.cspo-textarea,
.cspo-select {
    width: 100%;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-sizing: border-box;
}
.cspo-input:focus,
.cspo-textarea:focus,
.cspo-select:focus {
    outline: 0;
    border-color: #27aae1;
    box-shadow: 0 0 0 3px rgba(39, 170, 225, .18);
    background: #ffffff;
}

.cspo-textarea { min-height: 84px; resize: vertical; }

.cspo-input--color {
    width: 64px !important;
    height: 40px;
    padding: 4px;
    background: #fff;
    cursor: pointer;
}

/* ---------- Radio cards ---------- */
.cspo-radios {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.cspo-radio { cursor: pointer; }
.cspo-radio input { position: absolute; opacity: 0; pointer-events: none; }
.cspo-radio__face {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 10px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
    transition: all .15s ease;
}
.cspo-radio:hover .cspo-radio__face {
    border-color: #cbd5e1;
    background: #f1f5f9;
}
.cspo-radio input:checked + .cspo-radio__face {
    background: #ecfeff;
    border-color: #27aae1;
    box-shadow: 0 1px 2px rgba(39, 170, 225, .15);
}
.cspo-radio input:focus-visible + .cspo-radio__face {
    outline: 2px solid #27aae1;
    outline-offset: 2px;
}
.cspo-radio__swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(15, 23, 42, .15);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, .25);
}
.cspo-radio__label {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}
.cspo-radio__price {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #fff;
    border-radius: 999px;
    padding: 2px 8px;
}

/* ---------- Checkboxes (multi) ---------- */
.cspo-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
}
.cspo-check { cursor: pointer; }
.cspo-check input { position: absolute; opacity: 0; pointer-events: none; }
.cspo-check__face {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all .15s ease;
}
.cspo-check:hover .cspo-check__face { border-color: #cbd5e1; background: #f1f5f9; }
.cspo-check input:checked + .cspo-check__face {
    background: #ecfeff;
    border-color: #27aae1;
}
.cspo-check__swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(15, 23, 42, .15);
}
.cspo-check__label {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}
.cspo-check__price {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #fff;
    border-radius: 999px;
    padding: 2px 8px;
}

/* ---------- Single-checkbox toggle ---------- */
.cspo-singlecheck {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s ease;
}
.cspo-singlecheck:hover { border-color: #cbd5e1; background: #f1f5f9; }
.cspo-singlecheck input {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: #27aae1;
}
.cspo-singlecheck__label {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cspo-singlecheck__price {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    margin-left: auto;
}

/* ---------- File upload ---------- */
.cspo-file {
    position: relative;
}
.cspo-file__input {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    opacity: 0;
}
.cspo-file__face {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    transition: all .15s ease;
}
.cspo-file:hover .cspo-file__face,
.cspo-file__input:focus-visible + .cspo-file__face {
    background: #ecfeff;
    border-color: #27aae1;
}
.cspo-file--has-file .cspo-file__face {
    border-style: solid;
    background: #ecfeff;
    border-color: #27aae1;
}
.cspo-file__icon {
    width: 36px; height: 36px;
    background: #27aae1;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.cspo-file__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cspo-file__text strong { font-size: 14px; color: #0f172a; }
.cspo-file__hint { font-size: 12px; color: #64748b; }

/* ---------- Section heading ---------- */
.cspo-section-heading {
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}
.cspo-section-heading h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}
.cspo-section-heading p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

/* ---------- Live total ---------- */
.cspo-livetotal {
    margin-top: 18px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f0f9ff, #ecfeff);
    border: 1px solid #bae6fd;
    border-radius: 12px;
}
.cspo-livetotal__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.cspo-livetotal__label {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cspo-livetotal__value {
    font-size: 26px;
    font-weight: 800;
    color: #0e7490;
    letter-spacing: -0.02em;
}
.cspo-livetotal__toggle {
    margin-top: 8px;
    background: transparent;
    border: 0;
    padding: 0;
    color: #0e7490;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}
.cspo-livetotal__breakdown {
    margin: 10px 0 0;
    padding: 10px 12px;
    list-style: none;
    background: #ffffff;
    border-radius: 8px;
    font-size: 12px;
}
.cspo-livetotal__breakdown li {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px dashed #e2e8f0;
    color: #334155;
}
.cspo-livetotal__breakdown li:last-child { border-bottom: 0; }

/* ---------- Order detail breakdown ---------- */
.cspo-order-breakdown {
    margin: 28px 0;
    padding: 18px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.cspo-order-breakdown h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #0f172a;
}
.cspo-order-breakdown__table {
    width: 100%;
    border-collapse: collapse;
}
.cspo-order-breakdown__table th,
.cspo-order-breakdown__table td {
    padding: 8px 0;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 13px;
}
.cspo-order-breakdown__table th {
    width: 35%;
    color: #475569;
    font-weight: 600;
}
.cspo-order-breakdown__hint {
    margin: 14px 0 6px;
    font-size: 12px;
    color: #64748b;
}
.cspo-order-breakdown__rows {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
}
.cspo-order-breakdown__rows li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed #e2e8f0;
}

/* ---------- Upload links + colour pills ---------- */
.cspo-upload-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #0e7490;
    text-decoration: none;
    font-weight: 600;
}
.cspo-upload-link:hover { text-decoration: underline; }
.cspo-upload-link__size {
    font-size: 11px;
    color: #94a3b8;
}
.cspo-color-pill {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    vertical-align: middle;
    border: 1px solid rgba(15, 23, 42, .15);
    margin-right: 4px;
}

/* ---------- Cart-thumbnail badge ---------- */
.cspo-cart-thumb { position: relative; display: inline-block; }
.cspo-cart-thumb__badge {
    position: absolute;
    top: -6px; left: -6px;
    background: #27aae1;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* ---------- Configure button on archives ---------- */
.cspo-configure-link {
    background: #0f172a !important;
    color: #fff !important;
}
.cspo-configure-link:hover {
    background: #1e293b !important;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
    .cspo-options { padding: 18px 16px; }
    .cspo-livetotal__value { font-size: 22px; }
    .cspo-radios { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .cspo-checks { grid-template-columns: 1fr; }
}
