/* Self-contained — no assumptions about the active theme's framework
 * (e.g. Bootstrap), since this plugin should work on any site's front end. */

/* .tt-btn is used on both <button> (the modal's own "Book Now"/"Pay"
 * buttons) and <a> (the inline per-ticket links, tt_render_per_ticket_book_buttons(),
 * public/shortcode.php) — box-sizing/font-family/vertical-align are set
 * explicitly here since these otherwise-invisible UA/theme defaults can
 * differ between the two element types even with identical classes.
 *
 * No !important anywhere in this file, by design — a dev embedding this
 * plugin should be able to restyle it from their own theme CSS. Instead,
 * the element-type + two-class selectors below (e.g. a.tt-btn.tt-btn-primary)
 * outrank plain single-class or element theme rules (e.g. a bare `a{...}`)
 * on specificity alone, without locking a theme out — an equally or more
 * specific override (or a rule loaded later at the same specificity) still
 * wins normally. */
a.tt-btn,
button.tt-btn {
    display: inline-block;
    box-sizing: border-box;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    vertical-align: middle;
    cursor: pointer;
    text-decoration: none;
}

a.tt-btn.tt-btn-primary,
button.tt-btn.tt-btn-primary,
a.tt-btn.tt-btn-primary:visited,
button.tt-btn.tt-btn-primary:visited {
    background: #2271b1;
    color: #fff;
}

a.tt-btn.tt-btn-primary:hover,
button.tt-btn.tt-btn-primary:hover,
a.tt-btn.tt-btn-primary:focus,
button.tt-btn.tt-btn-primary:focus {
    background: #135e96;
    color: #fff;
}

.tt-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tt-btn-link {
    background: none;
    border: none;
    color: #2271b1;
    text-decoration: underline;
    padding: 10px 4px;
}

.tt-booking-form {
    max-width: 480px;
}

.tt-booking-form-title {
    margin: 0 0 4px;
}

.tt-booking-form-price {
    margin: 0 0 16px;
    font-weight: 600;
}

.tt-cart-booking-form {
    max-width: 100%;
}

.tt-cart-title {
    margin: 0 0 16px;
}

.tt-cart-line-title {
    margin: 0 0 10px;
}

.tt-cart-picker-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid #dcdcde;
}

.tt-cart-picker-row:first-of-type {
    border-top: none;
}

/* display="inline"'s per-ticket rows (tt_render_per_ticket_book_buttons(),
 * public/shortcode.php) — just a bare button per ticket, no info block, so
 * this is only spacing between multiple buttons, not a row layout. */
.tt-ticket-book-row + .tt-ticket-book-row {
    margin-top: 10px;
}

.tt-cart-picker-row.is-unavailable {
    opacity: 0.6;
}

.tt-cart-picker-info {
    flex: 1 1 auto;
}

.tt-cart-picker-name {
    margin: 0 0 4px;
    font-weight: 600;
}

.tt-cart-picker-description {
    margin: 0 0 4px;
    font-size: 13px;
    color: #50575e;
}

.tt-cart-picker-price {
    margin: 0;
    font-size: 13px;
}

.tt-cart-picker-qty {
    flex: 0 0 auto;
}

.tt-cart-picker-unavailable {
    font-size: 13px;
    font-weight: 600;
    color: #50575e;
}

.tt-qty-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    overflow: hidden;
}

button.tt-qty-btn {
    flex: 0 0 auto;
    width: 32px;
    padding: 0;
    border: none;
    background: #f0f0f1;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: #1d2327;
}

button.tt-qty-btn:hover {
    background: #dcdcde;
}

.tt-cart-qty-input {
    width: 50px;
    padding: 8px 4px;
    border: none;
    border-left: 1px solid #c3c4c7;
    border-right: 1px solid #c3c4c7;
    font-size: 15px;
    text-align: center;
    box-sizing: border-box;
    appearance: textfield;
    -moz-appearance: textfield;
}

.tt-cart-qty-input::-webkit-outer-spin-button,
.tt-cart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tt-cart-line-wrapper + .tt-cart-line-wrapper,
.tt-cart-line + .tt-cart-line {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dcdcde;
}

.tt-cart-screen .tt-btn {
    margin-right: 8px;
}

/* ── Inline accordion ─────────────────────────────────────────────────── */

.tt-cart-accordion-item {
    border-top: 1px solid #dcdcde;
}

.tt-cart-accordion-item:last-child {
    border-bottom: 1px solid #dcdcde;
}

.tt-cart-accordion-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    cursor: pointer;
    list-style: none;
}

.tt-cart-accordion-summary::-webkit-details-marker {
    display: none;
}

.tt-cart-accordion-summary .tt-cart-picker-name {
    flex: 1 1 auto;
    margin: 0;
}

.tt-cart-accordion-summary .tt-cart-picker-price {
    flex: 0 0 auto;
}

.tt-cart-accordion-body {
    padding: 0 0 20px;
}

.tt-cart-accordion-item.is-unavailable {
    opacity: 0.6;
}

.tt-cart-footer {
    padding-top: 20px;
}

.tt-field {
    margin: 0 0 14px;
}

.tt-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.tt-field input[type="text"],
.tt-field input[type="email"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
}

.tt-field input[type="number"] {
    width: 90px;
    padding: 8px 10px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
}

.tt-booking-additional-attendees {
    margin: 0 0 14px;
}

.tt-booking-additional-toggle-wrap {
    margin: 0 0 14px;
}

.tt-additional-attendee-row {
    padding: 12px 0;
    border-top: 1px solid #dcdcde;
}

.tt-additional-attendee-label {
    margin: 0 0 8px;
    font-weight: 600;
}

.tt-booking-payment-element {
    margin-bottom: 16px;
}

.tt-booking-message {
    margin-top: 12px;
    font-size: 14px;
}

.tt-booking-message--error {
    color: #b32d2e;
}

.tt-booking-message--info {
    color: #50575e;
}

/* ── Modal ─────────────────────────────────────────────────────────────── */

.tt-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.tt-modal.is-open {
    display: flex;
}

.tt-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.tt-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 6px;
    padding: 32px;
    max-width: 991px;
    width: calc(100% - 32px);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.tt-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #50575e;
}

.tt-modal-close:hover {
    color: #1d2327;
}
