/**
 * Plantilla CTS 2026 — assets/css/search-modal.css
 * Overlay de búsqueda modal — semitransparente, centrado, responsive.
 */

/* ============================================================
   OVERLAY — fondo oscuro semitransparente
   ============================================================ */
#cts-search-modal {
    position: fixed;
    inset: 0;                                   /* top/right/bottom/left: 0 */
    z-index: 999999;
    background: rgba(10, 14, 20, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;

    /* Estado inicial: oculto */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#cts-search-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ============================================================
   BOX — contenedor central con el input
   ============================================================ */
.cts-search-modal__box {
    position: relative;
    width: 100%;
    max-width: 660px;
    transform: translateY(-18px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.25s ease;
    opacity: 0;
}

#cts-search-modal.is-open .cts-search-modal__box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ============================================================
   TEXTO GUÍA
   ============================================================ */
.cts-search-modal__hint {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 0 0.75rem 0;
    text-align: center;
}

/* ============================================================
   FORMULARIO
   ============================================================ */
.cts-search-modal__form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 50px;
    padding: 0.35rem 0.35rem 0.35rem 1.5rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.cts-search-modal__form:focus-within {
    border-color: #5A9C20;
    background: rgba(255, 255, 255, 0.11);
}

/* ============================================================
   INPUT
   ============================================================ */
.cts-search-modal__input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 1.2rem;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.4;
    padding: 0.55rem 0;
    caret-color: #FFC800;
    min-width: 0;
}

.cts-search-modal__input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Quitar el ícono nativo del navegador en el campo search */
.cts-search-modal__input::-webkit-search-decoration,
.cts-search-modal__input::-webkit-search-cancel-button,
.cts-search-modal__input::-webkit-search-results-button,
.cts-search-modal__input::-webkit-search-results-decoration {
    display: none;
}

/* ============================================================
   BOTÓN SUBMIT (lupa dentro del input)
   ============================================================ */
.cts-search-modal__submit {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: #5A9C20;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.cts-search-modal__submit:hover {
    background: #e6b400;
    transform: scale(1.06);
}

.cts-search-modal__submit:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ============================================================
   BOTÓN CERRAR (×) — esquina superior derecha del overlay
   ============================================================ */
.cts-search-modal__close {
    position: absolute;
    top: -3rem;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cts-search-modal__close:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.cts-search-modal__close:focus-visible {
    outline: 2px solid #FFC800;
    outline-offset: 2px;
}

/* ============================================================
   BLOQUEAR SCROLL DEL BODY cuando el modal está activo
   ============================================================ */
body.cts-search-modal--active {
    overflow: hidden;
}

/* ============================================================
   OCULTAR el buscador inline original del tema cuando el
   modal está activo (por si el inline script lo abre igual)
   ============================================================ */
body.cts-search-modal--active #cts-search-overlay {
    display: none !important;
}

/* ============================================================
   RESPONSIVE — ajustes móvil
   ============================================================ */
@media (max-width: 600px) {
    #cts-search-modal {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 5rem;
    }

    .cts-search-modal__box {
        max-width: 100%;
    }

    .cts-search-modal__input {
        font-size: 1rem;
    }

    .cts-search-modal__close {
        top: -3.2rem;
        right: 0;
    }
}
