/**
 * Estilos para el Sistema de Servicios Profesionales
 */

/* ========================================
   FILTROS DE SERVICIOS
======================================== */

.filtros-servicios {
    padding: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.filtro-precio-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filtro-precio-container input[type="range"] {
    flex: 1;
}

.precio-display {
    font-weight: bold;
    color: #4CAF50;
    min-width: 80px;
    text-align: right;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#contador-servicios {
    font-size: 13px;
    color: #666;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* ========================================
   LISTA DE SERVICIOS
======================================== */

#lista-servicios {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.servicio-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.servicio-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.servicio-header {
    margin-bottom: 12px;
}

.servicio-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.rating .stars {
    color: #FFA000;
}

.rating-value {
    font-weight: bold;
}

.rating-count {
    color: #666;
}

.servicio-modalidades {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    background: #E3F2FD;
    color: #1976D2;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #E8F5E9;
    color: #388E3C;
}

.certificaciones {
    margin-bottom: 10px;
}

.servicio-precio {
    margin-bottom: 12px;
}

.precio-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 14px;
}

.precio-label {
    color: #666;
}

.precio-value {
    font-weight: bold;
    color: #4CAF50;
}

.servicio-distancia {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.servicio-footer {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.btn-agendar,
.btn-ver-mas {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-agendar {
    background: #4CAF50;
    color: white;
}

.btn-agendar:hover {
    background: #45a049;
}

.btn-ver-mas {
    background: white;
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.btn-ver-mas:hover {
    background: #f1f8f4;
}

.servicio-footer.solo-ver-mas {
    justify-content: flex-end;
}

.servicio-footer.solo-ver-mas .btn-ver-mas {
    flex: unset;
    min-width: 130px;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-results p {
    margin-bottom: 12px;
}

.servicios-estado {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 16px;
    text-align: center;
    color: #0f2940;
    background: #f4f8ff;
    border: 1px solid #d6e4ff;
    border-radius: 10px;
}

.servicios-estado--error {
    color: #842029;
    background: #fff5f5;
    border-color: #f5c2c7;
}

.servicios-estado__icono {
    font-size: 28px;
}

.servicios-estado__mensaje {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.servicios-estado__accion {
    margin-top: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #0f6efd;
    background: #0f6efd;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.servicios-estado__accion:hover {
    background: #094db5;
}

body.modal-open {
    overflow: hidden;
}

/* ========================================
   MODAL DETALLE SERVICIO
======================================== */

.servicio-detalle-modal {
    position: fixed;
    inset: 0;
    z-index: 10040;
    display: none;
    align-items: center;
    justify-content: center;
}

.servicio-detalle-modal.active {
    display: flex;
}

.servicio-detalle-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
}

.servicio-detalle-dialog {
    position: relative;
    width: min(720px, 92vw);
    max-height: 90vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 55px rgba(15, 23, 42, 0.28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.servicio-detalle-cerrar {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: rgba(236, 239, 241, 0.85);
    color: #424242;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.servicio-detalle-cerrar:hover {
    background: rgba(207, 216, 220, 0.95);
    transform: scale(1.05);
}

.servicio-detalle-scroll {
    padding: 28px;
    overflow-y: auto;
}

.servicio-detalle-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.servicio-detalle-header h2 {
    margin: 6px 0 4px;
    font-size: 24px;
    color: #0f172a;
}

.servicio-detalle-categoria {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.12);
    padding: 4px 10px;
    border-radius: 999px;
}

.servicio-detalle-direccion {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.servicio-detalle-rating {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    font-weight: 600;
    color: #f59e0b;
}

.servicio-detalle-rating-count {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.servicio-detalle-galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.servicio-detalle-galeria-item {
    border-radius: 14px;
    overflow: hidden;
    height: 150px;
    background: #f1f5f9;
}

.servicio-detalle-galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.servicio-detalle-galeria-placeholder {
    border-radius: 16px;
    padding: 28px 24px;
    background: rgba(241, 245, 249, 0.8);
    border: 1px dashed #cbd5f5;
    color: #475569;
    text-align: center;
}

.servicio-detalle-galeria-icono {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
}

.servicio-detalle-seccion {
    margin-bottom: 28px;
}

.servicio-detalle-seccion h3 {
    margin: 0 0 12px;
    font-size: 18px;
    color: #0f172a;
}

.servicio-detalle-seccion p {
    margin: 0;
    color: #334155;
    line-height: 1.6;
}

.servicio-detalle-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge-outline {
    background: #fff;
    border: 1px solid #90caf9;
    color: #1976d2;
}

.servicio-detalle-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.servicio-detalle-info-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.servicio-detalle-info-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.servicio-detalle-info-value {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.servicio-detalle-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.servicio-detalle-lista li {
    background: #f9fafb;
    border-radius: 10px;
    padding: 10px 14px;
    color: #1f2937;
}

.servicio-detalle-contacto {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.servicio-detalle-contacto li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1d4ed8;
}

.servicio-detalle-contacto a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.servicio-detalle-contacto a:hover {
    text-decoration: underline;
}

.servicio-detalle-contacto-icono {
    font-size: 18px;
}

.servicio-detalle-acciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
}

.servicio-detalle-acciones .btn-primario,
.servicio-detalle-acciones .btn-secundario {
    border: none;
    border-radius: 8px;
    padding: 12px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primario {
    background: #1d4ed8;
    color: #fff;
}

.btn-primario:hover {
    box-shadow: 0 10px 20px rgba(29, 78, 216, 0.2);
    transform: translateY(-1px);
}

.btn-secundario {
    background: #fff;
    color: #1d4ed8;
    border: 1px solid rgba(29, 78, 216, 0.4);
}

.btn-secundario:hover {
    background: rgba(29, 78, 216, 0.08);
}

@media (max-width: 640px) {
    .servicio-detalle-dialog {
        width: min(95vw, 620px);
        max-height: 92vh;
        border-radius: 12px;
    }

    .servicio-detalle-scroll {
        padding: 22px 20px 24px;
    }

    .servicio-detalle-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .servicio-detalle-rating {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .servicio-detalle-acciones {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .servicio-detalle-acciones .btn-primario,
    .servicio-detalle-acciones .btn-secundario {
        width: 100%;
        justify-content: center;
    }
}


/* ========================================
   MODAL DE AGENDAMIENTO
======================================== */

.modal-agendamiento {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-agendamiento.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    z-index: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
}

.servicio-nombre {
    color: #666;
    font-size: 14px;
}

.modal-progress {
    display: flex;
    padding: 20px 25px;
    gap: 10px;
}

.progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    z-index: -1;
}

.progress-step:last-child::after {
    display: none;
}

.progress-step.active .step-number {
    background: #4CAF50;
    color: white;
}

.progress-step.active::after {
    background: #4CAF50;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s;
}

.step-label {
    font-size: 12px;
    color: #666;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.paso-contenido h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
}

/* Calendario */
.calendario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.calendario-dia {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.calendario-dia:hover {
    border-color: #4CAF50;
    background: #f1f8f4;
}

.calendario-dia.selected {
    border-color: #4CAF50;
    background: #4CAF50;
    color: white;
}

.calendario-dia.hoy {
    background: #FFF3E0;
}

.dia-nombre {
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
}

.dia-numero {
    font-size: 24px;
    font-weight: bold;
    margin: 4px 0;
}

.mes-nombre {
    font-size: 11px;
    text-transform: capitalize;
    color: #999;
}

/* Horarios */
.horario-item {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.horario-item:hover {
    border-color: #4CAF50;
    background: #f1f8f4;
}

.horario-item.selected {
    border-color: #4CAF50;
    background: #4CAF50;
    color: white;
}

.horario-item.no-disponible {
    opacity: 0.4;
    cursor: not-allowed;
}

.horario-item.no-disponible:hover {
    border-color: #e0e0e0;
    background: white;
}

.horario-hora {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.horario-tipo {
    font-size: 14px;
    text-transform: capitalize;
}

.horario-cupos {
    font-size: 12px;
    margin-top: 5px;
    color: #666;
}

.horario-item.selected .horario-cupos {
    color: rgba(255,255,255,0.9);
}

.no-horarios {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* Resumen */
.resumen-reserva {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.resumen-reserva h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
}

.resumen-item {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.resumen-item:last-child {
    border-bottom: none;
}

.precio-total {
    background: #E8F5E9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
}

.precio-total h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.precio-valor {
    font-size: 32px;
    font-weight: bold;
    color: #4CAF50;
}

/* Footer del modal */
.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-success {
    background: #4CAF50;
    color: white;
    flex: 1;
}

.btn-success:hover {
    background: #45a049;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-progress {
        padding: 15px 10px;
    }

    .step-label {
        display: none;
    }

    .calendario-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }

    #lista-servicios {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   MARCADORES EN EL MAPA
======================================== */
.servicio-marker {
    background-color: rgba(25, 118, 210, 0.92);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.marker-cluster.servicios-cluster div {
    background-color: rgba(25, 118, 210, 0.85);
}

.servicio-popup {
    max-width: 260px;
}

.servicio-popup h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #1b1b1b;
}

.servicio-popup__categoria {
    margin: 0 0 6px 0;
    font-weight: 600;
    color: #1976d2;
}

.servicio-popup__rating {
    margin: 0 0 6px 0;
    color: #ff9800;
    font-weight: 600;
}

.servicio-popup__modalidades,
.servicio-popup__precios,
.servicio-popup__descripcion {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #424242;
    line-height: 1.45;
}

.btn-agendar-popup {
    display: inline-block;
    width: 100%;
    padding: 8px 12px;
    background-color: #1976d2;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-agendar-popup:hover,
.btn-agendar-popup:focus {
    background-color: #125ea5;
}
