:root {
    --primary: #BD1724;
    --secondary: #121212;
    --available: #93BF22;
    --unavailable: #BD1724;
    --low-availability: #EB6D36;

    --font-regular: "Outfit";

    --calendar-spacing: 4px;
}

#session {
    border: 4px solid var(--primary);
    border-radius: 0.333rem;
    padding: 0.875rem;
    margin: 1rem 0 0;
}

.checkfront-booking {
    font-family: var(--font-regular);
}

.step-indicator {
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    gap; 1rem;
    margin-bottom: 2rem;
    padding: 0 0 1rem;

    @media screen and (max-width: 768px) {
        margin-bottom: 0;
    }
}

.step {
    align-items: center;
    color: var(--color-copy);
    display: flex;
    flex: auto;
    justify-content: center;
    position: relative;
    padding-bottom: 0.5rem;
    transition: all 0.35s ease;

    .label {
        transition: all 0.35s ease;

        .hidden-xs {
            @media screen and (max-width: 768px) {
                display: none;
            }
        }
    }

    .arrow {
        position: absolute;
        left: auto;
        right: 0;
        transform: translateX(50%);
        /* opacity: 0; */
        max-width: 0;

        svg {
            height: 20px;
        }
    }

    /* &::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--primary);
        transition: width 0.3s ease;
    } */

    &.completed {
        cursor: pointer;

        &:hover {
            .label {
                color: var(--color-link);
            }
        }

        .arrow {
            max-width: 70px;

            @media screen and (max-width: 768px) {
                display: none;
            }
        }
    }

    &:disabled {
        cursor: not-allowed;
        opacity: 0.5;

        &.active {
            color: var(--color-link);
            cursor: pointer;
            opacity: 1;

            /* &::after {
                width: 100%;
            } */
        }
    }
}

#step-content {
    position: relative;
    min-height: 400px;
}

#step-content.htmx-swapping {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.calendar-panel {
    flex-basis: 100%;
    margin: 0 auto;
    transition: flex-basis 0.3s ease;
}

.calendar-nav {
    background: var(--color-btn);
    border-radius: 5px;
    display: flex;
    font-size: 1.5rem;
    font-weight: bold;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: var(--calendar-spacing);

    @media screen and (max-width: 768px) {
        font-size: 1rem;
    }
}

.calendar-nav .button {
    color: var(--color-cta-accent);
    height: 2.25rem;
    width: 2.5rem;
    padding: 0.375rem 0.5rem;

    svg {
        max-height: 100%;
    }

    @media screen and (max-width: 768px) {
        height: 1.75rem;
        width: 2rem;
        padding: 0.25rem;
    }
}

.calendar-nav .button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.calendar-grid {
    --item-min: 5px;
    --grid-columns: 7;
    color: var(--secondary);
    display: grid;
    /* grid-template-columns: repeat(7, 1fr); */
    /* grid-template-columns: repeat(7, minmax(50px, 200px)); */
    grid-template-columns: repeat(var(--grid-columns), minmax(min(var(--item-min), 100%), 1fr));
    grid-template-columns: repeat(var(--grid-columns),
            minmax(max(min(100%, var(--item-min)), 100% / (var(--grid-columns, 2) + 1)), 1fr));
    gap: var(--calendar-spacing);

}

.calendar-header {
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    padding: 0.5rem;
}

.calendar-day {
    /* aspect-ratio: 1; */
    align-items: center;
    background: white;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding: 1rem;
    padding-bottom: 2rem;
    text-align: center;
    border: 1px solid #dee2e6;
    min-height: 80px;
    transition: all 0.35s ease;

    @media screen and (max-width: 768px) {
        padding: 5px;
        min-height: 50px;
    }
}

.calendar-day.empty {
    opacity: 0.6;
}

.calendar-day.available {
    background: #e8f5e9;
    cursor: pointer;
}

.calendar-day.available:hover {
    background: #c8e6c9;
}

.calendar-day.unavailable {
    background: #ffebee;
    cursor: not-allowed;
}

.calendar-day.today {
    border-color: #000;
}

.calendar-day.selected {
    background: #c8e6c9;
    border: 2px solid #2e7d32;
}

.availability {
    border-radius: 5px;
    color: white;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 2px;
    font-size: 0.75rem;

    @media screen and (max-width: 768px) {
        display: none;
    }
}

.available {
    background: var(--available);
}

.unavailable {
    background: var(--unavailable);
}

.low-availability {
    background: var(--low-availability);
}

.booking-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dialog-content .checkfront-booking .heading {
    padding-right: 0;
}

#dialog-experience-booking {
    min-width: min(75%, 1300px);

    @media screen and (max-width: 768px) {
        min-width: 95%;
    }

    .dialog-close {
        @media screen and (max-width: 475px) {
            margin: 0;
        }
    }
}

.checkfront-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    position: relative;

    &:has(.calendar-panel) {
        overflow-y: auto;
    }
}

.booking-panel {
    display: none;
    position: relative;
    background: white;
    padding: 2rem;
    transition: flex-basis 0.3s ease;
    z-index: 1000;
}

.booking-panel[data-visible="true"] {
    display: block;
}

.button.close-panel {
    /* background: ;
    color: var(--primary); */
    border-radius: 50% 0 0 50%;
    position: absolute;
    top: 0;
    right: 100%;
    font-size: 1.5rem;
    cursor: pointer;
}

.calendar-wrapper {
    display: block;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* margin-bottom: 1rem; */
}

.time-slots {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
}

.time-slot input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.time-slot:has(input:checked) {
    background: var(--color-btn-alt-bg);
    border-color: var(--color-btn-alt-bd);
    color: var(--color-btn-alt);
}

.time-slot:has(input:checked):hover {
    border-color: var(--color-btn-alt-bd);
}

.ticket-availability {
    border-radius: 5px;
    color: var(--color-bg);
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.two-column {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;

    @media screen and (max-width: 768px) {
        grid-template-columns: 1fr;
    }

    .ticket-type {
        flex: 1 1 50%;
    }
}

.booking-total {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: space-between;

    @media screen and (max-width: 768px) {
        align-items: flex-start;
        flex-direction: column;
    }
}

.booking-total .was-price{
    color: var(--unavailable);
    text-decoration: line-through;
}

.booking-total .discount-saving {
    color: var(--available);
    font-size: 0.875rem;
}

/* Remove the old panel styles */
/* .booking-panel,
.calendar-panel {
    max-width: 800px;
    margin: 0 auto;
} */

/* Tooltip styles */

.tip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tip-trigger {
    align-items: center;
    background: var(--color-cta);
    border-radius: 50%;
    color: var(--color-bg);
    cursor: help;
    display: inline-flex;
    height: 18px;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin: 0 5px;
    outline: none;
    width: 18px;
}

.tip {
    border-radius: 5px;
    background: var(--color-cta);
    color: var(--color-bg);
    padding: 0.5rem 1rem;
    position: absolute;
    left: 120%;
    font-size: 0.875rem;
    width: max-content;
    max-width: 250px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;

    @media screen and (max-width: 768px) {
        left: 0%;
        bottom: 100%;
        margin-bottom: 8px;
        max-width: 200px;
    }
}

.tip::before {
    content: '';
    position: absolute;
    top: var(--arrow-top, 50%);
    left: var(--arrow-left, 0%);
    right: var(--arrow-right, auto);
    transform: var(--arrow-transform, translateX(-50%) translateY(-50%) rotate(45deg));
    width: 8px;
    height: 8px;
    background: var(--color-cta);

    @media screen and (max-width: 768px) {
        top: var(--arrow-top, 100%);
        left: var(--arrow-left, 14px);
        right: var(--arrow-right, auto);
        transform: var(--arrow-transform, translateX(-50%) translateY(-50%) rotate(45deg));
    }
}

.tip-wrapper:hover .tip,
.tip-trigger:focus + .tip,
.tip-wrapper:focus-within .tip {
    opacity: 1;
    visibility: visible;
}

.tip-trigger:focus {
    outline: 2px solid var(--color-cta);
    outline-offset: 2px;
}

@media screen and (max-width: 480px) {
    .tip {
        max-width: min(46vw, 200px);
        left: 0;
        transform: none;
    }
}

.wpcf7-not-valid-tip {
    display: none;
    padding: 0.4em 1em;
    font-size: 0.8rem;
    width: fit-content;
    font-weight: 600;
    margin-top: 0.3em;
    color: var(--color-bg);
    background-color: var(--unavailable);
    border-radius: 5px;
}

.wpcf7-not-valid-tip.invisible {
    display: none;
}

.wpcf7-not-valid-tip.visible {
    display: block;
}

.input-error {
    border-color: var(--unavailable);
}

.terms-content {
    background: var(--color-input-bg);
    border: 3px solid var(--color-input-bd);
    border-radius: 0.6rem;
    color: var(--color-input-text);
    padding: 0.6em 1em;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.5;

    /* nu-scroll utlity */
    /* Width */
    &::-webkit-scrollbar {
        width: 10px;
    }

    /* Track */
    &::-webkit-scrollbar-track {
        background: var(--color-input-bg);
    }

    /* Handle */
    &::-webkit-scrollbar-thumb {
        background: var(--color-input-bd);
    }

    /* Handle on hover */
    &::-webkit-scrollbar-thumb:hover {
        background: var(--color-input-text);
    }
}

.terms-content p {
    margin-bottom: 1rem;
}

.terms-content a {
    color: var(--color-link);
    text-decoration: underline;

    &:hover {
        color: var(--color-bg);
    }
}

.terms-content strong {
    font-weight: 600;
}


.booking-error {
    align-items: center;
    display: flex;
    justify-content: center;
}

#customer-form {
    .wpcf7-form-control-wrap {
        margin-bottom: 0;
    }
}
