/* Contenedor principal del itinerario */
.itinerario-wrapper {
    margin: 100px 0;
    max-width: 100%;
    overflow: visible;
    position: relative;
}

.itinerario-titulo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--color-titulo, #bdd8eb);
    text-align: center;
}

/* Layout de contenido */
.itinerario-contenido {
    display: grid;
    gap: 40px;
    position: relative;
}

/* Con imagen: 2 columnas */
.itinerario-wrapper.con-imagen .itinerario-contenido {
    grid-template-columns: 40% 1fr;
    align-items: start;
    
}

/* Sin imagen: 1 columna centrada */
.itinerario-wrapper.sin-imagen .itinerario-contenido {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

/* Columna de imagen */
.itinerario-imagen-col {
    position: relative;
    height: 100%;
    transition: height 0.4s ease;
}

.imagen-wrapper {
    position: relative;
    height: 100%;
    min-height: auto;
}

.imagen-sticky-container {
    position: sticky;
    top: 100px;
    z-index: 999;
    height: fit-content;
    width: 100%;
}

.imagen-inner {
    position: relative;
    width: 100%;
    height: auto;
}

.itinerario-imagen {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.itinerario-imagen:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

/* Timeline Container */
.timeline-container {
    position: relative;
    
    padding: 25px 20px 25px 20px;
    background: #2f2d2d;
    border-radius: 10px;
}

/* Cada item del día */
.dia-item {
    display: flex;
    position: relative;
    margin-bottom: 20px;
    align-items: flex-start;
    min-height: 50px;
}

.dia-item:last-child {
    margin-bottom: 0;
}

.dia-item:last-child .timeline-line {
    display: none;
}

/* Icono del timeline */
.timeline-icon {
    position: relative;
    flex-shrink: 0;
    margin-right: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.location-icon {
    width: 40px;
    height: 26px;
    background: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #89c4ff;
    box-shadow: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
}

.location-icon svg {
width: 36px;
    height: 47px;
}

.location-icon:hover {
   
    box-shadow: none;
}

/* Línea del timeline */
.timeline-line {
    width: 3px;
height: 51px;
    background: linear-gradient(to bottom, 
        var(--color-titulo, #bdd8eb) 0%, 
        rgba(189, 216, 235, 0.5) 50%, 
        var(--color-accent, #77c75b) 100%
    );
    position: absolute;
      top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    transition: none;
}

/* Línea conectora que aparece solo cuando se despliegan los días ocultos */
.timeline-line-conectora {
    height: 42px !important;
    display: block !important;
}

/* Contenido del día */
.dia-contenido {
    flex: 1;
    
    overflow: hidden;
    transition: all 0.3s ease;
}

.dia-contenido:hover {
    
    transform: translateY(-2px);
     
}

/* Header del día (clickeable) */
.dia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}


.dia-titulo {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-titulo, #bdd8eb);
    line-height: 1.3;
    flex: 1;
}

.dia-numero {
    color: var(--color-titulo, #bdd8eb);
}

.dia-titulo-texto {
    color: white;
    margin-left: 2px;
    font-weight: 400;
}

/* Flecha de toggle */
.toggle-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(189, 216, 235, 0.1);
    color: var(--color-titulo, #bdd8eb);
    transition: all 0.3s ease;
    margin-left: 16px;
}

.toggle-arrow svg {
    transition: transform 0.3s ease;
}

.dia-header.active .toggle-arrow {
    background: var(--color-titulo, #bdd8eb);
    color: var(--color-fondo, #353535);
}

.dia-header.active .toggle-arrow svg {
    transform: rotate(180deg);
}

/* Descripción (desplegable) */
.dia-descripcion {
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    opacity: 0;
}

.dia-descripcion.active {
    max-height: 1000px;
    opacity: 1;
}

.descripcion-content {
    padding: 0 24px 24px 24px;
    color: var(--color-texto, #fff);
    opacity: 0.92;
    line-height: 1.7;
}

.descripcion-content p {
    margin: 0 0 12px 0;
}

.descripcion-content p:last-child {
    margin-bottom: 0;
}

/* Estados de error */
.sin-itinerario, .error {
    padding: 20px;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 12px;
    color: var(--color-texto, #fff);
    text-align: center;
    font-weight: 500;
}

/* Botón Leer más */
.leer-mas-container {
    display: flex;
    justify-content: flex-start;
    margin: 10px 0;
    padding-left: 50px;
}

.leer-mas-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--color-titulo, #bdd8eb);
    color: #000000 !important;
    border: 2px solid var(--color-titulo, #bdd8eb);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.leer-mas-btn.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.leer-mas-btn:hover {
    background: transparent;
    color: var(--color-titulo, #bdd8eb) !important;
    border-color: var(--color-titulo, #bdd8eb);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(189, 216, 235, 0.3);
}


.leer-mas-icon {
    transition: transform 0.3s ease;
}

/* Botón Leer menos */
.leer-menos-container {
    display: flex;
    justify-content: flex-start;
    margin: 20px 0 10px 0;
    padding-left: 50px;
}

.leer-menos-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--color-accent, #77c75b);
    color: #000000 !important;
    border: 2px solid var(--color-accent, #77c75b);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(119, 199, 91, 0.3);
}

.leer-menos-btn:hover {
    background: transparent;
    color: var(--color-titulo, #bdd8eb) !important;
    border-color: var(--color-titulo, #bdd8eb);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(189, 216, 235, 0.3);
}


.leer-menos-icon {
    transition: transform 0.3s ease;
}

/* Días ocultos con animación */
.dias-ocultos {
    animation: fadeIn 0.4s ease-in-out;
        margin-top: 13px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}




/* Responsive Design */
@media (max-width: 1024px) {
    .itinerario-wrapper.con-imagen .itinerario-contenido {
        grid-template-columns: 35% 1fr;
        gap: 30px;
    }
    
    .imagen-sticky-container {
        top: 80px;
    }
    
    .timeline-icon {
        margin-right: 10px;
    }
}

@media (max-width: 768px) {
    .itinerario-wrapper.con-imagen .itinerario-contenido {
        grid-template-columns: 1fr;
        gap: 24px;
        display: flex;
        flex-direction: column;
    }
    
    .itinerario-imagen-col {
        order: 1;
        height: auto !important; /* Remove any inherited heights */
        min-height: 0 !important; /* Prevent minimum height constraints */
    }
    
    .itinerario-dias-col {
        order: 2;
    }
    
    .imagen-wrapper {
        min-height: 0 !important; /* Remove minimum height completely */
        height: auto !important; /* Let content determine height */
    }
    
    .imagen-sticky-container {
        position: relative;
        top: auto;
        z-index: 1;
    }
    
    .timeline-icon {
        margin-right: 10px;
    }
    
    .location-icon {
        width: 40px;
        height: 40px;
    }
    
    .location-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .timeline-line {
        height: 50px;
        top: 29px;
        left: 50%;
        transform: translateX(-50%);
        transition: none;
    }
    
    .dia-header {
        padding: 16px 8px;
    }
    
    .dia-titulo {
        font-size: 1.05rem;
    }
    
    .descripcion-content {
        padding: 0 20px 20px 20px;
    }
    
    .leer-mas-container {
        padding-left: 50px;
        margin: 8px 0;
    }
    
    .leer-mas-btn {
        padding: 7px 14px;
        font-size: 0.75rem;
        gap: 5px;
    }
    
    .leer-menos-container {
        padding-left: 50px;
        margin: 16px 0 8px 0;
    }
    
    .leer-menos-btn {
        padding: 7px 14px;
        font-size: 0.75rem;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .itinerario-wrapper {
        margin: 80px 0;
    }
    
    .itinerario-titulo {
        font-size: 30px;
    }
    
    .timeline-icon {
        margin-right: 12px;
    }
    
    .location-icon {
        width: 40px;
        height: 40px;
    }
    
    .location-icon svg {
    width: 41px;
        height: 41px;
    }
    
    .timeline-line {
        height: 60px;
        top: 28px;
        width: 2px;
        transition: none;
        left: 50%;
        transform: translateX(-50%);
    }


.timeline-line-conectora {
    height: 57px !important;
    display: block !important;
}


    
    .dia-header {
        padding: 0px 6px;
    }
    
    .dia-titulo {
        font-size: 1rem;
    }
    
    .toggle-arrow {
        width: 28px;
        height: 28px;
        margin-left: 12px;
    }
    
    .descripcion-content {
        padding: 0 16px 16px 16px;
        font-size: 0.95rem;
    }
    
    .leer-mas-container {
        padding-left: 52px;
        margin: 6px 0;
    }
    
    .leer-mas-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
        gap: 4px;
    }
    
    .leer-menos-container {
        padding-left: 52px;
        margin: 12px 0 6px 0;
    }
    
    .leer-menos-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
        gap: 4px;
    }
}

.leer-mas-texto, .leer-menos-texto{
        color: #2f2d2d;
}

.leer-mas-btn:hover .leer-mas-texto,
.leer-menos-btn:hover .leer-menos-texto {
    color: var(--color-titulo, #bdd8eb) !important;
}