.module-hotelspackages {

    /* Figma draws this module at a 20px corner, not the 24px site token. */
    --pkg-radius: 20px;

    /* Feature bar — the shared .legend, widened into a filled bar. */
    >.legend.features {
        padding: 15px 20px;
        background-color: var(--list-background-color);
        border-radius: var(--pkg-radius);

        ul {
            gap: 10px 25px;

            li {
                gap: 8px;
                align-items: center;
                font-size: 1rem;
                font-weight: 700;

                .icon {
                    max-width: 20px;
                    width: 20px;
                }
            }
        }
    }

    >hr {
        margin-block: 18px;
        margin-inline: 0;
        border: 0;
        border-top: 1px solid var(--border-color);
    }

    /* Heading + group-size tabs */
    .groups-head {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 18px;

        >h2 {
            display: flex;
            align-items: center;
            gap: 3px;
            margin: 0;
            font-size: 1.625rem;
            font-weight: 600;
            white-space: nowrap;

            .icon {
                width: 22px;
                height: 22px;
            }
        }

        .subheading {
            font-size: 0.875rem;
        }

        .group-tabs {
            flex: 1 1 auto;

            ul {
                display: flex;
                align-items: center;
                gap: 10px;
                margin: 0;
                padding: 0;
                list-style: none;

                li {
                    flex: 1 1 0;
                    min-width: 0;
                    margin: 0;
                }

                a {
                    display: block;
                    padding: 5px 10px;
                    border: 1px solid var(--border-color);
                    border-radius: var(--border-radius-small);
                    font-size: 0.875rem;
                    font-weight: 600;
                    text-align: center;
                    text-decoration: none;
                    color: var(--font-color);
                    transition: .2s background-color;

                    &:hover {
                        background-color: rgba(253, 252, 236, .55);
                    }

                    &.active {
                        background-color: var(--secondary-background-color);
                    }
                }
            }
        }
    }

    /* Card rail */
    .group-panels {

        .list-thumbs {
            position: relative;
            /* The shared carousel is sized for square poster tiles and caps itself at
               300px with a 0.96/1 ratio on mobile. These cards size to their content. */
            height: auto;
            max-height: none;
            aspect-ratio: auto;
            padding-bottom: 12px;

            /* Inactive arrows are only faded out by the shared rule, which leaves them
               clickable over the cards. Take them out of the page entirely. */
            .prev:not(.active),
            .next:not(.active) {
                pointer-events: none;
                visibility: hidden;
            }

            .track {
                height: auto;
                align-items: stretch;
                gap: 20px;
                padding-bottom: 8px;
                scroll-padding-inline: 0;

                .item {
                    width: 315px;
                    height: auto;
                    display: flex;
                    flex-direction: column;
                    scroll-snap-align: start;
                    filter: drop-shadow(2px 4px 2px rgba(0, 0, 0, .25));

                    .image {
                        flex: none;
                        height: 154px;
                        overflow: hidden;
                        border-radius: var(--pkg-radius) var(--pkg-radius) 0 0;

                        img {
                            display: block;
                            width: 100%;
                            height: 100%;
                            object-fit: cover;
                        }
                    }

                    .details {
                        flex: 1;
                        display: flex;
                        flex-direction: column;
                        gap: 10px;
                        padding: 15px;
                        background-color: var(--secondary-background-color);
                        border-radius: 0 0 var(--pkg-radius) var(--pkg-radius);
                    }

                    .hotel {
                        align-self: flex-start;
                        flex: none;
                        width: auto;
                        max-width: 100%;
                        height: auto;
                        overflow: visible;
                        padding: 5px 10px;
                        background-color: var(--primary-background-color);
                        border-radius: var(--pkg-radius);
                        font-size: 1rem;
                        font-weight: 700;
                        text-decoration: none;
                        color: var(--font-color);
                    }

                    h3 {
                        margin: 0;
                        font-size: 1.25rem;
                        font-weight: 600;
                    }

                    ul.attributes {
                        display: flex;
                        flex-direction: column;
                        gap: 7px;
                        margin: 0;
                        padding: 0;
                        list-style: none;

                        li {
                            display: flex;
                            align-items: center;
                            gap: 10px;
                            margin: 0;
                            font-size: 1rem;

                            .icon {
                                flex: none;
                                width: 16px;
                                height: 16px;
                            }

                            i {
                                font-style: normal;
                                font-size: 0.875rem;
                                text-transform: uppercase;
                            }
                        }
                    }

                    .footer {
                        margin-top: auto;
                        display: flex;
                        flex-direction: column;
                        align-items: center;
                        gap: 12px;
                        padding-top: 5px;

                        hr {
                            width: 100%;
                            margin: 0;
                            border: 0;
                            border-top: 1px solid var(--border-color);
                        }

                        .prices {
                            width: 100%;
                            text-align: center;

                            .heading {
                                font-size: 0.75rem;
                                font-weight: 700;
                                text-transform: uppercase;
                            }

                            ul {
                                display: flex;
                                flex-direction: column;
                                gap: 2px;
                                margin: 10px 0 0;
                                padding: 0;
                                list-style: none;

                                li {
                                    margin: 0;
                                    font-size: 1rem;

                                    strong {
                                        font-weight: 600;
                                    }
                                }
                            }

                            .taxes {
                                margin-top: 10px;
                                font-size: 0.75rem;
                                text-transform: uppercase;
                            }
                        }

                        >.btn {
                            min-width: 226px;
                            min-height: 37px;
                            padding-block: 0;
                            font-size: 1rem;
                        }

                        /* The design shows the scarcity line as plain red text rather than
                           the filled pill used on the hotel details page. */
                        .tag {
                            display: flex;
                            justify-content: center;
                            align-items: center;
                            gap: 5px;
                            width: 100%;
                            font-size: 0.875rem;
                            font-weight: 700;
                            text-align: center;

                            .icon {
                                width: 14px;
                                height: 14px;
                            }

                            &:empty {
                                display: none;
                            }

                            &.red {
                                color: #C10000;
                            }

                            &.pink {
                                color: var(--secondary-color);
                            }

                            &.purple {
                                color: var(--accent-color);
                            }
                        }
                    }
                }
            }
        }
    }

    @media screen and (max-width: 800px) {

        >.legend.features {
            padding: 10px;
            border-radius: var(--border-radius-mobile);

            ul {
                gap: 5px 15px;

                li {
                    gap: 5px;
                    font-size: 0.875rem;

                    .icon {
                        max-width: 14px;
                        width: 14px;
                    }
                }
            }
        }

        >hr {
            margin-block: 15px;
        }

        .groups-head {
            flex-direction: column;
            align-items: stretch;
            gap: 15px;

            >h2 {
                font-size: 1.125rem;

                .icon {
                    width: 18px;
                    height: 18px;
                }
            }

            .group-tabs ul {
                gap: 5px;
            }
        }

        .group-panels .list-thumbs {
            padding-bottom: 4px;

            .track {
                gap: 15px;

                .item {
                    width: 265px;

                    .image {
                        height: 139px;
                    }

                    .details {
                        gap: 8px;
                        padding: 10px 16px 16px;
                    }

                    .hotel {
                        border-radius: var(--border-radius-mobile);
                        padding: 2px 8px;
                        font-weight: 900;
                    }

                    h3 {
                        font-size: 1rem;
                        font-weight: 700;
                    }

                    ul.attributes {
                        gap: 5px;

                        li {
                            gap: 8px;
                            font-size: 0.875rem;

                            .icon {
                                width: 14px;
                                height: 14px;
                            }

                            i {
                                font-size: 0.75rem;
                            }
                        }
                    }

                    .footer {
                        gap: 10px;

                        .prices ul li {
                            font-size: 0.875rem;
                        }

                        >.btn {
                            min-width: 0;
                            width: 100%;
                            min-height: 34px;
                            font-size: 0.875rem;
                        }

                        .tag {
                            font-size: 0.75rem;
                        }
                    }
                }
            }
        }
    }
}
