/* =========================================================================
 * MODAL DE INICIO - RECONSTRUIDO DESDE CERO
 * TÉCNICA: Mobile-first, Grid Layout para horizontal, unidades fluidas.
 * MODIFICADO: Añadido estilo para categorías no disponibles y botones deshabilitados.
 * MODIFICADO: Añadida animación de resplandor y pulso para el costo.
 * MODIFICADO: Añadidas clases para la nueva animación de selección de categoría.
 * MODIFICADO: Cambiada la disposición a vertical en la vista horizontal.
 * MODIFICADO: Transformada la cuadrícula de categorías en un carrusel.
 * MODIFICADO: Reducido el tamaño de las tarjetas del carrusel a la mitad (25%).
 * MODIFICADO: Reestructurado Paso 2 con botones flotantes.
 * MODIFICADO: Añadida animación de enfoque para la tarjeta seleccionada.
 * MODIFICADO: Añadidas animaciones pulsantes y el letrero "OBJETIVO FIJADO".
 * MODIFICADO: Actualizado texto y posición del letrero de selección.
 * MODIFICADO: Añadida animación pulsante al botón de confirmación.
 * ========================================================================= */

.modal--start-rebuilt .modal__overlay {
    backdrop-filter: blur(8px) brightness(0.6);
    -webkit-backdrop-filter: blur(8px) brightness(0.6);
}

.modal--start-rebuilt .modal__content {
    background: radial-gradient(circle, #2d1950, #150d21);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    max-height: 95vh;
}

/* --- LÓGICA DE PASOS --- */
.start-step {
    display: none;
    width: 100%;
    flex-direction: column;
    padding: clamp(15px, 4vw, 25px);
    box-sizing: border-box;
    gap: clamp(15px, 4vw, 25px);
    animation: fadeIn 0.5s ease;
}
.modal__content[data-current-step="1"] .start-step-1 { display: flex; }
.modal__content[data-current-step="2"] .start-step-2 { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }


/* --- ESTILOS COMUNES DE COLUMNAS Y TEXTOS --- */
.start-col__title {
    color: #ecc94b;
    font-size: clamp(1.1rem, 4vh, 1.4rem);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(236, 201, 75, 0.3);
    padding-bottom: 1vh;
    margin: 0 0 1vh 0;
    text-align: center;
}
.start-col__text {
    font-size: clamp(0.8rem, 2.2vh, 0.95rem);
    color: #e2e8f0;
    line-height: 1.6;
    flex-grow: 1;
}
.start-modal-actions {
    display: flex;
    gap: 15px;
    margin-top: auto;
    padding-top: 15px;
}
.start-modal-actions .btn { flex: 1; }

/* --- PASO 1: ESTILOS ESPECÍFICOS --- */
.start-stats-blocks {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 15vh;
}
.stat-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5vh;
}
.stat-icon-img { width: clamp(24px, 5vh, 32px); height: auto; }
.stat-value { font-size: clamp(1.2rem, 4vh, 1.6rem); font-weight: bold; color: #fff; }
.stat-label { font-size: clamp(0.7rem, 1.8vh, 0.8rem); color: #a0aec0; }
.cost-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: clamp(15px, 4vh, 30px);
    box-sizing: border-box;
}

.cost-box__label {
    font-size: clamp(0.8rem, 2vh, 0.9rem);
    opacity: 0.8;
    color: #f59e0b;
    transition: color 0.3s ease;
}
.cost-box__value {
    font-size: clamp(2rem, 8vh, 3.5rem);
    font-weight: bold;
    color: #ecc94b;
    text-shadow: 0 0 10px #ecc94b;
    animation: pulsating-glow 2s ease-in-out infinite;
}

.start-col-actions {
    margin-top: auto;
    padding-top: 15px;
    width: 100%;
}

.btn.is-disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    color: rgba(255, 255, 255, 0.7) !important;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}
.btn.is-disabled:hover { transform: none; box-shadow: none; }


/* --- PASO 2: ESTILOS ESPECÍFICOS --- */
.category-card {
    aspect-ratio: 1 / 1;
    border: 2px solid rgba(192, 160, 98, 0.4);
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
    scroll-snap-align: start;
    flex-shrink: 0;
}
.category-card:hover { transform: translateY(-5px); border-color: #f0c540; }

.category-card.selected {
    border-color: #f0c540;
    transform: scale(1.05);
    animation: pulsating-box-shadow 2s infinite ease-in-out;
}

.category-card.selected .category-card__image {
    animation: pulsating-image 2s infinite ease-in-out;
}

.category-card.selected::after {
    content: 'OBJETIVO FIJADO';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(236, 201, 75, 0.9);
    color: #150d21;
    font-size: 0.7em;
    font-weight: bold;
    text-align: center;
    padding: 4px 0;
    animation: fadeIn 0.4s;
    z-index: 2;
}


.category-card__image {
    width: 60%;
    height: auto;
    object-fit: contain;
    flex-grow: 1;
}
.category-card__name { font-size: 0.8em; font-weight: bold; color: #fff; }

.category-card.is-unavailable {
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: 0.6;
}
.category-card.is-unavailable:hover { transform: none; border-color: rgba(192, 160, 98, 0.4); }
.category-card.is-unavailable .category-card__name { color: #aaa; }


/* --- Estilos del Carrusel --- */
.category-carousel-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1; 
    display: flex;
    align-items: center;
}

.category-grid {
    display: grid;
    grid-auto-flow: column; 
    grid-auto-columns: calc(25% - (clamp(10px, 2vh, 15px) * 3 / 4));
    gap: clamp(10px, 2vh, 15px);
    overflow-x: auto; 
    scroll-snap-type: x mandatory; 
    -ms-overflow-style: none;
    scrollbar-width: none;
    height: 100%;
    align-items: center;
    padding: 0 10px; 
}
.category-grid::-webkit-scrollbar { display: none; }

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(45, 25, 80, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background-color 0.2s, opacity 0.3s, transform 0.3s;
}
.carousel-nav-btn:hover { background-color: rgba(45, 25, 80, 1); }
.carousel-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
.carousel-nav-btn svg { width: 24px; height: 24px; }
#budi-carousel-prev-btn { left: -15px; }
#budi-carousel-next-btn { right: -15px; }


/* --- Estilos de los Botones Flotantes --- */
.floating-actions-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(21, 13, 33, 1) 0%, rgba(21, 13, 33, 0.8) 50%, transparent 100%);
    display: flex;
    gap: 15px;
    justify-content: center;
    z-index: 30;
    
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.start-step-2.actions-visible .floating-actions-container {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.floating-actions-container .btn {
    flex-grow: 1;
    max-width: 300px;
}

/* --- INICIO DE LA MODIFICACIÓN --- */
#budi-start-confirm-category-btn {
    animation: button-pulse-green 2s infinite ease-in-out;
}
/* --- FIN DE LA MODIFICACIÓN --- */


/* --- Animación de Enfoque --- */
.start-step-2.selection-in-progress .carousel-nav-btn {
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
    pointer-events: none;
}
.start-step-2.selection-in-progress .start-step-header {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.start-step-2.selection-in-progress .category-card:not(.focused) {
    opacity: 0.2;
    filter: blur(2px);
    pointer-events: none;
}
.category-card.focused {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40%;
    transform: translate(-50%, -50%) scale(1.5);
    border-color: #f0c540;
    z-index: 10;
    cursor: default;
    animation: pulsating-box-shadow 2s infinite ease-in-out;
}
.category-card.focused .category-card__image {
    animation: pulsating-image 2s infinite ease-in-out;
}
.category-card.focused::after {
    content: 'CATEGORIA SELECCIONADA';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(236, 201, 75, 0.9);
    color: #150d21;
    font-size: 0.5em;
    font-weight: bold;
    text-align: center;
    padding: 4px 0;
    animation: fadeIn 0.4s;
    z-index: 2;
}

/* --- MEDIA QUERY PARA MÓVIL HORIZONTAL --- */
@media (orientation: landscape) {
    .modal--start-rebuilt .modal__content {
        width: 95vw;
        max-width: 950px;
        position: relative;
    }
    
    .start-step { display: none; width: 100%; }
    .modal__content[data-current-step="1"] .start-step-1 { display: grid; grid-template-columns: auto auto 1fr; align-items: center; }

    .modal__content[data-current-step="2"] .start-step-2 {
        display: flex;
        flex-direction: column;
        height: 100%;
        padding-bottom: 0;
    }
    .start-step-2 .start-step-header { flex-shrink: 0; transition: opacity 0.3s ease; }
    .start-step-2 .category-carousel-wrapper { min-height: 0; }
    .floating-actions-container { padding-bottom: 20px; }
    
    .category-card.focused {
        width: 25%;
        transform: translate(-50%, -50%) scale(1.8);
    }
}


@keyframes pulsating-glow {
    0%, 100% { transform: scale(1); text-shadow: 0 0 10px #ecc94b; }
    50% { transform: scale(1.1); text-shadow: 0 0 20px #ffc107, 0 0 30px #f59e0b; }
}

@keyframes pulsating-box-shadow {
    0%, 100% { box-shadow: 0 0 20px rgba(240, 197, 64, 0.7); }
    50% { box-shadow: 0 0 35px rgba(240, 197, 64, 1); }
}

@keyframes pulsating-image {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* --- INICIO DE LA MODIFICACIÓN --- */
@keyframes button-pulse-green {
    0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(40, 167, 69, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(40, 167, 69, 0.7); }
}
/* --- FIN DE LA MODIFICACIÓN --- */