/*
 * Bootstrap 5 compatibility layer for the existing public KSC theme.
 * Keep these rules scoped to the V5 public layout so the legacy layout remains
 * an exact rollback path. This file preserves Bootstrap 4-era structure; it is
 * not a visual redesign.
 */

.ksc-public-v5 {
    --ksc-public-gutter: 30px;
    overflow-x: hidden;
}

/* Bootstrap 5 adds a 1320px container at this breakpoint. The public theme was
   designed against Bootstrap 4's 1140px maximum and widens noticeably without
   this cap. */
@media (min-width: 1400px) {
    .ksc-public-v5 .container {
        max-width: 1140px;
    }
}

.ksc-public-v5 .row {
    --bs-gutter-x: var(--ksc-public-gutter);
}

/* Bootstrap 4 form-row contract retained for existing Razor forms. */
.ksc-public-v5 .form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -5px;
    margin-left: -5px;
}

.ksc-public-v5 .form-row > .col,
.ksc-public-v5 .form-row > [class*="col-"] {
    padding-right: 5px;
    padding-left: 5px;
}

.ksc-public-v5 .form-group {
    margin-bottom: 1rem;
}

.ksc-public-v5 .form-inline {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
}

.ksc-public-v5 .btn-default {
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}

.ksc-public-v5 .btn-default:hover,
.ksc-public-v5 .btn-default:focus {
    color: #333;
    background-color: #e6e6e6;
    border-color: #adadad;
}

/* Bootstrap 4 close-button presentation used by existing public modals and
   alerts. Bootstrap 5 behavior is supplied by data-bs-dismiss/native APIs. */
.ksc-public-v5 .close {
    float: right;
    padding: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .5;
    background: transparent;
    border: 0;
    appearance: none;
}

.ksc-public-v5 .close:hover,
.ksc-public-v5 .close:focus {
    color: #000;
    text-decoration: none;
    opacity: .75;
}

.ksc-public-v5 .modal-header .close {
    padding: 1rem;
    margin: -1rem -1rem -1rem auto;
}

/* Renamed Bootstrap 4 utilities still present in the existing theme markup. */
.ksc-public-v5 .font-weight-bold { font-weight: 700 !important; }
.ksc-public-v5 .font-weight-normal { font-weight: 400 !important; }
.ksc-public-v5 .font-italic { font-style: italic !important; }
.ksc-public-v5 .float-left { float: left !important; }
.ksc-public-v5 .float-right { float: right !important; }
.ksc-public-v5 .text-left { text-align: left !important; }
.ksc-public-v5 .text-right { text-align: right !important; }
.ksc-public-v5 .ml-auto { margin-left: auto !important; }
.ksc-public-v5 .mr-auto { margin-right: auto !important; }
.ksc-public-v5 .ml-1 { margin-left: .25rem !important; }
.ksc-public-v5 .ml-2 { margin-left: .5rem !important; }
.ksc-public-v5 .ml-3 { margin-left: 1rem !important; }
.ksc-public-v5 .ml-4 { margin-left: 1.5rem !important; }
.ksc-public-v5 .ml-5 { margin-left: 3rem !important; }
.ksc-public-v5 .mr-1 { margin-right: .25rem !important; }
.ksc-public-v5 .mr-2 { margin-right: .5rem !important; }
.ksc-public-v5 .mr-3 { margin-right: 1rem !important; }
.ksc-public-v5 .mr-4 { margin-right: 1.5rem !important; }
.ksc-public-v5 .mr-5 { margin-right: 3rem !important; }
.ksc-public-v5 .pl-0 { padding-left: 0 !important; }
.ksc-public-v5 .pr-0 { padding-right: 0 !important; }

/* Native overflow replaces the obsolete custom-scrollbar plugin without
   changing the sidebar dimensions or open/close class contract. */
.ksc-public-v5 #sidebar {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Preserve Bootstrap 4 validation visibility semantics used by MVC helpers. */
.ksc-public-v5 .field-validation-valid,
.ksc-public-v5 .validation-summary-valid {
    display: none;
}

.ksc-public-v5 .field-validation-error,
.ksc-public-v5 .validation-summary-errors {
    color: #dc3545;
}

/* The payment/ticket regions are printed without a second Bootstrap payload. */
@media print {
    .ksc-public-v5 header,
    .ksc-public-v5 footer,
    .ksc-public-v5 #carttimer,
    .ksc-public-v5 .backtotop,
    .ksc-public-v5 .no-print {
        display: none !important;
    }

    .ksc-public-v5 .main-content-wrapper {
        padding-top: 0 !important;
    }

    .ksc-public-v5 #printticket {
        width: 100% !important;
        max-width: none !important;
    }
}
