/* =====================================================
   Modal Contacto – Overlay & Layout
   Estas reglas NO dependen de valores arbitrarios de Tailwind
   que podrían no estar en el CSS compilado.
   ===================================================== */

/* Overlay base: cubre toda la ventana */
#modal-contacto {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000 !important;
    /* display gestionado por JS (flex / none) */
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 1rem;
}

/* Fondo oscuro semitransparente */
#modal-contacto-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 0;
    cursor: pointer;
}

/* Wrapper que centra el panel */
#modal-contacto-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 768px;
    margin: auto;
    padding: 1.5rem 0;
}

/* Panel blanco con bordes redondeados */
.contact-modal-panel {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    position: relative;
    width: 100%;
    /* Scrollbar delgado en Firefox */
    scrollbar-width: thin;
    scrollbar-color: #c80045 #f1f1f1;
}

@media (min-width: 768px) {
    .contact-modal-panel {
        padding: 2.5rem;
    }
}

/* Scrollbar WebKit para el panel */
.contact-modal-panel::-webkit-scrollbar {
    width: 6px;
}
.contact-modal-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.contact-modal-panel::-webkit-scrollbar-thumb {
    background: #c80045;
    border-radius: 10px;
}
.contact-modal-panel::-webkit-scrollbar-thumb:hover {
    background: #990033;
}

/* Botón de cierre (X) */
#modal-contacto-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s ease;
    z-index: 10;
    padding: 0;
    line-height: 1;
}
#modal-contacto-close:hover {
    color: #c80045;
}
#modal-contacto-close svg {
    width: 1.75rem;
    height: 1.75rem;
}

/* Colores de marca (fallback si Tailwind no los genera) */
.text-danger-400  { color: #c80045; }
.bg-danger-400    { background-color: #c80045; }
.border-danger-400 { border-color: #c80045; }
.hover\:bg-danger-500:hover { background-color: #a00037; }
.focus\:border-danger-400:focus { border-color: #c80045; }

/* Inputs del formulario dentro del modal */
#form-contacto-producto input,
#form-contacto-producto select,
#form-contacto-producto textarea {
    outline: none;
    transition: border-color 0.2s ease;
}
#form-contacto-producto input:focus,
#form-contacto-producto select:focus,
#form-contacto-producto textarea:focus {
    border-color: #c80045;
}

/* Placeholder */
#modal-contacto ::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Selects: quitar flecha nativa */
#modal-contacto select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Botón de submit */
#form-contacto-producto button[type="submit"] {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
}
#form-contacto-producto button[type="submit"]:hover {
    transform: translateY(-1px);
}
#form-contacto-producto button[type="submit"]:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Mensaje de error / éxito inline */
#form-contacto-feedback {
    border-radius: 6px;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: none;
}
#form-contacto-feedback.is-error {
    display: block;
    background: #fee2e2;
    color: #b91c1c;
}
#form-contacto-feedback.is-success {
    display: block;
    background: #dcfce7;
    color: #15803d;
}

/* Campo material (solo lectura) */
#contact-material-name {
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 2px solid #d1d5db;
    background: transparent;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}
#contact-material-name:focus {
    border-bottom-color: #c80045;
}

/* =====================================================
   Modal Ticket Success
   ===================================================== */
#modal-ticket-success {
    display: none;
    align-items: center;
    justify-content: center;
}

#modal-ticket-panel {
    animation: ticketModalIn 0.3s ease;
}

@keyframes ticketModalIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

#modal-ticket-close-btn {
    transition: background 0.2s ease, transform 0.15s ease;
}
#modal-ticket-close-btn:hover {
    transform: scale(1.08);
}
