:root {
    --header-height: 16vh;
    --details-title-container-height: 3rem;
}

#situations-nav {
    position: sticky;
    inset: 0.25rem auto 0.25rem 0;
    display: flex;
    align-items: center;
    z-index: 120;
    height: fit-content;
}

.item-flex {
    border-radius: 0 1rem 1rem 0;
    width: fit-content;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 0.75rem;
    padding-left: 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
    box-shadow: 2px 2px rgba(0, 0, 0, 0.5);
}

.item-flex:nth-child(1) {
    color: black;
    background-color: var(--primary-color-1);
    border-right: 1px solid rgb(150, 150, 150);
    width: fit-content;
    text-align: center;
    padding-right: 1.5rem;
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 101;
}

.item-flex img {
    height: 60%;
}

.item-flex:nth-child(2) {
    z-index: 100;
    background-color: #222222;
}

.item-flex:not(:first-child) {
    margin-left: -1rem;
}

/* 1. Aplicamos los estilos directamente a la clase de la lista */
.situation-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 500;
    /*background-color: yellow;*/
    flex: 1;
    z-index: 1;
    height: 100%;
}

.recommended-services-list {
    display: flex;
    flex-direction: column;
    list-style: none; /* Elimina las viñetas */
    margin: 0; /* Elimina el margen por defecto */
    padding: 1rem; /* Elimina la sangría por defecto */
    gap: 0.5rem;
    flex: 1;
}

.description {
    margin: 0.5rem;
}

.situation-service-item {
    display: flex;
    align-items: center;
    /*background-color: rgba(255, 255, 255, 0.3);*/
    background-color: var(--light-surface);
    /*box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);*/
    border-radius: 0.5rem;
    padding: 0.75rem;
    gap: 1rem;
    user-select: none;
    border: 1px solid #818283;
    transform: scale(1);
    transition: border-color 0.2s ease, transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    color: var(--on-light-surface-1)
}

.situation-service-item .checkbox-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.situation-service-item:has(.checkbox-hidden:checked) {
    border-color: var(--metallic-color);
    transform: scale(1.015);
    box-shadow: 2px 2px 4px color-mix(in srgb, var(--primary-color-3) 80%, transparent);
}

.situation-service-item .text-block {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.text-block p:nth-child(1) {
    color: var(--on-light-surface-2); /* Faltaba el punto y coma aquí */
}

.text-block p:nth-child(2) {
    color: var(--on-light-surface-3); /* Faltaba el punto y coma aquí */
}

.displayed-checkbox {
    position: relative;
    height: 1.6rem;
    width: 1.6rem;
    flex-shrink: 0;
    background-color: white;
    border: 0.1rem solid #222222;
    border-radius: 50%;
}

.displayed-checkbox span {
    position: absolute;
    inset: 0;
    height: 60%;
    width: 60%;
    margin: auto;
    background-color: #ffffff;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.checkbox-hidden:checked + .displayed-checkbox {
    /*background-color: #222222;*/
    background-color: var(--primary-color-1);
}

.checkbox-hidden:checked + .displayed-checkbox span {
    /*background-color: #222222;*/
    background-color: var(--deep-black);

}

.execution-info {
    display: flex;
    align-items: center;
    width: 100%;
    padding-inline: 0.5rem;
}

.execution-info .place,
.execution-info .time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.execution-info .place img,
.execution-info .time img {
    height: 1.5rem;
}

.situation-wpp-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 1rem;
    border: 1px solid slategray;
    box-shadow: 2px 2px rgba(0, 0, 0, 0.5);
    background-color: green;
    /*align-self: end;*/
    user-select: none;
    width: max-content;
    color: whitesmoke;
}

.situation-wpp-button p {
    width: fit-content;
    font-weight: 600;
}

.situation-wpp-button picture {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.situation-wpp-button img {
    height: 2rem;
}

.situation-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    position: sticky;
    bottom: 0.25rem;
    padding: 0.25rem;
}

.situation-details:not(:has(.checkbox-hidden:checked)) .situation-wpp-button {
    pointer-events: none;
    filter: grayscale(100%);
}

#twenty-four-hours-poster {
    position: unset;
}

.frequent-situations-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.frequent-situations-container a {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--light-surface);
    padding: 0.75rem 0.5rem 0.75rem 1rem;
    border-radius: 0.25rem 1rem 0.25rem 0.25rem;
    border: 1px solid var(--primary-color-2);
    box-shadow: 2px 2px 2px var(--dark-transparent);
    overflow: hidden;
}

.frequent-situations-container a.active {
    background-color: var(--primary-color-1);
    border: 1px solid black;
}

.frequent-situations-container a:hover {
    background-color: var(--primary-color-1);
}

.frequent-situations-container .text {
    flex: 1;
    min-width: 0;
    /*color: var(--on-light-surface-2);*/
    /*white-space: nowrap;*/
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.frequent-situations-container .numbered {
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.services-directory-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    font-weight: 600;
}

.services-directory-container a {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--metallic-color);
    padding: 0.75rem 0.5rem 0.75rem 1rem;
    border-radius: 0.25rem 1rem 0.25rem 0.25rem;
    border: 1px solid var(--primary-color-3);
    box-shadow: 2px 2px 4px var(--dark-transparent);
    text-decoration: none;
    overflow: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Estado Activo: Pasa al degradado dorado y texto oscuro */
.services-directory-container a.active {
    background: var(--main-gradient);
    border-color: var(--deep-black);
}

.services-directory-container a.active .text,
.services-directory-container a.active .numbered {
    color: var(--deep-black);
}

/* Estado Hover: Resalta sutilmente el borde en dorado claro */
.services-directory-container a:hover:not(.active) {
    border-color: var(--primary-color-1);
}

.services-directory-container .text {
    flex: 1;
    min-width: 0;
    color: var(--platino-satinado);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Centrado del texto */
    /*text-align: center;*/

    /* Corrige la alineación de las líneas en el -webkit-box */
    -webkit-box-align: center;
    align-items: center;
}

/* Número en dorado resaltado sobre el fondo oscuro */
.services-directory-container .numbered {
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    color: var(--primary-color-1);
}

.services-directory-container .label {
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    color: var(--primary-color-1);
    padding-block: 0.5rem;
    padding-inline: 1rem;
    border-radius: 0.5rem;
}

.services-directory-container a.active .label {
    background-color: black;
    color: var(--on-surface);
}

#general-container {
    flex: 1;
    position: relative;
}

#tabs {
    position: sticky;
    top: 0;
    display: flex;
    flex-wrap: wrap;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.5);
}

#tabs > :nth-child(n+1) {
    font-weight: 500;
    font-size: var(--tab-font-size);
    height: 3rem;
    background-color: var(--inactive-surface-color);
    color: var(--inactive-on-surface-color);
    z-index: 1;
    border-width: 0 1px 1px 0;
    border-color: black;
    border-style: solid;
}

#tabs > :nth-child(1),
#tabs > :nth-child(2) {
    width: 50%;
}

#tabs .active {
    background-color: var(--primary-color-1);
    font-weight: 600;
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.tab-content {
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    height: 0;
}

.tab-content.active {
    opacity: 1;
    pointer-events: auto;
    /*height: auto;*/
}

.tab-content:not(.active) {
    height: 0;
    overflow: hidden;
}

#details-title-container {
    width: 100%;
    position: relative;
    transform: translateX(-100%);
    opacity: 0;
    height: 0;
    margin-top: 0;
    overflow: hidden;
    background-color: var(--deep-black);
}

#details-title-container h1 {
    font-size: var(--tab-font-size);
}

#details-title-container.active {
    transform: translateX(0%);
    opacity: 1;
    margin-top: 0.4rem;
    height: var(--details-title-container-height);
    background-color: var(--deep-black);
    animation: slideLeftRight 0.8s ease-in-out;
}

@keyframes slideLeftRight {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0%);
        opacity: 1;
    }
}

#details-title-container:not(.active) {
    background-color: var(--deep-black);
    height: 0;
    transition: transform 1s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 1s cubic-bezier(0.25, 1, 0.5, 1),
    height 1s cubic-bezier(0.25, 1, 0.5, 1),
    margin-top 1s cubic-bezier(0.25, 1, 0.5, 1);
}

#details-title-container h1 {
    position: absolute;
    inset: 0;
    width: fit-content;
    height: fit-content;
    margin: auto;
    color: white;
    padding: 0;
}

#details-title-container img {
    position: absolute;
    margin: auto 0;
    inset: 0 auto 0 0.75rem;
    height: 60%;
}

.service-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 1.1rem;
    padding: 0.5rem
}

.service-details ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem
}

.service-details .disclaimer {
    font-style: italic;
    color: #333333
}

.listed-text .label {
    font-weight: 800;
    /*font-size: 1rem;*/
    color: blue;
    border: 2px solid blue;
    /*background-color: var(--deep-black);*/
    padding-inline: 0.35rem;
    padding-block: 0.2rem;
    border-radius: 1rem;
    margin-inline: 0.5rem;
}

@media (max-width: 767px) {
    .main-actions-toolbar-inner {
        margin-bottom: 0.5rem;
    }

    .main-actions-toolbar[data-expanded='true'] {
        --toggle-close-icon-display: flex;
        --toggle-contact-icons-display: none;
    }

    .main-actions-toolbar[data-expanded='false'] {
        --toggle-close-icon-display: none;
        --toggle-contact-icons-display: flex;
    }

    .main-actions-toggle div:nth-child(1), .main-actions-toggle div:nth-child(2) {
        display: var(--toggle-contact-icons-display);
    }

    .main-actions-toggle div:nth-child(3) {
        display: var(--toggle-close-icon-display);
    }

    .main-actions-toggle {
        align-self: end;
        display: flex;
        align-items: center;
        border-radius: 1rem;
        background-color: rgba(0, 0, 0, 0.6);
        gap: 0.5rem;
        padding: 0.25rem;
        border: 0;
        outline: 0;
        width: calc((var(--main-actions-toolbar-row-width) / 2) + (var(--main-actions-toolbar-padding) / 2));
        justify-content: center;
        margin-bottom: calc(var(--main-actions-toolbar-padding) / 2);
    }

    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border-width: 0;
    }

    #footer #twenty-four-hours-poster {
        margin-right: auto;
        margin-left: auto;
        translate: -50% 0;
    }
}

@media (min-width: 1200px) {
    #general-container {
        display: flex;
        position: unset;
    }

    .tab-content {
        flex: 1 0;
    }

    #tabs .tab-btn:not(.active) {
        background-color: var(--primary-color-1);
        font-weight: 600;
        box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
        z-index: 2;
    }

    #services-directory:not(.active),
    #frequent-situations-directory:not(.active) {
        opacity: 1;
        pointer-events: auto;
    }

    #services-directory,
    #frequent-situations-directory {
        overflow-y: auto;
        overflow-x: clip;
        flex: 2 0;
        height: calc(100vh - var(--bottom-app-bar-height) - var(--header-height) - var(--details-title-container-height));
    }

    #details {
        flex: 3 0;
        overflow-y: auto;
        overflow-x: clip;
        height: calc(100vh - var(--bottom-app-bar-height) - var(--header-height) - var(--details-title-container-height));
    }

    #tabs > :nth-child(1),
    #tabs > :nth-child(2) {
        flex: 2;
    }

    #tabs > :nth-child(1) {
        order: 1;
    }

    #tabs > :nth-child(2) {
        order: 3;
    }

    #general-container > * {
        border-right: 1px solid var(--inactive-on-surface-color);
    }

    @keyframes slideFromTop {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }

        to {
            transform: translateY(0%);
            opacity: 1;
        }
    }

    #details-title-container {
        order: 2;
        margin-top: 0;
        flex: 3 0;
        transform: translateY(-100%);
    }

    #details-title-container.active {
        border-top: 1px solid var(--inactive-on-surface-color);
        margin-top: 0;
        animation: slideFromTop 0.5s ease-in-out;
    }

}
