/* ==========================================================================
   TicketLocation Modal Checkout
   ========================================================================== */

/* ---------- Reset & Modal Overlay ---------- */

/* Force dark-mode appearance on the entire checkout modal,
   regardless of the event page's light/dark theme setting.
   The page's light-mode rules (e.g. body.light-mode div { color: #111 !important })
   bleed into the modal — these overrides use higher specificity (ID selector)
   to keep all modal text white. */
body #tl-checkout-modal,
body #tl-checkout-modal div,
body #tl-checkout-modal span,
body #tl-checkout-modal p,
body #tl-checkout-modal a,
body #tl-checkout-modal h1,
body #tl-checkout-modal h2,
body #tl-checkout-modal h3,
body #tl-checkout-modal h4,
body #tl-checkout-modal h5,
body #tl-checkout-modal h6,
body #tl-checkout-modal label,
body #tl-checkout-modal button {
  color: #fff !important;
}

/* Restore specific element colors that should NOT be white */
body #tl-checkout-modal .tl-place-order,
body #tl-checkout-modal .tl-place-order__arrow {
  color: #000 !important;
}

body #tl-checkout-modal .tl-notice--success { color: #4ade80 !important; }
body #tl-checkout-modal .tl-notice--warning { color: #fbbf24 !important; }
body #tl-checkout-modal .tl-notice--error   { color: #ff6b6b !important; }
body #tl-checkout-modal .tl-notice--info    { color: #38bdf8 !important; }
body #tl-checkout-modal .tl-cart-item__tier  { color: #c8ff00 !important; }
body #tl-checkout-modal .tl-totals__row--discount { color: #c8ff00 !important; }
body #tl-checkout-modal .tl-coupon__applied  { color: #c8ff00 !important; }
body #tl-checkout-modal .tl-coupon-notice__text { color: #c8ff00 !important; }
body #tl-checkout-modal .tl-login-prompt a   { color: #c8ff00 !important; }
body #tl-checkout-modal .tl-bogo-badge       { color: #4ade80 !important; }
body #tl-checkout-modal .tl-cart-item__price--free { color: #4ade80 !important; }
body #tl-checkout-modal .tl-totals__row--bogo { color: #4ade80 !important; }
body #tl-checkout-modal .tl-bogo-amount      { color: #4ade80 !important; }
body #tl-checkout-modal .tl-bogo-detail      { color: #4ade80 !important; }
body #tl-checkout-modal .tl-qty-minus--remove { color: #ff6b6b !important; }
body #tl-checkout-modal .tl-error            { color: #ff6b6b !important; }
body #tl-checkout-modal .tl-field label      { color: rgba(255, 255, 255, 0.45) !important; }
body #tl-checkout-modal .tl-section-title    { color: rgba(255, 255, 255, 0.4) !important; }
body #tl-checkout-modal .tl-divider          { color: rgba(255, 255, 255, 0.4) !important; }
body #tl-checkout-modal .tl-totals__row      { color: rgba(255, 255, 255, 0.7) !important; }
body #tl-checkout-modal .tl-totals__row--total { color: #fff !important; }
body #tl-checkout-modal .tl-login-prompt     { color: rgba(255, 255, 255, 0.5) !important; }
body #tl-checkout-modal .tl-coupon__label    { color: rgba(255, 255, 255, 0.5) !important; }
body #tl-checkout-modal .tl-secure-footer    { color: rgba(255, 255, 255, 0.3) !important; }
body #tl-checkout-modal .tl-legal-text       { color: rgba(255, 255, 255, 0.15) !important; }
body #tl-checkout-modal .tl-legal-text p     { color: rgba(255, 255, 255, 0.15) !important; }
body #tl-checkout-modal .tl-legal-text a     { color: rgba(255, 255, 255, 0.25) !important; }
body #tl-checkout-modal .tl-coupon-notice    { color: #e0e0ff !important; }
body #tl-checkout-modal .tl-coupon-notice__auto { color: rgba(255, 255, 255, 0.6) !important; }
body #tl-checkout-modal .tl-processing p     { color: rgba(255, 255, 255, 0.6) !important; }
body #tl-checkout-modal .tl-success p        { color: rgba(255, 255, 255, 0.6) !important; }
body #tl-checkout-modal .tl-expired p        { color: rgba(255, 255, 255, 0.6) !important; }

.tl-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tl-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.tl-modal__container {
  position: relative;
  width: 100%;
  max-width: 820px;
  max-height: 95vh;
  overflow-y: auto;
  background: #111111;
  border-radius: 16px;
  color: #fff;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.tl-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 18px;
  line-height: 32px;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.tl-modal__close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ---------- Content Layout ---------- */

/* Desktop: 2-column grid.
   Header + form + payment sit in the left column,
   summary + action sit in the right column. */
.tl-modal__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  gap: 0;
}

/* Desktop: left column sections */
.tl-section--header  { grid-column: 1; }
.tl-section--form    { grid-column: 1; }
.tl-section--payment { grid-column: 1; }

/* Desktop: right column sections */
.tl-section--summary { grid-column: 2; grid-row: 1 / span 3; }
.tl-section--action  { grid-column: 2; }

/* Mobile: single scrollable column in exact order:
   1. Header (title + express pay)
   2. Form (personal info)
   3. Payment (card input)
   4. Summary (tickets, coupon, fees)
   5. Action (place order button) */
@media (max-width: 680px) {
  .tl-modal__content {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }

  .tl-section--header  { order: 1; }
  .tl-section--summary { order: 2; }
  .tl-section--form    { order: 3; }
  .tl-section--payment { order: 4; }
  .tl-section--action  { order: 5; }
}

/* ---------- Sections ---------- */

.tl-section {
  padding: 0 28px;
}

.tl-section--header {
  padding-top: 32px;
}

.tl-section--form {
  padding-bottom: 0;
}

.tl-section--payment {
  padding-bottom: 16px;
}

.tl-section--summary {
  padding-top: 32px;
  padding-bottom: 0;
  background: rgba(255, 255, 255, 0.03);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.tl-section--action {
  padding-bottom: 32px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.tl-section--header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 24px;
  color: #fff;
}

/* Legacy class compat */
.tl-checkout-form {
  padding: 32px 28px;
}

.tl-checkout-form h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 24px;
  color: #fff;
}

#tl-checkout-modal .tl-section-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#tl-checkout-modal .tl-section-title:first-of-type {
  margin-top: 0;
}

/* ---------- Form Fields ---------- */
/* Scoped under #tl-checkout-modal for specificity to beat theme/WooCommerce globals */

#tl-checkout-modal .tl-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

#tl-checkout-modal .tl-form-row--full {
  grid-template-columns: 1fr;
}

#tl-checkout-modal .tl-field {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

#tl-checkout-modal .tl-field label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

#tl-checkout-modal .tl-field input,
#tl-checkout-modal .tl-field select {
  width: 100%;
  padding: 8px;
  border: 1px solid #a1a1a133 !important;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
  -webkit-text-fill-color: #fff !important;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Override browser autofill styles (Chrome, Safari, Edge).
   Autofill paints a light blue/white background by default —
   the inset box-shadow trick forces the dark background to persist. */
#tl-checkout-modal .tl-field input:-webkit-autofill,
#tl-checkout-modal .tl-field input:-webkit-autofill:hover,
#tl-checkout-modal .tl-field input:-webkit-autofill:focus,
#tl-checkout-modal .tl-field input:-webkit-autofill:active,
#tl-checkout-modal .tl-field select:-webkit-autofill,
#tl-checkout-modal .tl-field select:-webkit-autofill:hover,
#tl-checkout-modal .tl-field select:-webkit-autofill:focus,
#tl-checkout-modal .tl-field select:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #1a1a1a inset !important;
  -webkit-text-fill-color: #fff !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  caret-color: #fff !important;
  transition: background-color 5000s ease-in-out 0s !important;
  background-color: #1a1a1a !important;
}

#tl-checkout-modal .tl-field input::placeholder {
  color: rgba(255, 255, 255, 0.18) !important;
  font-weight: 400 !important;
  font-size: 12px !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.18) !important;
}

#tl-checkout-modal .tl-field input::-webkit-input-placeholder {
  color: rgba(255, 255, 255, 0.18) !important;
  font-weight: 400 !important;
  font-size: 12px !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.18) !important;
}

#tl-checkout-modal .tl-field input::-moz-placeholder {
  color: rgba(255, 255, 255, 0.18) !important;
  font-weight: 400 !important;
  font-size: 12px !important;
}

#tl-checkout-modal .tl-field input:hover,
#tl-checkout-modal .tl-field select:hover {
  border-color: #a1a1a155 !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

#tl-checkout-modal .tl-field input:focus,
#tl-checkout-modal .tl-field select:focus {
  border-color: #a1a1a188 !important;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.08) !important;
}

#tl-checkout-modal .tl-field select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  padding-right: 36px;
}

#tl-checkout-modal .tl-field select option {
  background: #1a1a1a;
  color: #fff;
}

/* ---------- Express Pay (Apple Pay / Google Pay) at top ---------- */

#tl-express-pay-section {
  margin-bottom: 8px;
}

.tl-payment-express {
  margin-bottom: 0;
  min-height: 44px;
}

/* ---------- Payment Method ---------- */

.tl-payment-methods {
  margin-top: 8px;
}

.tl-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tl-divider::before,
.tl-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

/* Stripe Card Element container */
.tl-card-element {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  min-height: 20px;
}

.tl-card-element.StripeElement--focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.tl-card-element.StripeElement--invalid {
  border-color: #ff4d4d;
}

/* ---------- Login Prompt ---------- */

.tl-login-prompt {
  margin-top: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.tl-login-prompt a {
  color: #c8ff00;
  text-decoration: none;
  font-weight: 600;
}

.tl-login-prompt a:hover {
  text-decoration: underline;
}

/* ---------- Right Column: Order Summary ---------- */

/* Legacy class — kept for skeleton loader compat */
.tl-order-summary {
  padding: 32px 28px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.tl-order-summary h3,
.tl-section--summary h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 20px;
  color: #fff;
}

/* ---------- Cart Items ---------- */

.tl-cart-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  align-items: center;
  position: relative;
}

/* Item removal is handled by the minus button at quantity 1. */

.tl-cart-item:last-child {
  border-bottom: none;
}

.tl-cart-item__image {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.tl-cart-item__details {
  flex: 1;
  min-width: 0;
}

.tl-cart-item__name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-cart-item__tier {
  font-size: 12px;
  color: #c8ff00;
  margin: 0 0 6px;
}

.tl-cart-item__price {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

/* Quantity controls */
.tl-qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  overflow: hidden;
  margin-left: 10px;
}

.tl-qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.tl-qty-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tl-qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* At quantity 1, the minus button becomes a remove/delete action. */
.tl-qty-minus--remove {
  color: #ff6b6b;
}
.tl-qty-minus--remove:hover {
  background: rgba(255, 107, 107, 0.15);
}

.tl-qty-value {
  width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  line-height: 28px;
}

/* ---------- Coupon ---------- */

.tl-coupon {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.tl-coupon__label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#tl-checkout-modal .tl-coupon input {
  flex: 1;
  padding: 8px;
  border: 1px solid #a1a1a133 !important;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

#tl-checkout-modal .tl-coupon input::placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.3) !important;
}

#tl-checkout-modal .tl-coupon input:-webkit-autofill,
#tl-checkout-modal .tl-coupon input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #1a1a1a inset !important;
  -webkit-text-fill-color: #fff !important;
}

.tl-coupon__btn {
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.tl-coupon__btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.tl-coupon__applied {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(200, 255, 0, 0.1);
  border: 1px solid rgba(200, 255, 0, 0.2);
  border-radius: 6px;
  font-size: 13px;
  color: #c8ff00;
  margin: 16px 0;
}

.tl-coupon__remove {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.tl-coupon__remove:hover {
  color: #ff4d4d;
}

/* Coupon auto-apply notice */
.tl-coupon-notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 6px;
  font-size: 13px;
  color: #e0e0ff;
}

.tl-coupon-notice__text {
  font-weight: 600;
  color: #c8ff00;
}

.tl-coupon-notice__code {
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #fff;
  text-transform: uppercase;
}

.tl-coupon-notice__auto {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

/* ---------- Totals ---------- */

.tl-totals {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tl-totals__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.tl-totals__row--discount {
  color: #c8ff00;
}

.tl-totals__row--total {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Place Order Button ---------- */

#tl-checkout-modal .tl-place-order {
  width: 100%;
  padding: 16px;
  margin-top: 20px;
  border: none !important;
  border-radius: 5px;
  background: #c8ff00 !important;
  color: #000 !important;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#tl-checkout-modal .tl-place-order:hover {
  opacity: 0.9;
}

#tl-checkout-modal .tl-place-order:active {
  transform: scale(0.98);
}

#tl-checkout-modal .tl-place-order:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#tl-checkout-modal .tl-place-order__arrow {
  font-size: 18px;
  color: #000 !important;
}

/* ---------- Footer ---------- */

.tl-secure-footer {
  text-align: center;
  margin-top: 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- Trust Badges ---------- */

.tl-trust-badges {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tl-trust-badges__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.tl-trust-badges__icon {
  flex-shrink: 0;
  opacity: 0.5;
}

/* ---------- Legal Text ---------- */

.tl-legal-text {
  margin-top: 12px;
  font-size: 10px !important;
  color: rgba(255, 255, 255, 0.15) !important;
  line-height: 1.5;
  text-align: center;
}

.tl-legal-text p {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.15) !important;
}

.tl-legal-text a {
  color: rgba(255, 255, 255, 0.25) !important;
  text-decoration: underline;
}

.tl-legal-text a:hover {
  color: rgba(255, 255, 255, 0.4) !important;
}

/* ---------- Notices ---------- */

.tl-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  transition: opacity 0.3s;
}

.tl-notice--success {
  background: rgba(11, 148, 68, 0.15);
  border: 1px solid rgba(11, 148, 68, 0.3);
  color: #4ade80;
}

.tl-notice--warning {
  background: rgba(255, 200, 0, 0.12);
  border: 1px solid rgba(255, 200, 0, 0.3);
  color: #fbbf24;
}

.tl-notice--error {
  background: rgba(255, 77, 77, 0.12);
  border: 1px solid rgba(255, 77, 77, 0.3);
  color: #ff6b6b;
}

.tl-notice--info {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

.tl-notice__message {
  flex: 1;
}

.tl-notice__close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.tl-notice__close:hover {
  opacity: 1;
}

/* ---------- BOGO Free Items ---------- */

.tl-cart-item--free {
  opacity: 0.9;
}

.tl-bogo-badge {
  display: inline-block;
  background: rgba(11, 148, 68, 0.2);
  color: #4ade80;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: 6px;
  vertical-align: middle;
}

.tl-cart-item__price--free {
  color: #4ade80 !important;
  font-weight: 600;
}

/* ---------- BOGO Savings Row ---------- */

.tl-totals__row--bogo {
  color: #4ade80;
}

.tl-totals__row--bogo small {
  font-size: 11px;
  opacity: 0.8;
}

.tl-bogo-amount {
  color: #4ade80;
  font-weight: 600;
}

.tl-bogo-detail {
  color: #4ade80;
}

/* ---------- Error / Loading States ---------- */

.tl-error {
  background: rgba(255, 77, 77, 0.12);
  border: 1px solid rgba(255, 77, 77, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #ff6b6b;
  margin: 12px 0;
}

.tl-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: rgba(255, 255, 255, 0.5);
}

.tl-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #c8ff00;
  border-radius: 50%;
  animation: tl-spin 0.6s linear infinite;
  margin-right: 10px;
}

@keyframes tl-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Processing / Confirming State ---------- */

.tl-processing {
  text-align: center;
  padding: 48px 32px;
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.tl-spinner--lg {
  width: 48px;
  height: 48px;
  border-width: 3px;
  margin: 0 0 24px;
}

.tl-processing h2 {
  font-size: 22px;
  margin: 0 0 8px;
  color: #fff;
}

.tl-processing p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* ---------- Success State ---------- */

.tl-success {
  text-align: center;
  padding: 48px 32px;
  grid-column: 1 / -1;
}

.tl-success__icon {
  width: 64px;
  height: 64px;
  background: rgba(200, 255, 0, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
}

.tl-success h2 {
  font-size: 22px;
  margin: 0 0 8px;
  color: #fff;
}

.tl-success p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* ---------- Expired / Timeout State ---------- */

.tl-expired {
  text-align: center;
  padding: 48px 32px;
  grid-column: 1 / -1;
}

.tl-expired__icon {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
  color: rgba(255, 255, 255, 0.6);
}

.tl-expired h2 {
  font-size: 22px;
  margin: 0 0 8px;
  color: #fff;
}

.tl-expired p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 24px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Skeleton Loading ---------- */

@keyframes tl-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.tl-skel {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 800px 100%;
  animation: tl-shimmer 1.5s ease-in-out infinite;
  border-radius: 5px;
}

.tl-skel--title {
  height: 24px;
  width: 50%;
  margin-bottom: 24px;
  border-radius: 6px;
}

.tl-skel--subtitle {
  height: 18px;
  width: 45%;
  margin-bottom: 20px;
  border-radius: 5px;
}

.tl-skel--label {
  height: 12px;
  width: 40%;
  margin-bottom: 14px;
  border-radius: 3px;
}

.tl-skel--label-sm {
  height: 10px;
  width: 60%;
  margin-bottom: 6px;
  border-radius: 3px;
}

.tl-skel--input {
  height: 38px;
  width: 100%;
  border-radius: 5px;
}

.tl-skel--card {
  height: 44px;
  width: 100%;
  border-radius: 5px;
}

.tl-skel--item {
  height: 56px;
  width: 100%;
  margin-bottom: 10px;
  border-radius: 8px;
}

.tl-skel--divider {
  height: 1px;
  width: 100%;
  margin: 16px 0;
  background: rgba(255,255,255,0.06);
  animation: none;
}

.tl-skel--row {
  height: 14px;
  width: 100%;
  margin-bottom: 8px;
  border-radius: 3px;
}

.tl-skel--row-total {
  height: 20px;
  width: 100%;
  margin-top: 12px;
  border-radius: 4px;
}

.tl-skel--button {
  height: 50px;
  width: 100%;
  margin-top: 20px;
  border-radius: 50px;
}

.tl-skeleton-form {
  padding: 32px 28px;
}

.tl-skeleton-summary {
  padding: 32px 28px;
}

/* ---------- Scrollbar ---------- */

.tl-modal__container::-webkit-scrollbar {
  width: 6px;
}

.tl-modal__container::-webkit-scrollbar-track {
  background: transparent;
}

.tl-modal__container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* ---------- Animations ---------- */

.tl-modal--entering {
  animation: tl-fade-in 0.25s ease-out;
}

.tl-modal--entering .tl-modal__container {
  animation: tl-slide-up 0.3s ease-out;
}

@keyframes tl-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tl-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   Mobile-First Responsive (90%+ users are on mobile)
   ========================================================================== */

@media (max-width: 680px) {

  /* -- Modal: anchor to top so content is never clipped above viewport -- */
  .tl-modal {
    padding: 10px;
    align-items: flex-start;
  }

  .tl-modal__container {
    max-width: 100%;
    max-height: calc(100dvh - 20px);
    height: auto;
    border-radius: 16px;
    box-shadow: none;
    -webkit-overflow-scrolling: touch;
  }

  .tl-modal--entering .tl-modal__container {
    animation: tl-slide-up-mobile 0.3s ease-out;
  }

  @keyframes tl-slide-up-mobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  /* -- Close button: larger touch target on mobile -- */
  .tl-modal__close {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    font-size: 20px;
    line-height: 36px;
  }

  /* -- Sections: single column, mobile padding -- */
  .tl-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tl-section--header {
    padding-top: 20px;
  }

  .tl-section--summary {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 20px;
    padding-bottom: 20px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
  }

  .tl-section--form {
    padding-top: 24px;
  }

  .tl-section--action {
    border-left: none;
    padding-bottom: 24px;
    background: rgba(255, 255, 255, 0.03);
  }

  /* Legacy compat */
  .tl-modal__content .tl-order-summary {
    border-left: none;
    padding: 20px 16px;
  }

  .tl-modal__content .tl-checkout-form {
    padding: 20px 16px;
  }

  /* -- Form rows: stack to single column on small screens -- */
  #tl-checkout-modal .tl-form-row {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }

  /* -- Inputs: taller touch targets (min 44px per Apple HIG) -- */
  #tl-checkout-modal .tl-field input,
  #tl-checkout-modal .tl-field select {
    padding: 12px 12px;
    font-size: 16px; /* Prevents iOS auto-zoom on focus */
  }

  #tl-checkout-modal .tl-field label {
    font-size: 11px;
    margin-bottom: 4px;
  }

  /* -- Section titles -- */
  #tl-checkout-modal .tl-section-title {
    margin: 20px 0 12px;
    font-size: 11px;
  }

  /* -- Cart items: compact layout -- */
  .tl-cart-item {
    padding: 10px 0;
    gap: 10px;
  }

  .tl-cart-item__image {
    width: 44px;
    height: 44px;
    border-radius: 6px;
  }

  .tl-cart-item__name {
    font-size: 13px;
  }

  .tl-cart-item__price {
    font-size: 14px;
  }

  /* -- Qty controls: larger touch targets -- */
  .tl-qty-btn {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .tl-qty-value {
    width: 34px;
    line-height: 34px;
    font-size: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
  }

  /* -- Coupon input -- */
  #tl-checkout-modal .tl-coupon input {
    padding: 12px 12px;
    font-size: 16px; /* Prevent iOS zoom */
  }

  .tl-coupon {
    gap: 8px;
    margin: 12px 0;
  }

  .tl-coupon__btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  /* -- Totals -- */
  .tl-totals {
    margin-top: 12px;
    padding-top: 12px;
  }

  .tl-totals__row {
    font-size: 13px;
  }

  .tl-totals__row--total {
    font-size: 16px;
  }

  /* -- Place Order button: full width, tall -- */
  #tl-checkout-modal .tl-place-order {
    padding: 18px;
    font-size: 17px;
    margin-top: 16px;
  }

  /* -- Notices: full width -- */
  .tl-notice {
    font-size: 13px;
    padding: 10px 12px;
  }

  /* -- Express pay section -- */
  #tl-express-pay-section {
    margin-bottom: 4px;
  }

  .tl-divider {
    margin: 12px 0;
    font-size: 11px;
  }

  /* -- Card element -- */
  .tl-card-element {
    padding: 14px 12px;
  }

  /* -- Headings -- */
  .tl-order-summary h3,
  .tl-section--summary h3 {
    font-size: 20px;
    margin-bottom: 16px;
  }

  .tl-checkout-form h2,
  .tl-section--header h2 {
    font-size: 20px;
    margin-bottom: 16px;
  }

  /* -- Success / expired / processing states -- */
  .tl-success,
  .tl-expired,
  .tl-processing {
    padding: 32px 20px;
  }

  /* -- Footer -- */
  .tl-secure-footer {
    margin-top: 10px;
    font-size: 10px;
  }

  /* -- Login prompt -- */
  .tl-login-prompt {
    margin-top: 12px;
    font-size: 12px;
  }

  /* -- BOGO badge -- */
  .tl-bogo-badge {
    font-size: 9px;
    padding: 2px 5px;
  }

  /* -- Skeleton loading -- */
  .tl-skeleton-form,
  .tl-skeleton-summary {
    padding: 20px 16px;
  }
}

/* Extra small screens (iPhone SE, etc.) */
@media (max-width: 380px) {
  .tl-cart-item__image {
    width: 36px;
    height: 36px;
  }

  .tl-cart-item__name {
    font-size: 12px;
  }

  .tl-cart-item__price {
    font-size: 13px;
  }

  .tl-checkout-form h2 {
    font-size: 18px;
  }
}
