/* ========== TOMI Tickets | Woo Order Pay Scoped CSS (Production Ready) ========== */
/* Page scope tokens */
body.woocommerce-order-pay {
  --tt-primary: #2196f3;
  --tt-primary-dark: #234078;
  --tt-text: #374151;
  --tt-muted: #7b8794;
  --tt-border: #e3e8ee;
  --tt-bg: #f6f8fa;
}

/* Base on order-pay page only */
body.woocommerce-order-pay {
  background: var(--tt-bg) !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: "Inter", "Noto Sans TC", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  color: var(--tt-text);
  line-height: 1.5;
}

/* Prevent horizontal overflow on mobile (this page only) */
@media (max-width: 768px) {
  body.woocommerce-order-pay {
    overflow-x: hidden;
  }
}

/* Main Woo container (scoped and safe) */
body.woocommerce-order-pay .entry-content .woocommerce,
body.woocommerce-order-pay .woocommerce:not(header):not(footer) {
  background: #fff;
  border-radius: 18px;
  padding: 32px 36px 30px 36px;
  max-width: 700px;
  margin: 40px auto 26px auto;
  box-shadow: 0 4px 32px rgba(35, 64, 120, 0.08);
  border: 1px solid var(--tt-border);
  min-width: 0;
  width: 100%;
}

@media (max-width: 860px) {
  body.woocommerce-order-pay .entry-content .woocommerce,
  body.woocommerce-order-pay .woocommerce:not(header):not(footer) {
    max-width: 99vw;
    padding: 12px 2vw 10px 2vw;
    margin: 14px auto 10px auto;
  }
}

/* Optional sticky sub-header within payment content (NOT the site header) */
body.woocommerce-order-pay .entry-content .tt-pay-header,
body.woocommerce-order-pay .tt-pay-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
}

/* Tables */
body.woocommerce-order-pay .entry-content table.shop_table,
body.woocommerce-order-pay table.shop_table {
  background: #f2f6fc;
  border-radius: 10px;
  border: 1px solid var(--tt-border);
  margin-bottom: 18px;
  overflow: hidden;
  width: 100%;
}

body.woocommerce-order-pay .entry-content table.shop_table th,
body.woocommerce-order-pay .entry-content table.shop_table td,
body.woocommerce-order-pay table.shop_table th,
body.woocommerce-order-pay table.shop_table td {
  padding: 14px 18px;
  font-size: 1em;
}

body.woocommerce-order-pay .entry-content table.shop_table th,
body.woocommerce-order-pay table.shop_table th {
  background: var(--tt-bg);
  color: var(--tt-primary-dark);
  font-weight: 700;
  border-bottom: 1px solid var(--tt-border);
  text-align: left;
  letter-spacing: 0.02em;
}

body.woocommerce-order-pay .entry-content table.shop_table td,
body.woocommerce-order-pay table.shop_table td {
  color: #1a2333;
  border-bottom: 1px solid #edf1f7;
}

body.woocommerce-order-pay .entry-content table.shop_table tfoot th,
body.woocommerce-order-pay .entry-content table.shop_table tfoot td,
body.woocommerce-order-pay table.shop_table tfoot th,
body.woocommerce-order-pay table.shop_table tfoot td {
  background: var(--tt-bg);
  color: var(--tt-primary);
  font-weight: 700;
  border: none;
  font-size: 1.09em;
  padding-top: 10px;
  padding-bottom: 10px;
}

body.woocommerce-order-pay .entry-content table.shop_table tfoot tr:last-child th,
body.woocommerce-order-pay .entry-content table.shop_table tfoot tr:last-child td,
body.woocommerce-order-pay table.shop_table tfoot tr:last-child th,
body.woocommerce-order-pay table.shop_table tfoot tr:last-child td {
  font-size: 1.13em;
  color: var(--tt-primary-dark);
  border-top: 2px solid var(--tt-border);
}

/* Product info emphasis */
body.woocommerce-order-pay .entry-content table.shop_table .product-name strong,
body.woocommerce-order-pay table.shop_table .product-name strong {
  color: var(--tt-primary);
  font-weight: 700;
  font-size: 1.07em;
}

body.woocommerce-order-pay .entry-content table.shop_table .product-name,
body.woocommerce-order-pay table.shop_table .product-name {
  font-size: 1.04em;
  font-weight: 500;
  line-height: 1.4;
}

body.woocommerce-order-pay .entry-content table.shop_table .product-total,
body.woocommerce-order-pay table.shop_table .product-total {
  font-weight: 600;
}

/* Payment methods block */
body.woocommerce-order-pay .entry-content .wc_payment_methods,
body.woocommerce-order-pay .wc_payment_methods {
  background: var(--tt-bg);
  border-radius: 10px;
  padding: 12px 14px 10px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--tt-border);
  box-shadow: 0 2px 8px rgba(35, 64, 120, 0.02);
}

/* Payment box */
body.woocommerce-order-pay .entry-content .payment_box,
body.woocommerce-order-pay .payment_box {
  background: #edf1f7;
  border-radius: 7px;
  padding: 10px 13px;
  margin-top: 7px;
  color: var(--tt-muted);
  font-size: 0.97em;
  border: 1px solid var(--tt-border);
}

/* Inputs */
body.woocommerce-order-pay .entry-content input,
body.woocommerce-order-pay .entry-content select,
body.woocommerce-order-pay .entry-content textarea,
body.woocommerce-order-pay input,
body.woocommerce-order-pay select,
body.woocommerce-order-pay textarea {
  border-radius: 9px;
  border: 1.3px solid #c9d7e7;
  background: #fff;
  padding: 12px 10px;
  margin-bottom: 12px;
  font-size: 1em;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

body.woocommerce-order-pay .entry-content input:focus,
body.woocommerce-order-pay .entry-content select:focus,
body.woocommerce-order-pay .entry-content textarea:focus,
body.woocommerce-order-pay input:focus,
body.woocommerce-order-pay select:focus,
body.woocommerce-order-pay textarea:focus {
  border-color: var(--tt-primary);
  box-shadow: 0 0 0 2px #d0e7fb;
  outline: none;
}

/* Checkbox + terms */
body.woocommerce-order-pay .entry-content .woocommerce-form__label-for-checkbox,
body.woocommerce-order-pay .woocommerce-form__label-for-checkbox {
  margin-bottom: 14px;
  font-size: 1em;
  color: var(--tt-text);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.woocommerce-order-pay .entry-content .woocommerce-terms-and-conditions-link,
body.woocommerce-order-pay .woocommerce-terms-and-conditions-link {
  color: var(--tt-primary);
  font-weight: 500;
  text-decoration: underline;
}

/* Buttons (strict scope) */
body.woocommerce-order-pay .entry-content .button,
body.woocommerce-order-pay .entry-content button,
body.woocommerce-order-pay .entry-content .woocommerce a.button,
body.woocommerce-order-pay .entry-content .form-row.place-order .button,
body.woocommerce-order-pay .button.alt,
body.woocommerce-order-pay .form-row.place-order .button {
  background: linear-gradient(90deg, var(--tt-primary) 0%, var(--tt-primary-dark) 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 15px 0 !important;
  font-size: 1.12em !important;
  font-weight: 700 !important;
  width: 100%;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
  margin-top: 12px;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
}

body.woocommerce-order-pay .entry-content .button:hover,
body.woocommerce-order-pay .entry-content button:hover,
body.woocommerce-order-pay .entry-content .woocommerce a.button:hover,
body.woocommerce-order-pay .entry-content .form-row.place-order .button:hover,
body.woocommerce-order-pay .button.alt:hover,
body.woocommerce-order-pay .form-row.place-order .button:hover {
  background: linear-gradient(90deg, var(--tt-primary-dark) 0%, var(--tt-primary) 100%) !important;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.13);
}

/* Paragraphs + notices */
body.woocommerce-order-pay .entry-content p,
body.woocommerce-order-pay .entry-content .woocommerce-info,
body.woocommerce-order-pay p,
body.woocommerce-order-pay .woocommerce-info {
  color: var(--tt-muted);
  font-size: 0.97em;
  margin-top: 0.4em;
  margin-bottom: 0.4em;
}

/* Hide redundant H2 only within content area */
body.woocommerce-order-pay .entry-content h2 {
  display: none;
}

/* Compact spacing inside Woo container only */
body.woocommerce-order-pay .entry-content .woocommerce > *:not(:last-child),
body.woocommerce-order-pay .woocommerce > *:not(:last-child) {
  margin-bottom: 12px;
}

/* ========== Safety: ensure global header is not forced fixed ========== */
/* Remove or override any global fixed masthead you might have added elsewhere */
div#page header#masthead {
  position: static;
  width: auto;
  top: auto;
}