/* ═══════════════════════════════════════════
   CONSULTA DE STOCK v2 — FRONTEND STYLES
   ═══════════════════════════════════════════ */

/* ─── BOTÓN CONSULTAR ─── */
.cs-wrap { display: inline-block; margin: 8px 0; }

.cs-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    background: #1a1a2e;
    color: #fff !important;
    border: 2px solid #1a1a2e;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s, transform .15s;
    letter-spacing: .02em;
    line-height: 1;
    text-decoration: none;
    font-family: inherit;
}
.cs-btn:hover, .cs-btn:focus {
    background: transparent;
    color: #1a1a2e !important;
    transform: translateY(-1px);
    outline: 2px solid #1a1a2e;
    outline-offset: 2px;
}
.cs-btn-loop { padding: 10px 18px; font-size: 13px; }

/* ─── OVERLAY: oculto por defecto ─── */
.cs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.cs-overlay.cs-visible {
    display: flex;
    animation: cs-fade-in .2s ease;
}
@keyframes cs-fade-in { from { opacity:0 } to { opacity:1 } }

/* Bloquear scroll del body cuando popup abierto */
body.cs-no-scroll { overflow: hidden !important; }

/* ─── MODAL ─── */
.cs-modal {
    background: #fff;
    border-radius: 12px;
    padding: 36px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: cs-slide-up .25s ease;
    box-sizing: border-box;
}
@keyframes cs-slide-up { from { transform:translateY(20px); opacity:0 } to { transform:translateY(0); opacity:1 } }

/* ─── BOTÓN CERRAR ─── */
.cs-cerrar {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    padding: 0;
    font-family: inherit;
}
.cs-cerrar:hover { background: #ddd; color: #1a1a2e; }
.cs-cerrar:focus { outline: 2px solid #1a1a2e; outline-offset: 2px; }

/* ─── CABECERA ─── */
.cs-modal-header { text-align: center; margin-bottom: 20px; }
.cs-icono-wrap {
    width: 56px; height: 56px;
    background: #f0f4ff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    color: #1a1a2e;
}
.cs-modal-header h2 {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: none !important;
    line-height: 1.3 !important;
}
.cs-subtitulo { font-size: 14px; color: #666; margin: 0; line-height: 1.5; }

/* ─── INFO PRODUCTO ─── */
.cs-producto-info {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    gap: 6px;
    align-items: flex-start;
}
.cs-producto-label { font-weight: 600; color: #333; flex-shrink: 0; }
.cs-producto-nombre { color: #555; word-break: break-word; }

/* ─── CAMPOS ─── */
.cs-campo { margin-bottom: 16px; }
.cs-campo label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
.cs-opcional { font-size: 11px; font-weight: 400; color: #999; }
.cs-campo input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    font-family: inherit;
}
.cs-campo input:focus {
    outline: none;
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26,26,46,.08);
}
.cs-campo input::placeholder { color: #aaa; }

.cs-fila-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── CAPTCHA ─── */
.cs-captcha-wrap { margin: 16px 0; display: flex; justify-content: center; }
@media (max-width: 400px) {
    .cs-captcha-wrap .h-captcha,
    .cs-captcha-wrap .g-recaptcha { transform: scale(.88); transform-origin: center left; }
}

/* ─── MENSAJES ─── */
.cs-error {
    background: #fef0f0;
    border-left: 3px solid #d63638;
    color: #c0392b;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 14px;
}
.cs-exito {
    background: #edfaef;
    border-left: 3px solid #00a32a;
    color: #1a6b2a;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 14px;
    text-align: center;
}

/* ─── BOTÓN SUBMIT ─── */
.cs-submit {
    width: 100%;
    padding: 14px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    font-family: inherit;
}
.cs-submit:hover { background: #2d2d4e; transform: translateY(-1px); }
.cs-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.cs-submit:focus { outline: 2px solid #1a1a2e; outline-offset: 3px; }

/* ─── SPINNER ─── */
@keyframes cs-spin { from { transform:rotate(0deg) } to { transform:rotate(360deg) } }
.cs-spin { animation: cs-spin .8s linear infinite; }

/* ─── PRIVACIDAD ─── */
.cs-privacidad { text-align: center; font-size: 12px; color: #aaa; margin: 10px 0 0; }
.cs-privacidad a { color: #888; text-decoration: underline; }

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
    .cs-fila-dos { grid-template-columns: 1fr; }
    .cs-modal { padding: 24px 18px; border-radius: 10px; }
    .cs-btn-loop { padding: 8px 14px; font-size: 12px; }
}
