/* ==========================================================================
   WC Contact Lens – Frontend Styles
   ========================================================================== */

/* Contenedor principal del formulario */
.wcl-lens-form {
    margin: 24px 0;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fafafa;
    font-family: inherit;
}

.wcl-form-title {
    margin: 0 0 16px;
    font-size: 1.1em;
    font-weight: 600;
    color: #1a202c;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

/* Sección por ojo */
.wcl-eye-section {
    margin-bottom: 20px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.wcl-eye-section:last-of-type {
    margin-bottom: 10px;
}

.wcl-eye-section.wcl-eye-active {
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66,153,225,0.2);
}

/* Toggle de activación del ojo */
.wcl-eye-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.wcl-eye-toggle:hover {
    background: #f0f4f8;
}

.wcl-eye-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4299e1;
    flex-shrink: 0;
}

.wcl-eye-label {
    font-weight: 600;
    font-size: 1em;
    color: #2d3748;
}

/* Contenedor de campos (visible solo cuando se activa el ojo) */
.wcl-eye-fields {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

/* Grid de campos de fórmula */
.wcl-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.wcl-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wcl-field-wrap label {
    font-size: 0.8em;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wcl-required {
    color: #e53e3e;
    margin-left: 2px;
}

.wcl-rx-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9em;
    background: #fff;
    color: #2d3748;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: auto;
}

.wcl-rx-select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66,153,225,0.2);
}

.wcl-rx-select.wcl-error {
    border-color: #e53e3e;
}

/* Selector de cantidad por ojo */
.wcl-qty-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #edf2f7;
}

.wcl-qty-wrap label {
    font-size: 0.85em;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}

.wcl-qty-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    overflow: hidden;
    width: 110px;
}

.wcl-qty-btn {
    width: 32px;
    height: 34px;
    background: #edf2f7;
    border: none;
    font-size: 1.2em;
    line-height: 1;
    color: #4a5568;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wcl-qty-btn:hover {
    background: #e2e8f0;
    color: #1a202c;
}

.wcl-qty-input {
    width: 46px;
    height: 34px;
    border: none;
    border-left: 1px solid #cbd5e0;
    border-right: 1px solid #cbd5e0;
    text-align: center;
    font-size: 0.9em;
    font-weight: 600;
    color: #2d3748;
    background: #fff;
    -moz-appearance: textfield;
}

.wcl-qty-input::-webkit-inner-spin-button,
.wcl-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wcl-qty-input:focus {
    outline: none;
    background: #f0f7ff;
}

/* Nota al pie del formulario */
.wcl-note {
    margin: 10px 0 0;
    color: #718096;
    font-size: 0.8em;
}

/* Ocultar la cantidad nativa de WooCommerce */
.wcl-hidden-native-qty {
    display: none !important;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .wcl-fields-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .wcl-qty-wrap {
        flex-wrap: wrap;
    }
}
