:root {
    --azul-ponce: #0D47A1;
    --verde-ponce: #2E7D32;
    --fondo: #F8F9FA;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--fondo);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.header {
    background-color: var(--azul-ponce);
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.contenedor-principal {
    margin-top: 80px;
    margin-bottom: 40px;
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.tarjeta {
    background-color: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.campo-grupo {
    margin-bottom: 20px;
}

.etiqueta-moderna {
    font-size: 13px;
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
}

.input-contenedor {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 12px;
    background-color: white;
    overflow: hidden;
    transition: 0.3s;
}

.input-contenedor:focus-within {
    border-color: var(--azul-ponce);
    box-shadow: 0 0 0 2px rgba(13, 71, 161, 0.1);
}

.icono-input {
    padding: 14px;
    color: var(--azul-ponce);
}

.icono-retiro {
    color: #E65100;
}

.icono-entrega {
    color: var(--azul-ponce);
}

input,
textarea {
    border: none;
    outline: none;
    padding: 14px 10px;
    width: 100%;
    font-size: 15px;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 60px;
}

.btn-mapa-chico {
    background-color: rgba(13, 71, 161, 0.1);
    color: var(--azul-ponce);
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    margin-right: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-eliminar {
    background: none;
    border: none;
    color: #d32f2f;
    padding: 14px;
    cursor: pointer;
    font-size: 16px;
}

.btn-outline {
    width: 100%;
    padding: 14px;
    background-color: transparent;
    border: 1.5px dashed var(--azul-ponce);
    color: var(--azul-ponce);
    border-radius: 12px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-outline.retiro {
    border-color: #E65100;
    color: #E65100;
}

.btn-outline.rojo {
    border: 1.5px solid #d32f2f;
    color: #d32f2f;
}

.btn-principal {
    width: 100%;
    padding: 16px;
    background-color: var(--verde-ponce);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}

.btn-principal:disabled {
    background-color: #9e9e9e;
    cursor: not-allowed;
    box-shadow: none;
}

.separador {
    height: 1px;
    background-color: #eee;
    margin: 25px 0;
}

.prefijo {
    background-color: #f1f3f4;
    padding: 14px 16px;
    font-weight: bold;
    color: #333;
    border-right: 1px solid #ddd;
}

/* --- MODALES --- */
.modal-fondo {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-contenido {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: var(--azul-ponce);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.modal-cerrar {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.mapa-busqueda {
    display: flex;
    padding: 10px;
    gap: 8px;
    background: #f1f3f4;
    align-items: center;
}

.contenedor-buscador {
    position: relative;
    flex: 1;
    display: flex;
}

.contenedor-buscador input {
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 10px;
    width: 100%;
}

.lista-sugerencias {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 2000;
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
    display: none;
}

.lista-sugerencias li {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}

.lista-sugerencias li:hover {
    background-color: #f1f3f4;
    color: var(--azul-ponce);
    font-weight: bold;
}

.btn-gps {
    background: #E65100;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 16px;
}

#contenedor-mapa {
    width: 100%;
    height: 350px;
    background: #ddd;
}

.modal-footer {
    padding: 16px;
}

/* --- VISTAS DEL PEDIDO --- */
#vista-tracking,
#vista-finalizado,
#vista-cancelado {
    display: none;
    text-align: center;
}

.radar-box {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 30px auto;
    background: rgba(13, 71, 161, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.5s;
}

.radar-box.aceptado {
    background: rgba(46, 125, 50, 0.1);
}

.radar-box i {
    font-size: 50px;
    color: var(--azul-ponce);
    z-index: 2;
    transition: 0.5s;
}

.radar-box.aceptado i {
    color: var(--verde-ponce);
}

.radar-wave {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--azul-ponce);
    border-radius: 50%;
    opacity: 0;
    animation: wave 2s infinite;
    z-index: 1;
}

@keyframes wave {
    0% {
        transform: scale(0.5);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.estado-titulo {
    font-size: 24px;
    font-weight: bold;
    color: var(--azul-ponce);
    margin-bottom: 5px;
}

.estado-sub {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.precio-box {
    background: #FFF9C4;
    color: #F57F17;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 22px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 20px;
    border: 2px solid #FFF59D;
    transition: 0.3s;
}

.repartidor-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    text-align: left;
    display: none;
}

.repartidor-info-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.repartidor-avatar {
    width: 50px;
    height: 50px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--verde-ponce);
    font-size: 24px;
}

.repartidor-nombre {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.repartidor-vehiculo {
    font-size: 13px;
    color: #777;
    margin: 4px 0 0 0;
}

.repartidor-acciones {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-chat {
    flex: 1;
    background: #E3F2FD;
    color: #1565C0;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-wsp {
    flex: 1;
    background: #E8F5E9;
    color: #2E7D32;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.icono-finalizado {
    font-size: 80px;
    color: var(--verde-ponce);
    margin: 30px 0;
    animation: pop 0.5s ease-out;
}

.icono-cancelado {
    font-size: 80px;
    color: #d32f2f;
    margin: 30px 0;
    animation: pop 0.5s ease-out;
}

@keyframes pop {
    0% { transform: scale(0); }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* --- CHAT WEB --- */
#modal-chat .modal-contenido {
    height: 80vh;
    max-height: 600px;
    background: #e5ddd5;
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mensaje {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}

.msg-cliente {
    background: #dcf8c6;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.msg-repartidor {
    background: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-input-area {
    background: #f0f0f0;
    padding: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    border-radius: 20px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    outline: none;
}

.btn-enviar-msg {
    background: var(--verde-ponce);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
}

/* --- VISTA DE SERVICIOS (MENÚ INICIAL) --- */
.grid-servicios {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tarjeta-servicio {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.tarjeta-servicio:hover {
    border-color: var(--azul-ponce);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(13, 71, 161, 0.08);
}

.icono-servicio {
    width: 55px;
    height: 55px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin-right: 16px;
}

.info-servicio {
    flex: 1;
}

.info-servicio h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #333;
}

.info-servicio p {
    margin: 0;
    font-size: 13px;
    color: #777;
}

.flecha-servicio {
    color: #ccc;
    font-size: 16px;
}

.btn-volver {
    background: transparent;
    border: none;
    color: #666;
    font-weight: bold;
    font-size: 14px;
    padding: 0;
    margin-bottom: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-volver:hover {
    color: var(--azul-ponce);
}

/* --- VISTA DE SERVICIOS (NUEVO) --- */
        .grid-servicios { display: flex; flex-direction: column; gap: 15px; }
        .tarjeta-servicio { display: flex; align-items: center; background: #ffffff; border: 1px solid #e0e0e0; border-radius: 16px; padding: 16px; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
        .tarjeta-servicio:hover { border-color: var(--azul-ponce); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(13, 71, 161, 0.08); }
        .icono-servicio { width: 55px; height: 55px; border-radius: 14px; display: flex; justify-content: center; align-items: center; font-size: 24px; margin-right: 16px; }
        .info-servicio { flex: 1; }
        .info-servicio h3 { margin: 0 0 4px 0; font-size: 16px; color: #333; }
        .info-servicio p { margin: 0; font-size: 13px; color: #777; }
        .flecha-servicio { color: #ccc; font-size: 16px; }
        .btn-volver { background: transparent; border: none; color: #666; font-weight: bold; font-size: 14px; padding: 0; margin-bottom: 20px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
        .btn-volver:hover { color: var(--azul-ponce); }