/* Allow users to scroll to the bottom of the page. */
@media (max-width: 768px) {
    .overlay-content {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    html, body {
        height: 100%;
        overflow: auto;
    }

    .TicketShopWrapper {
        height: auto;
        overflow: visible;
    }
}

.DonationPictureWrapper {
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
}
.DonationPictureWrapper > img {
    object-fit: cover;
}
.DonationPageDescription {
    margin-bottom: 16px;
}

.DonationCard {
    margin: 0 0 20px 0;
	padding: 15px;
	border: 1px solid var(--border-color-medium);
	border-radius: var(--secondary-radius);
    transition: 0.2s ease;
}
.DonationCard:hover {
    border: 1px solid var(--border-color-dark);
	box-shadow: var(--shadow-light);
}
.DonationCardHeader {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.DonationCardName {
    font-size: 20px;
    font-weight: 400;
}
.DonationCardMain {
    border-radius: inherit;
    min-height: 60px;

    display: flex;
    justify-content: space-evenly;
    align-content: stretch;
}
.DonationLeft, .DonationRight {
    text-align: center;
    border-radius: inherit;
    padding-top: 15px;
}
.DonationLeft {
    flex-basis: 33.333%;
    text-align: left;
    padding-right: 20px;
}
.DonationRight {
    flex-basis: 66.667%;

    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 20px;

    padding-right: 1px;
    position: relative;
    min-width: 0;
}
.DonationPicture {
    border-radius: 8px;
    overflow: hidden;
}

.DonationDescription {
    padding: 0;
    text-align: left;
}
.DonationRadioGroup {
    width: calc(100% - 2px);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.DonationRadioGroup > legend {
    text-align: left;
}
.DonationRadioButton {
    border-radius: 8px;
    padding: 3px;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.DonationPrice {
    width: 100px;
    max-height: 40px;
}
.DonationProgressWrapper {
    align-self: center;
}
.DonationProgressLabel {
    width: 95%;
    align-self: center;
}

/* Expanding Card Fade */
.DonationCardMain {
    position: relative;     /* anchors ::after */
    overflow: hidden;
    transition: max-height 200ms ease;
}
/* Only clamp when collapsible */
.DonationCard.is-collapsible > .DonationCardMain {
    overflow: hidden;
    height: 0;
    min-height: 0;
}

/* Fade only when collapsible AND not expanded */
.DonationCard.is-collapsible:not(.expanded) > .DonationCardMain::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;

    /* Fade from transparent to the card background color */
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 1)
    );

    pointer-events: none;
    opacity: 1;
    transition: opacity 200ms ease;
}
.DonationCard.expanded > .DonationCardMain {
    height: auto;
    overflow: visible;
}
.DonationCard.expanded > .DonationCardMain::after {
    opacity: 0;     /* Disable the fade when expanded */
}

.DonationMoreOptions {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 15px;
    width: 100%;
}

.DonationMoreOptions div {
    width: 100%;
}

.DonationMoreOptions input[type="checkbox"] {
    margin-right: 2px;
}

.DonType select {
    max-width: 200px;
}

.RecurringDonationMsg {
    /*justify-self: start;*/
    font-size: 13px;
}

.DonEmployerBox {
    border-radius: 8px;
    border: 1px solid var(--border-color-dark);
}

.DonEmployerBox {
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.DonEmployerBox > label > input {
    width: 200px;
}

/* Text inputs that only show when you click on a checkbox must be hidden by default. */
.DonRecognizedAs > input, .DonEmployerBox, .DonInMemoryOf > input, .DonInHonorOf > input {
    display: none;
}

.DonationCard label {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */
}

.DonationCard div.DonationRadioButton {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */
}

.DonationRight .DonationAddToCartButton {
    align-self: end;
}

.DonRecurringDonationEnd input {
    max-width: 200px;
}

.LinkTheme {
    font-size: 16px !important;
}

/* Mobile + small tablets */
@media (max-width: 768px) {
    .DonationCard {
        padding: 16px;
        margin-bottom: 12px;
    }

    .DonationCardHeader {
        align-items: center;
    }

    .DonationCardName {
        font-size: 18px;
        padding-bottom: 0;
        line-height: 1.2;
    }

    /* Stack left/right */
    .DonationCardMain {
        flex-direction: column;
        justify-content: flex-start;
        gap: 14px;
    }

    .DonationLeft,
    .DonationRight {
        flex-basis: auto;
        width: 100%;
        padding: 0;
        text-align: left;
    }
    
    .DonationPicture {
        width: 100px;
        justify-self: center;
        aspect-ratio: 1;
        border-radius: 10px;
        transition: width 200ms ease;
        max-height: 400px;
    }

    .DonationPicture img {
        display: block;
        width: 100%;
        height: auto;
    }

    .DonationRadioGroup > legend {
        margin-bottom: 2px;
    }

    /* Make each option easier to tap */
    .DonationRadioButton {
        padding: 10px 12px;
        border: 1px solid var(--border-color-light);
        border-radius: 12px;
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 8px;
        width: calc(50% - 5px); /* 2 columns */
        box-sizing: border-box;
    }

    /* The "Other" label is currently not wrapped in .DonationRadioButton */
    .DonationRadioGroup > label {
        padding: 10px 12px;
        border: 1px solid var(--border-color-light);
        border-radius: 12px;
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 8px;
        width: calc(50% - 5px); /* match the others */
        box-sizing: border-box;
        margin: 0;
    }

    /* Other amount input should be full width */
    .DonationOtherAmount .DonationPrice {
        width: 100px; /* if you prefer compact */
        max-width: 100%;
    }

    .DonationOtherAmount input.uk-input {
        width: 100%;
        max-width: 260px; /* optional: keeps it tidy */
    }

    /* Progress area: full width */
    .DonationProgressWrapper {
        width: 100%;
        align-self: stretch;
    }

    .DonationProgressLabel {
        width: 100%;
    }

    /* More options: reduce visual density */
    .DonationMoreOptions {
        gap: 12px;
    }

    /* Inputs should not be fixed 200px on mobile */
    .DonEmployerBox > label > input,
    .DonRecurringDonationEnd input,
    .DonType select {
        width: 100%;
        max-width: 100%;
    }

    /* Textarea: full width and comfortable */
    .DonationMoreOptions textarea.uk-textarea {
        width: 100%;
        min-height: 110px;
    }

    /* The Add To Cart button should be full width on mobile */
    .DonationRight .DonationAddToCartButton {
        align-self: stretch;
        width: 100%;
    }

    /* On mobile, collapsed cards show only the header */
    .DonationCard.is-collapsible > .DonationCardMain {
        height: 0;
        min-height: 0;
    }

    .DonationCard.is-collapsible:not(.expanded) > .DonationCardMain::after {
        display: none;
    }
    
    .FixedBottomMiddleViewport {
        width: 100%;
    }
}

/* Very small phones: single column options */
@media (max-width: 380px) {
    .DonationRadioButton,
    .DonationRadioGroup > label {
        width: 100%;
    }

    .DonationCard {
        padding: 14px;
    }
}
