/* ============================================
   Sistema de Agenda y Modales de Servicios
   ============================================ */

/* Servicios clicables */
.services-con .services-box {
    cursor: pointer;
    transition: all 0.35s ease-in-out;
}

.services-con .services-box:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 45px rgba(58, 68, 152, 0.18);
}

/* ---------- Modal de detalles de servicio ---------- */
.service-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 15, 45, 0.68);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    overflow-y: auto;
}

.service-modal.show {
    display: flex;
}

.service-modal-content {
    background: #ffffff;
    border-radius: 20px;
    max-width: 660px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
    animation: serviceModalIn 0.35s ease;
}

@keyframes serviceModalIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.service-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #3a4498;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-modal-image {
    height: 240px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    background: #eef0f7;
}

.service-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.service-modal-body {
    padding: 26px 30px 30px;
}

.service-modal-body h3 {
    font-size: 26px;
    color: #3a4498;
    margin: 0 0 10px;
    line-height: 1.2;
}

.service-modal-desc {
    color: #666666;
    line-height: 1.65;
    margin-bottom: 18px;
}

.service-modal-specs-title {
    font-weight: 700;
    color: #2b2b2b;
    margin-bottom: 10px;
    font-size: 16px;
}

.service-modal-specs {
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
}

.service-modal-specs li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 8px;
    color: #555555;
    font-size: 15px;
}

.service-modal-specs li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #3a4498;
    font-weight: 700;
}

/* Selección de fecha y hora */
.service-datetime {
    margin: 20px 0;
    padding: 18px;
    background: #f6f7fb;
    border: 2px solid #3a4498;
    border-radius: 14px;
}

.service-datetime-title {
    font-weight: 700;
    color: #3a4498;
    text-align: center;
    margin-bottom: 16px;
    font-size: 16px;
}

.service-datetime-inputs {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: wrap;
}

.service-datetime-group {
    flex: 1;
    min-width: 160px;
    max-width: 220px;
}

.service-datetime-group label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: #2b2b2b;
    margin-bottom: 6px;
}

.service-datetime-group input,
.service-datetime-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dddddd;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    color: #333333;
}

.service-datetime-group input:focus,
.service-datetime-group select:focus {
    outline: none;
    border-color: #3a4498;
}

.service-modal-book {
    display: block;
    width: 100%;
    border: none;
    border-radius: 30px;
    background: #3a4498;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.service-modal-book:hover {
    background: #000000;
}

/* ---------- Sidebar de cita ---------- */
.appointment-sidebar {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    max-width: 100%;
    height: 100%;
    height: 100vh;
    background: #ffffff;
    box-shadow: -6px 0 25px rgba(0, 0, 0, 0.18);
    transition: right 0.35s ease;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.appointment-sidebar.open {
    right: 0;
}

.sidebar-header {
    padding: 20px 24px;
    background: #3a4498;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

.close-sidebar {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    padding-bottom: 130px;
}

.appointment-summary {
    padding: 18px;
    background: #f6f7fb;
    border: 2px solid #3a4498;
    border-radius: 12px;
    margin-bottom: 24px;
}

.summary-service {
    font-weight: 700;
    font-size: 18px;
    color: #3a4498;
    margin-bottom: 10px;
}

.summary-datetime {
    color: #555555;
    margin-bottom: 6px;
    font-size: 15px;
}

.form-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 18px;
    color: #2b2b2b;
    text-align: center;
}

.appt-form-group {
    margin-bottom: 16px;
}

.appt-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 14px;
    color: #2b2b2b;
}

.appt-form-group input,
.appt-form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #dddddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #333333;
    background: #ffffff;
}

.appt-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.appt-form-group input:focus,
.appt-form-group textarea:focus {
    outline: none;
    border-color: #3a4498;
}

.form-buttons {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 2px solid #eeeeee;
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08);
    display: none;
    gap: 12px;
    padding: 14px 24px;
    z-index: 10001;
}

.appointment-sidebar.open .form-buttons {
    display: flex;
}

.appt-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
}

.appt-btn-cancel {
    background: #6c757d;
}

.appt-btn-cancel:hover {
    background: #5a6268;
}

.appt-btn-submit {
    background: #25d366;
}

.appt-btn-submit:hover {
    background: #1fb457;
}

body.sidebar-open {
    overflow: hidden;
}

/* ---------- Botones flotantes ---------- */
.floating-buttons {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9500;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.floating-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    user-select: none;
}

.floating-btn:hover {
    transform: scale(1.1);
}

.floating-btn svg,
.floating-btn * {
    pointer-events: none;
}

.whatsapp-btn {
    background: #25d366;
    color: #ffffff;
    position: relative;
}

.map-btn {
    background: #ffffff;
    color: #ff0000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.map-btn:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* ---------- Menú de WhatsApp ---------- */
.whatsapp-menu {
    position: fixed;
    right: 20px;
    bottom: 90px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    min-width: 250px;
    display: none;
    z-index: 9600;
    animation: slideUp 0.3s ease-out;
}

.whatsapp-menu.show {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whatsapp-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eeeeee;
}

.whatsapp-menu-header .whatsapp-icon {
    color: #25d366;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.whatsapp-menu-title {
    font-weight: 700;
    color: #333333;
    font-size: 0.9rem;
}

.whatsapp-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 0.5rem;
    user-select: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.whatsapp-option:hover {
    background-color: #f0f0f0;
}

.whatsapp-option-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    pointer-events: none;
    flex-shrink: 0;
}

.whatsapp-option-text {
    font-size: 0.85rem;
    color: #333333;
    font-weight: 500;
    pointer-events: none;
}

/* ---------- Submenú de horarios ---------- */
.schedule-submenu {
    position: fixed;
    right: 20px;
    bottom: 90px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    min-width: 280px;
    display: none;
    z-index: 9700;
    animation: slideUp 0.3s ease-out;
}

.schedule-submenu.show {
    display: block;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eeeeee;
}

.schedule-title {
    font-weight: 700;
    color: #3a4498;
    font-size: 1rem;
}

.schedule-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666666;
}

.schedule-content {
    color: #333333;
    line-height: 1.6;
}

.schedule-day {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.schedule-day-name {
    font-weight: 600;
}

.schedule-hours {
    color: #666666;
}

/* ---------- Modales de emergencia y referencia ---------- */
.emergency-modal,
.referral-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.emergency-modal.show,
.referral-modal.show {
    display: flex;
}

.emergency-content,
.referral-content {
    background: #ffffff;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.emergency-header,
.referral-header {
    background: #dc3545;
    color: #ffffff;
    padding: 1.5rem;
    border-radius: 15px 15px 0 0;
    text-align: center;
}

.referral-header {
    background: #28a745;
}

.emergency-title,
.referral-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.emergency-subtitle,
.referral-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

.emergency-form,
.referral-form {
    padding: 2rem;
}

.privacy-notice {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.privacy-title {
    font-weight: 700;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #3a4498;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-emergency,
.close-referral {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ---------- Modal de mapa ---------- */
.map-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.map-modal.show {
    display: flex;
}

.map-modal-content {
    background: #ffffff;
    padding: 2rem;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.map-modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #3a4498;
}

.map-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map-option-btn {
    padding: 1rem;
    border: 2px solid #3a4498;
    background: #ffffff;
    color: #3a4498;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-option-btn:hover {
    background: #3a4498;
    color: #ffffff;
}

.close-modal-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #6c757d;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
    .appointment-sidebar {
        width: 100%;
        right: -100%;
    }

    .service-modal-image {
        height: 180px;
    }

    .service-modal-body {
        padding: 20px;
    }

    .service-datetime-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .service-datetime-group {
        max-width: none;
    }

    .floating-buttons {
        right: 15px;
        bottom: 15px;
    }

    .floating-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .whatsapp-menu {
        right: 15px;
        bottom: 75px;
        min-width: 220px;
    }

    .schedule-submenu {
        right: 15px;
        bottom: 75px;
        min-width: 250px;
    }

    .emergency-content,
    .referral-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }

    .emergency-form,
    .referral-form {
        padding: 1.5rem;
    }
}