/* Botón de donación */
.donation-icon {
    display: flex;
    align-items: center;
    background-color: var(--accent);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.donation-icon:hover {
    background-color: #5747ec;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.donation-icon i {
    margin-right: 4px;
    font-size: 0.85rem;
}

/* Modal de donaciones */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* Modal principal de donación - MUY COMPACTO */
.donation-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px; /* Reducido */
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 10px;
    padding: 20px; /* Reducido */
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    -webkit-overflow-scrolling: touch;
    background-color: white;
}

/* Botón para cerrar el modal */
.close-modal {
    position: absolute;
    top: 10px; /* Reducido */
    right: 15px; /* Reducido */
    font-size: 24px; /* Reducido */
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
    z-index: 10;
}

.close-modal:hover {
    color: var(--primary);
}

/* Título del modal */
.donation-modal h2 {
    text-align: center;
    margin-bottom: 15px; /* Reducido */
    color: var(--primary);
    font-size: 22px; /* Reducido */
    font-weight: 700;
    position: relative;
    z-index: 5;
}

/* Contenedor de opciones de donación */
#donation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Reducido */
    margin-bottom: 15px; /* Reducido */
    transition: opacity 0.3s ease;
    opacity: 1;
    max-height: 1000px;
    overflow: visible;
    position: relative;
    z-index: 5;
}

#donation-options.hidden {
    display: none;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    opacity: 0;
    transition: none; /* Desactivar transición para evitar problemas */
}

/* Tarjetas de opciones de donación */
.donation-option {
    flex: 1;
    min-width: 250px;
    background-color: #f8f9fa;
    padding: 15px; /* Reducido */
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.donation-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.donation-option h3 {
    color: var(--primary);
    margin-bottom: 8px; /* Reducido */
    font-size: 18px; /* Reducido */
}

.donation-option p {
    margin-bottom: 8px; /* Reducido */
    color: #555;
    line-height: 1.4; /* Reducido */
    font-size: 14px; /* Reducido */
}

/* Botones de las opciones de donación */
.donation-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 15px; /* Reducido */
    border-radius: 5px;
    cursor: pointer;
    margin-top: 8px; /* Reducido */
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    font-size: 14px; /* Reducido */
}

.donation-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Formulario de donación - VERSIÓN COMPACTA */
.donation-form {
    display: none;
    margin-top: 10px;
    opacity: 0;
    overflow: hidden;
    transition: opacity 0.3s ease;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 5;
    max-height: 0;
}

.donation-form.active {
    opacity: 1;
    overflow-y: auto;
    padding-bottom: 10px;
    max-height: 60vh; /* Limitar altura y permitir scroll */
}

/* Estilos para la barra de scroll personalizada */
.donation-form.active::-webkit-scrollbar {
    width: 6px;
}

.donation-form.active::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.donation-form.active::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.donation-form.active::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Encabezado del formulario - SIEMPRE EN LA PARTE SUPERIOR */
.donation-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
    background-color: white;
    z-index: 50;
    position: sticky;
    top: 0;
}

/* Botón para volver a las opciones */
.back-button {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s;
    font-weight: 500;
}

.back-button:hover {
    background-color: #e0e0e0;
}

.back-button i {
    margin-right: 3px;
    font-size: 10px;
}

/* Título del formulario */
.donation-form-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

/* Contenido del formulario separado del encabezado */
.form-content {
    padding-top: 5px;
}

/* Grupos de campos del formulario - MUY COMPACTOS */
.form-group {
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 6;
}

.form-group label {
    display: block;
    margin-bottom: 2px; /* Reducido */
    font-weight: 500;
    color: #333;
    position: relative;
    z-index: 2;
    font-size: 12px; /* Reducido */
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 4px 6px; /* Reducido */
    border: 1px solid #bbb;
    border-radius: 4px; /* Reducido */
    font-size: 13px; /* Reducido */
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    background-color: white; /* Asegurar fondo blanco */
    height: 28px; /* Reducido */
}

.form-group textarea {
    height: 50px; /* Reducido */
    resize: vertical;
}

/* Botón de envío del formulario */
.donation-submit-btn {
    display: block;
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px; /* Reducido */
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px; /* Reducido */
    font-weight: 500;
    margin-top: 8px; /* Reducido */
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.donation-submit-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Horarios en modales */
.horario-content {
    padding: 10px 0;
}

.horario-content p {
    margin-bottom: 8px;
    font-size: 15px;
}

/* Pantallas grandes - optimizaciones específicas */
@media (min-width: 1200px) {
    .donation-modal {
        max-height: 85vh; /* Reducido */
    }
}

/* Dispositivos medianos */
@media (min-width: 768px) and (max-width: 1199px) {
    .donation-modal {
        max-height: 82vh; /* Reducido */
    }
}

/* Responsividad - Móviles */
@media (max-width: 768px) {
    .donation-modal {
        width: 95%;
        padding: 15px;
        max-height: 85vh;
    }
    
    .donation-option {
        min-width: 100%;
        padding: 12px;
    }
    
    .form-group {
        margin-bottom: 8px;
    }
    
    .form-group label {
        margin-bottom: 2px;
        font-size: 12px;
    }
    
    .form-group input,
    .form-group select {
        padding: 4px;
        font-size: 12px;
        height: 26px;
    }
    
    .form-group textarea {
        height: 50px;
        font-size: 12px;
    }
    
    .back-button {
        padding: 3px 6px;
        font-size: 11px;
    }
    
    .donation-form-title {
        font-size: 14px;
    }
}

/* Ocultamos la barra de ajustes */
.form-adjustment-bar {
    display: none;
}

/* Estilos para la barra de navegación del modal de donación */
.donation-navbar {
    background-color: #f8f9fa;
    border-radius: 6px;
    margin: 0 0 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

.donation-nav-menu {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    justify-content: space-around;
}

.donation-nav-item {
    position: relative;
    flex: 1;
    text-align: center;
}

.donation-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
    font-weight: 500;
    border-radius: 6px;
}

.donation-nav-link i {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--primary);
}

.donation-nav-item.active .donation-nav-link {
    background-color: rgba(100, 223, 223, 0.1);
    color: var(--primary);
}

.donation-nav-item.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 25%;
    width: 50%;
    height: 3px;
    background-color: var(--primary);
    border-radius: 1px;
}

.donation-nav-item.completed .donation-nav-link i {
    color: #4CAF50;
}

/* Sección de confirmación */
.donation-confirmation-section {
    text-align: center;
    padding: 20px 0;
    transition: opacity 0.5s ease, max-height 0.5s ease;
}

.confirmation-content {
    max-width: 90%;
    margin: 0 auto;
}

.confirmation-icon {
    font-size: 50px;
    color: #4CAF50;
    margin-bottom: 15px;
}

.donation-confirmation-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 20px;
}

.donation-confirmation-section p {
    margin-bottom: 10px;
    color: #555;
}

.donation-confirmation-section .donation-btn {
    margin-top: 20px;
}

/* Adaptaciones responsivas */
@media (max-width: 480px) {
    .donation-nav-link {
        font-size: 11px;
        padding: 8px 2px;
    }
  
    .donation-nav-link i {
        font-size: 14px;
    }
  
    .confirmation-icon {
        font-size: 40px;
    }
}

/* Animación de sacudida para cuando se intenta acceder al formulario sin seleccionar opción */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-animation {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Optimizaciones para modales pequeños */
@media (max-height: 600px) {
    .donation-form .form-group {
        margin-bottom: 4px;
    }
    
    .donation-form label {
        font-size: 11px;
        margin-bottom: 1px;
    }
    
    .donation-form input,
    .donation-form select {
        height: 24px;
        padding: 2px 4px;
        font-size: 12px;
    }
    
    .donation-form textarea {
        height: 40px;
        font-size: 12px;
    }
}