/**
 * Otto Rx Configurator — Styles
 * Scoped to .otto-rx-configurator to avoid conflicts with the active theme.
 */

/* ── Container ────────────────────────────────────────────────────────────── */
.otto-rx-configurator {
    margin: 0 0 24px;
    padding: 0;
}

/* ── Individual field block ───────────────────────────────────────────────── */
.otto-rx-field:not(:last-child) {
    margin-bottom: 24px;
}
/*.otto-rx-field {
    margin-bottom: 24px;
    padding: 20px 22px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.2s;
}*/

.otto-rx-field.otto-rx-field--other-eye:focus-within {
    background: #00b8a2;
}
.otto-rx-field.otto-rx-field--other-eye:focus-within .otto-rx-other-eye-title, .otto-rx-field--other-eye.otto-rx-field:focus-within .otto-rx-description {
    color: #fff;
}

.otto-rx-field--error {
    border-color: #dc2626 !important;
    background: #fff5f5 !important;
}

/* ── Field label ──────────────────────────────────────────────────────────── */
/*.otto-rx-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    margin-bottom: 12px;
    cursor: default;
}*/
.otto-rx-label {
	display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #4a4f4e;
    margin-bottom: 10px;
	line-height: normal;
}
.otto-rx-field--upload .otto-rx-label {
    margin-bottom: 4px;
}

.otto-rx-required {
    color: #dc2626;
    margin-left: 3px;
}

/* ── Description text ─────────────────────────────────────────────────────── */
.otto-rx-description {
    font-size: 13px;
    color: #8a9190;
    margin: 0;
    line-height: 1.5;
}
.otto-rx-field--upload .otto-rx-description {
	margin-bottom: 10px;
}
.otto-rx-accepted {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 3px;
}

/* ── Radio group ──────────────────────────────────────────────────────────── */
.otto-rx-radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.otto-rx-field--supply .otto-rx-radio-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.otto-rx-radio-option {
    padding: 9px 18px;
    border: 1.5px solid #e6eae9;
    border-radius: 4px;
    font-size: 13.5px;
    font-weight: 500;
    color: #4a4f4e;
    background-color: #fff;
    cursor: pointer;
    transition: all .18s cubic-bezier(.4, 0, .2, 1);
    user-select: none;
    line-height: normal;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.otto-rx-field--supply .otto-rx-radio-option {
    border: 1.5px solid #e6eae9;
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    transition: all .18s cubic-bezier(.4, 0, .2, 1);
    position: relative;
	justify-content: center;
}

.otto-rx-radio-option:hover {
    border-color: #8a9190;
    color: #0c0e0d;
}
.otto-rx-radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Selected state — driven by JS class or :has() */
.otto-rx-radio-option:has(input:checked), .otto-rx-radio-option.is-selected {
	background-color: #0c0e0d;
    border-color: #0c0e0d;
    color: #fff;
}
.otto-rx-field--supply .otto-rx-radio-option:has(input:checked), .otto-rx-field--supply .otto-rx-radio-option.is-selected {
	border-color: #00b8a2;
    background-color: #e4f5f3;
	color: #0c0e0d;
}

/* Fallback for browsers without :has() — JS adds .is-selected */
@supports not selector(:has(a)) {
    .otto-rx-radio-option.is-selected {
        border-color: #1B4F8A;
        background: #1B4F8A;
        color: #ffffff;
        font-weight: 600;
    }
}

/* ── File upload area ─────────────────────────────────────────────────────── */
.otto-rx-upload-area {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    text-align: center;
    padding: 28px 20px;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.otto-rx-upload-area:hover,
.otto-rx-upload-area:focus-within {
    border-color: #1B4F8A;
    background: #f0f6ff;
}

.otto-rx-upload-area.otto-rx-drag-over {
    border-color: #1B4F8A;
    background: #e8f0fb;
}

.otto-rx-upload-area.otto-rx-has-file {
    border-color: #2e7d32;
    background: #f0fdf4;
    border-style: solid;
}

.otto-rx-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.otto-rx-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    pointer-events: none;
}

.otto-rx-upload-icon {
    font-size: 28px;
    line-height: 1;
}

.otto-rx-upload-text {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.otto-rx-upload-area.otto-rx-has-file .otto-rx-upload-text {
    color: #2e7d32;
}

.otto-rx-upload-filename {
    font-size: 13px;
    color: #374151;
    font-weight: 600;
    word-break: break-all;
    max-width: 320px;
}

/* ── Error message ────────────────────────────────────────────────────────── */
.otto-rx-error {
    font-size: 13px;
    color: #dc2626;
    margin-top: 8px;
    font-weight: 500;
}

/* ── Qty input highlight on auto-update ───────────────────────────────────── */
input.qty.otto-rx-qty-updated {
    background-color: #fff !important;
    transition: background-color 0.3s;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media ( max-width: 480px ) {
    .otto-rx-radio-group {
        flex-direction: column;
    }
    .otto-rx-radio-option {
        justify-content: flex-start;
    }
}

/* ── Other-eye section ────────────────────────────────────────────────────── */
.otto-rx-field--other-eye {
    background-color: #e6eae9;
    padding: 14px 12px;
    display: flex;
    gap: 9px;
    flex-direction: column;
    border-radius: 8px;
}

.otto-rx-other-eye-header {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.otto-rx-other-eye-title {
    font-weight: 600;
    font-size: 14px;
    color: #0c0e0d;
}

.otto-rx-other-eye-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.otto-rx-badge--left {
    background: #dbeafe;
    color: #1e40af;
}

.otto-rx-badge--right {
    background: #e4f5f3;
    color: #009688;
}

/* ── Search input ─────────────────────────────────────────────────────────── */
.otto-rx-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.otto-rx-search-icon {
    position: absolute;
    left: 12px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.otto-rx-search-input {
    width: 100%;
    padding: 10px 36px 10px 36px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.15s;
    outline: none;
}

.otto-rx-search-input:focus {
    border-color: #2E75B6;
    box-shadow: 0 0 0 3px rgba(46, 117, 182, 0.12);
}

.otto-rx-search-spinner {
    position: absolute;
    right: 12px;
    font-size: 14px;
}

/* ── Search results dropdown ──────────────────────────────────────────────── */
.otto-rx-search-results {
    list-style: none;
    margin: 4px 0 0;
    padding: 4px 0;
    background: #ffffff;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    max-height: 280px;
    overflow-y: auto;
    position: absolute;
    width: 100%;
    z-index: 9999;
    left: 0;
    top: 100%;
}

.otto-rx-search-wrap {
    position: relative;
}

.otto-rx-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.otto-rx-result-item:hover {
    background: #f0f6ff;
}

.otto-rx-result-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.otto-rx-result-name {
    flex: 1;
    font-size: 13px;
    color: #111827;
    line-height: 1.4;
}

.otto-rx-result-price {
    font-size: 13px;
    font-weight: 600;
    color: #1B4F8A;
    white-space: nowrap;
}

.otto-rx-no-results {
    padding: 12px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

/* ── Selected product card ────────────────────────────────────────────────── */
.otto-rx-selected-product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1.5px solid #2E75B6;
    border-radius: 8px;
    margin-top: 4px;
}

.otto-rx-selected-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.otto-rx-selected-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.otto-rx-selected-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.otto-rx-selected-price {
    font-size: 13px;
    color: #1B4F8A;
    font-weight: 600;
}

.otto-rx-selected-eye-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

.otto-rx-remove-other {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #9ca3af;
    line-height: 1;
    padding: 4px;
    flex-shrink: 0;
    transition: color 0.15s;
}

.otto-rx-remove-other:hover {
    color: #dc2626;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media ( max-width: 480px ) {
    .otto-rx-search-results {
        position: static;
        width: 100%;
    }
}

/* ── Supply option with price ─────────────────────────────────────────────── */
.otto-rx-supply-option .otto-rx-radio-label {
    display: block;
}

.otto-rx-supply-option-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.otto-rx-supply-price {
    font-size: 13px;
    font-weight: 700;
    color: #009688;
    display: flex;
    align-items: center;
    gap: 6px;
}

.otto-rx-supply-was {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
    text-decoration: line-through;
}

/* Selected supply option — price colour inverts */
.otto-rx-supply-option.is-selected .otto-rx-supply-price, .otto-rx-supply-option.is-selected .otto-rx-supply-unit {
    color: #009688;
}
.otto-rx-supply-option.is-selected .otto-rx-supply-was {
    color: #3a3a3a;
}

/* ── Supply unit label ($36.95 / Bottle) ─────────────────────────────────── */
.otto-rx-supply-unit {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
}

/* ── Upload uploading state ───────────────────────────────────────────────── */
.otto-rx-upload-area.otto-rx-uploading {
    border-color: #2E75B6;
    background: #f0f6ff;
    cursor: wait;
}

/* ── Add to Cart disabled during upload ──────────────────────────────────── */
.single_add_to_cart_button.otto-rx-btn-disabled,
.single_add_to_cart_button[disabled] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}


/* ── Reminder select ──────────────────────────────────────────────────────── */
.otto-rx-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background: #ffffff;
    appearance: auto;
    cursor: pointer;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.otto-rx-select:focus {
    outline: none;
    border-color: #1B4F8A;
    box-shadow: 0 0 0 3px rgba(27, 79, 138, 0.12);
}
