/* Prices widget styles (BEM: myplatz-prices) */
.myplatz-prices {
    display: block;
    --label-col: 20ch;
    --price-col-hs: 1fr;
    --price-col-ns: 1fr;
    --gap-label-price: 1rem;
    --gap-price-price: 1rem;
    --toggle-gap: 1rem;
    --price-active-color: var(--myplatz-primary, #0073aa);
    --alt-even: rgba(0, 0, 0, .025);
    --alt-odd: rgba(0, 0, 0, 0);
    max-width: 100%;
}

.myplatz-prices__title {
    margin: 0 0 .75rem
}

/* Single switch with outside labels */
.myplatz-prices__toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .75rem;
    margin-bottom: var(--toggle-gap)
}

.myplatz-prices__label-left,
.myplatz-prices__label-right {
    color: var(--label-inactive-color, #666);
    transition: color .2s ease, transform .2s ease;
    line-height: 1
}

.myplatz-prices[data-season="hs"] .myplatz-prices__label-left[data-season="hs"],
.myplatz-prices[data-season="ns"] .myplatz-prices__label-left[data-season="ns"],
.myplatz-prices[data-season="hs"] .myplatz-prices__label-right[data-season="hs"],
.myplatz-prices[data-season="ns"] .myplatz-prices__label-right[data-season="ns"] {
    color: var(--label-active-color, #111);
    transform: scale(var(--label-active-scale, 1.1))
}

.myplatz-prices__switch {
    --switch-h: 30px;
    /* internal height for knob; separate from spacing below */
    position: relative;
    width: 64px;
    height: var(--switch-h);
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: var(--toggle-bg-inactive, #eff2f5);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), 0 2px 4px rgba(0, 0, 0, .06);
    transition: background-color .2s ease
}

.myplatz-prices[data-season="hs"] .myplatz-prices__switch {
    background: var(--toggle-bg-active, #eaf2ff)
}

.myplatz-prices__switch::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(var(--switch-h) - 6px);
    height: calc(var(--switch-h) - 6px);
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
    transition: transform .2s ease
}

.myplatz-prices[data-season="hs"] .myplatz-prices__switch::before {
    transform: translateX(calc(64px - var(--switch-h)))
}

/* List grid */
.myplatz-prices__list {
    display: block;
    width: 100%;
}

.myplatz-prices__row {
    display: grid;
    grid-template-columns: var(--label-col) var(--price-col-single, 1fr);
    /* default for toggle */
    column-gap: var(--gap-label-price);
    padding: .35rem 0;
    align-items: stretch
}

.myplatz-prices[data-mode="both"] .myplatz-prices__row {
    grid-template-columns: var(--label-col) 1fr;
}

/* Prices inner container (holds either single or both price columns) */
.myplatz-prices__prices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.myplatz-prices[data-mode="both"] .myplatz-prices__prices {
    grid-template-columns: var(--price-col-hs) var(--price-col-ns);
    gap: var(--gap-price-price, 0);
}

.myplatz-prices__row--header {
    opacity: .75;
    padding-top: var(--header-row-padding-top, 0);
    padding-bottom: var(--header-row-padding-bottom, .5rem);
}

/* When in toggle mode, do not render/occupy space for the header row */
.myplatz-prices[data-mode="toggle"] .myplatz-prices__row--header {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
}

/* Divider element inside each row (below content) */
.myplatz-prices__divider {
    grid-column: 1 / -1;
    height: 1px;
    width: var(--row-divider-width, 100%);
    background-color: rgba(0, 0, 0, .08);
    justify-self: var(--row-divider-align, start);
    /* can be overridden via control (start|center|end) */
    display: none;
    /* enabled via control */
}

/* No trailing divider on the last row */
.myplatz-prices .myplatz-prices__row:not(.myplatz-prices__row--header):last-child .myplatz-prices__divider {
    display: none !important;
}

.myplatz-prices__label {
    grid-column: 1;
    display: grid;
    align-content: center;
    /* center block of name+description together */
    justify-items: start;
    /* keep text left by default */
}

.myplatz-prices__name {
    justify-self: stretch;
    font-weight: 600;
    color: inherit;
    /* allow name color control without affecting description */
}

.myplatz-prices__description {
    justify-self: stretch;
    font-size: .9em;
    opacity: .8;
    margin-top: .25rem
}

/* Meta row (badges) */
.myplatz-prices__meta {
    margin-top: .35rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.myplatz-prices__meta .myplatz-prices__badge {
    margin-left: 0;
}

.myplatz-prices__price {
    align-self: center;
    text-align: right;
    /* default: prices right aligned */
}

/* Gap between HS and NS columns can be controlled via grid gap; label->price via --gap-label-price above. */

/* Price box alignment and width */
.myplatz-prices__box-wrap {
    justify-content: flex-end;
}

.myplatz-prices__box {
    width: var(--price-box-width, auto);
}

.myplatz-prices__box-amount {
    text-align: right !important;
    /* ensure numeric alignment */
}

/* Alternating rows backgrounds */
.myplatz-prices[style*='--alt-even'] .myplatz-prices__row:not(.myplatz-prices__row--header):nth-of-type(even) {
    background: var(--alt-even)
}

.myplatz-prices[style*='--alt-odd'] .myplatz-prices__row:not(.myplatz-prices__row--header):nth-of-type(odd) {
    background: var(--alt-odd)
}

/* Do not color header row */
.myplatz-prices__row--header {
    background: transparent !important
}

/* Price boxes */
.myplatz-prices__box-wrap {
    display: flex;
    gap: .5rem;
    align-items: stretch
}

.myplatz-prices__box {
    background: var(--box-bg-inactive, transparent);
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 12px;
    padding: .5rem .75rem;
    display: inline-flex;
    justify-content: flex-end;
    /* amount sticks to the right edge within the box */
    align-items: baseline;
    gap: .5rem
}

/* Ensure the amount is visually at the far right within the box */
.myplatz-prices__box-amount {
    margin-left: auto;
    text-align: right !important;
}

.myplatz-prices__box.is-active {
    background: var(--box-bg-active, transparent)
}

.myplatz-prices__box-label {
    font-size: .85em;
    opacity: .7
}

.myplatz-prices__box-amount {
    color: inherit
}

/* Both mode: each season has its own column now; box-wrap stays simple */

/* Header active/inactive colors */
.myplatz-prices__row--header .myplatz-prices__price--hs {
    color: var(--header-color-inactive, #666);
}

.myplatz-prices__row--header .myplatz-prices__price--ns {
    color: var(--header-color-inactive, #666);
}

.myplatz-prices[data-season="hs"] .myplatz-prices__row--header .myplatz-prices__price--hs {
    color: var(--header-color-active, #111);
}

.myplatz-prices[data-season="ns"] .myplatz-prices__row--header .myplatz-prices__price--ns {
    color: var(--header-color-active, #111);
}

/* Active season left in both-mode: flip column order when needed */
.myplatz-prices[data-mode="both"][data-season="ns"] .myplatz-prices__prices {
    grid-template-columns: var(--price-col-ns) var(--price-col-hs);
}

.myplatz-prices[data-mode="both"][data-season="ns"] .myplatz-prices__price--hs {
    order: 2;
}

.myplatz-prices[data-mode="both"][data-season="ns"] .myplatz-prices__price--ns {
    order: 1;
}

/* Grouping */
.myplatz-prices__group {
    margin-bottom: 1.25rem;
}

.myplatz-prices__group-title {
    margin: 0 0 .5rem;
    font-weight: 600;
    font-size: 1.05em;
}

/* Badges */
.myplatz-prices__badge {
    display: inline-block;
    background: rgba(0, 0, 0, .08);
    color: #222;
    font-size: .65em;
    line-height: 1.15;
    /* gives a bit more optical breathing room */
    padding: .25em .60em .27em;
    /* near-symmetric vertical padding to visually center glyphs */
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-left: .4rem;
    vertical-align: middle;
}

.myplatz-prices__badge--persons {
    background: var(--myplatz-primary, #0073aa);
    color: #fff;
}

.myplatz-prices__badge--type {
    background: rgba(0, 0, 0, .15);
}

/* Mobile layout for both-season view: label on top, prices below */
@media (max-width: 600px) {
    .myplatz-prices {
        --label-col: 1fr;
        --gap-label-price: .75rem;
        --gap-price-price: .5rem;
    }

    .myplatz-prices[data-mode="both"] .myplatz-prices__row {
        grid-template-columns: 1fr;
        row-gap: .5rem;
        padding: .55rem 0;
    }

    .myplatz-prices[data-mode="both"] .myplatz-prices__row--header {
        display: none;
    }

    .myplatz-prices[data-mode="both"] .myplatz-prices__prices {
        grid-template-columns: 1fr 1fr;
        gap: var(--gap-price-price);
    }

    .myplatz-prices[data-mode="both"] .myplatz-prices__price {
        text-align: left;
    }

    .myplatz-prices[data-mode="both"] .myplatz-prices__box-wrap {
        justify-content: stretch;
    }

    .myplatz-prices[data-mode="both"] .myplatz-prices__box {
        width: 100%;
        padding: .45rem .55rem;
        border-radius: 10px;
        justify-content: space-between;
        gap: .5rem;
    }

    .myplatz-prices[data-mode="both"] .myplatz-prices__box::before {
        font-size: .75em;
        opacity: .7;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
        line-height: 1;
    }

    .myplatz-prices[data-mode="both"] .myplatz-prices__price--hs .myplatz-prices__box::before {
        content: "HS";
    }

    .myplatz-prices[data-mode="both"] .myplatz-prices__price--ns .myplatz-prices__box::before {
        content: "NS";
    }

    .myplatz-prices[data-mode="both"] .myplatz-prices__box-amount {
        font-size: .95em;
        white-space: nowrap;
    }
}