/* YerxVision Lens Kit — Frontend Styles */
:root {
    --yerx-accent: #8b0000;
    --yerx-radius: 12px;
    --yerx-vendor-bg: #f1f5f9;
    --yerx-vendor-text: #0f172a;
}

/* Карточка продавца */
.yerx-vendor-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--yerx-vendor-bg);
    border-radius: calc(var(--yerx-radius) - 2px);
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.yerx-vendor-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.yerx-vendor-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--yerx-vendor-text);
    font-weight: 600;
    font-size: 14px;
    transition: opacity .2s;
}
.yerx-vendor-link:hover { opacity: .75; }
.yerx-vendor-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.yerx-vendor-rating { font-size: 12px; color: #f59e0b; letter-spacing: -1px; }
.yerx-vendor-rating-num { font-size: 11px; color: #64748b; letter-spacing: 0; margin-left: 2px; }
.yerx-vendor-arrow { font-size: 16px; color: #94a3b8; }

/* Общие */
.yerx-block-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}
.yerx-form-group { margin-bottom: 11px; }
.yerx-form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.yerx-rx-section-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    margin: 14px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.yerx-select,
.yerx-rx-container input[type="text"],
.yerx-rx-container input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: calc(var(--yerx-radius) - 4px);
    background: #fff;
    font-size: 14px;
    color: #1e293b;
    height: 40px;
    box-sizing: border-box;
    transition: border-color .2s;
}
.yerx-select:focus,
.yerx-rx-container input:focus {
    outline: none;
    border-color: var(--yerx-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--yerx-accent) 15%, transparent);
}

/* Блок линз */
.yerx-lens-selector-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--yerx-radius);
    padding: 18px;
    margin: 16px 0;
    box-sizing: border-box;
    width: 100%;
    clear: both;
}
.yerx-master-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    cursor: pointer;
}
.yerx-master-toggle-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--yerx-accent);
    cursor: pointer;
    flex-shrink: 0;
}
.yerx-master-toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    user-select: none;
    cursor: pointer;
}
.yerx-master-work-info {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 10px;
    font-size: 13px;
    color: #334155;
    justify-content: space-between;
    align-items: center;
}
.yerx-master-price { font-weight: 700; color: var(--yerx-accent); }

/* Доплата у цены */
.yerx-price-addon {
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--yerx-radius);
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.7;
}
.yerx-addon-row { color: #475569; }
.yerx-addon-row strong { color: #1e293b; }
.yerx-addon-total { margin-top: 4px; font-size: 15px; font-weight: 700; color: #0f172a; }

/* Кнопка раскрытия */
.yerx-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 20px;
    background: #fff;
    color: var(--yerx-accent);
    border: 2px solid var(--yerx-accent);
    border-radius: calc(var(--yerx-radius) - 2px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.yerx-toggle-btn:hover,
.yerx-toggle-btn.is-active { background: var(--yerx-accent); color: #fff; }

/* Подсказка рецепта */
.yerx-rx-wrapper {
    margin: 14px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.yerx-notice-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--yerx-radius);
    padding: 12px 16px;
    margin-bottom: 10px;
}
.yerx-notice-text { font-size: 13px; line-height: 1.5; color: #475569; margin: 0; }

/* Форма рецепта */
.yerx-rx-container {
    background: #fdfdfd;
    border: 1px solid #eef2f5;
    border-radius: var(--yerx-radius);
    padding: 18px;
    margin-top: 10px;
    animation: yerxFadeIn .25s ease;
}
@keyframes yerxFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.yerx-eye-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 6px;
}
.yerx-field-group { display: flex; flex-direction: column; }
.yerx-field-group label {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
    text-transform: uppercase;
}

/* Покрытия — список с тоглами */
.yerx-options-list {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    padding: 6px 12px;
}
.yerx-option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
}
.yerx-option-item:last-child { border-bottom: none; }
.yerx-option-item > label:first-child {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
}

/* Toggle switch */
.yerx-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.yerx-switch input { opacity: 0; width: 0; height: 0; }
.yerx-slider { position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; border-radius: 24px; transition: .25s; }
.yerx-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .25s; }
.yerx-switch input:checked + .yerx-slider { background: var(--yerx-accent); }
.yerx-switch input:checked + .yerx-slider:before { transform: translateX(20px); }

/* Радио-теги */
.yerx-radio-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.yerx-radio-tags input[type="radio"] { display: none; }
.yerx-radio-tags label {
    padding: 5px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
    color: #334155;
    transition: .2s;
    display: inline-block;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 500;
}
.yerx-radio-tags input[type="radio"]:checked + label {
    background: var(--yerx-accent);
    color: #fff;
    border-color: var(--yerx-accent);
}

/* Зона загрузки */
.yerx-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: calc(var(--yerx-radius) - 2px);
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: #fff;
    margin-bottom: 10px;
}
.yerx-upload-area:hover,
.yerx-upload-area.is-dragover { border-color: var(--yerx-accent); background: #fff8f8; }
.yerx-upload-prompt { display: flex; flex-direction: column; align-items: center; gap: 5px; color: #94a3b8; font-size: 13px; }
.yerx-upload-preview { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; }
.yerx-upload-file-name { font-size: 13px; color: #334155; font-weight: 500; word-break: break-all; }
.yerx-upload-remove {
    background: #fee2e2;
    border: none;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}
.yerx-upload-status { font-size: 12px; margin-top: 4px; min-height: 16px; color: #64748b; }
.yerx-upload-status.uploading { color: #2563eb; }
.yerx-upload-status.success   { color: #16a34a; }
.yerx-upload-status.error     { color: #dc2626; }

/* Предупреждение без рецепта */
.yerx-rx-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #92400e;
    margin-top: 10px;
}

/* Адаптив */
@media (max-width: 640px) { .yerx-eye-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) { .yerx-eye-grid { grid-template-columns: 1fr; } }
