/*
 * Uncle Leo's Bakery - the store's own two pages, and the choice of how to pay.
 *
 * Loaded only (inc/store.php):
 *   - on WooCommerce's "pay for this order" and "order received" pages, which are drawn inside the site's header,
 *     green heading and footer by the plain-page layout (wp.css styles their text, tables and links already);
 *   - on the order page when customers may pay online (the choice between the counter and online).
 * Never on the six pages as they stand with payment at the counter: those receive styles.css and nothing else.
 *
 * Design tokens only (the custom properties of styles.css): no colour, size or font of its own.
 */

/* ---------- WooCommerce's own colours, turned into the site's ---------- */
.woocommerce-order-pay, .woocommerce-order-received {
  --woocommerce: var(--green-900);
  --wc-primary: var(--green-900);
  --wc-primary-text: var(--ivory-50);
  --wc-secondary: var(--ivory-100);
  --wc-secondary-text: var(--ink-900);
  --wc-highlight: var(--gold-800);
  --wc-highligh-text: var(--ivory-50);
  --wc-content-bg: var(--ivory-50);
  --wc-subtext: var(--ink-500);
  --wc-green: var(--stamp-green);
  --wc-red: var(--stamp-bordeaux);
  --wc-orange: var(--gold-700);
  --wc-blue: var(--green-800);
  --wc-form-border-color: var(--ink-500);
  --wc-form-border-radius: var(--radius);
  --wc-form-color-background: var(--ivory-50);
  --wc-form-color-text: var(--ink-900);
}
.entry-content .woocommerce { color: var(--ink-700); font: 400 var(--text-base)/1.7 var(--font-body); }
.entry-content .woocommerce a:not([class]) { color: var(--green-900); border-bottom: 1px solid var(--gold-500); }

/* ---------- Messages ---------- */
.entry-content .woocommerce :is(.woocommerce-error, .woocommerce-info, .woocommerce-message, .wc-block-components-notice-banner) {
  margin: 0 0 var(--s-5); padding: var(--s-4) var(--s-5); list-style: none;
  background: var(--ivory-100); border: 1px solid var(--line-gold); border-left: 4px solid var(--stamp-green); border-radius: var(--radius);
  color: var(--ink-900); font-size: var(--text-base);
}
.entry-content .woocommerce :is(.woocommerce-error, .wc-block-components-notice-banner.is-error) { border-left-color: var(--stamp-bordeaux); }
.entry-content .woocommerce :is(.woocommerce-error, .woocommerce-info, .woocommerce-message)::before { content: none; }
.entry-content .woocommerce .woocommerce-error li { margin: 0; list-style: none; }

/* ---------- The order: what was ordered, and the totals ---------- */
.entry-content .woocommerce table.shop_table { width: 100%; margin: 0 0 var(--s-6); border: 0; border-top: 1px solid var(--line-gold); border-radius: 0; border-collapse: collapse; }
.entry-content .woocommerce table.shop_table :is(th, td) { padding: var(--s-3) var(--s-3) var(--s-3) 0; border: 0; border-bottom: 1px solid var(--line-gold-soft); text-align: left; vertical-align: top; line-height: 1.5; }
.entry-content .woocommerce table.shop_table :is(th, td):last-child { padding-right: 0; text-align: right; }
.entry-content .woocommerce table.shop_table th { font-weight: 500; color: var(--green-900); }
.entry-content .woocommerce table.shop_table tfoot :is(th, td) { font-weight: 400; color: var(--ink-700); }
.entry-content .woocommerce table.shop_table tfoot tr:last-child :is(th, td) { font: 500 var(--text-lg)/1.3 var(--font-display); color: var(--gold-800); }
.entry-content .woocommerce .wc-item-meta { margin: var(--s-1) 0 0; padding: 0; list-style: none; font-size: var(--text-sm); color: var(--ink-700); }
.entry-content .woocommerce .wc-item-meta li { margin: 0; }
.entry-content .woocommerce .wc-item-meta :is(p, strong) { display: inline; margin: 0; font-weight: 500; }
.entry-content .woocommerce .product-quantity { font-weight: 400; color: var(--ink-500); }

/* "Order received": number, date, total, how it is paid */
.entry-content .woocommerce ul.order_details { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--s-4) var(--s-6); margin: var(--s-5) 0 var(--s-7); padding: var(--s-5) 0; list-style: none; border-block: 1px solid var(--line-gold); }
.entry-content .woocommerce ul.order_details li { margin: 0; padding: 0; border: 0; float: none; font: 500 var(--text-xs)/1.4 var(--font-body); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--gold-700); }
.entry-content .woocommerce ul.order_details li strong { display: block; margin-top: var(--s-2); font: 400 var(--text-md)/1.3 var(--font-display); letter-spacing: 0; text-transform: none; color: var(--green-900); }
.entry-content .woocommerce :is(.woocommerce-order-details__title, .woocommerce-column__title, h2) { margin: var(--s-7) 0 var(--s-4); font: 400 var(--text-xl)/1.15 var(--font-display); color: var(--green-900); }
.entry-content .woocommerce .woocommerce-notice--success { font: italic 400 var(--text-lg)/1.35 var(--font-display); color: var(--green-800); }
.entry-content .woocommerce address { padding: 0; border: 0; font-style: normal; line-height: 1.7; }
.entry-content .woocommerce .woocommerce-bacs-bank-details ul { padding: 0; list-style: none; }

/* ---------- Paying: the methods, and the button ---------- */
.entry-content .woocommerce #payment { margin-top: var(--s-6); padding: var(--s-5); background: var(--ivory-100); border: 1px solid var(--line-gold); border-radius: var(--radius); }
.entry-content .woocommerce #payment ul.payment_methods { margin: 0 0 var(--s-5); padding: 0 0 var(--s-5); list-style: none; border-bottom: 1px solid var(--line-gold); }
.entry-content .woocommerce #payment ul.payment_methods li { margin: 0; padding: var(--s-2) 0; list-style: none; line-height: 1.5; }
.entry-content .woocommerce #payment ul.payment_methods li + li { border-top: 1px solid var(--line-gold-soft); }
.entry-content .woocommerce #payment ul.payment_methods label { font-weight: 500; color: var(--ink-900); cursor: pointer; }
.entry-content .woocommerce #payment ul.payment_methods input[type="radio"] { width: 1.15rem; height: 1.15rem; margin: 0 var(--s-3) 0 0; vertical-align: -0.15em; accent-color: var(--green-900); }
.entry-content .woocommerce #payment ul.payment_methods input:focus-visible { outline: 3px solid var(--green-900); outline-offset: 2px; }
.entry-content .woocommerce #payment .payment_box { margin: var(--s-3) 0 0; padding: var(--s-4); background: var(--ivory-50); border: 1px solid var(--line-gold-soft); border-radius: var(--radius); color: var(--ink-700); font-size: var(--text-sm); }
.entry-content .woocommerce #payment .payment_box::before { content: none; }
.entry-content .woocommerce #payment .payment_box p { margin: 0; }
.entry-content .woocommerce .woocommerce-privacy-policy-text, .entry-content .woocommerce .woocommerce-terms-and-conditions-wrapper { font-size: var(--text-sm); color: var(--ink-500); }
.entry-content .woocommerce :is(#place_order, .button, button[type="submit"]) {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-h); margin-top: var(--s-4); padding: 0 var(--s-6); float: none;
  background: var(--green-900); color: var(--ivory-50); border: 1px solid var(--green-900); border-radius: var(--radius);
  font: 500 var(--text-xs)/1.2 var(--font-body); letter-spacing: var(--track-caps); text-transform: uppercase; cursor: pointer; transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.entry-content .woocommerce :is(#place_order, .button, button[type="submit"]):hover { background: var(--green-700); border-color: var(--green-700); color: var(--ivory-50); }
.entry-content .woocommerce :is(#place_order, .button, button[type="submit"]):focus-visible { outline: 3px solid var(--green-900); outline-offset: 3px; }
.entry-content .woocommerce :is(input[type="text"], input[type="email"], input[type="tel"], input[type="password"], textarea, select) {
  min-height: var(--control-h); padding: var(--s-3) var(--s-4); background: var(--ivory-50); color: var(--ink-900); border: 1px solid var(--ink-500); border-radius: var(--radius); font: 400 var(--text-base)/1.4 var(--font-body);
}
.entry-content .woocommerce :is(input, textarea, select):focus { outline: 3px solid var(--green-900); outline-offset: 2px; border-color: var(--green-900); }

@media (max-width: 600px) {
  .entry-content .woocommerce :is(#place_order, .button) { width: 100%; }
}

/* ---------- The order page: at the counter, or online (the gift card form's tiles, on paper instead of green) ---------- */
.order-layout .pay-choice { margin: var(--s-6) 0 0; padding: 0; border: 0; min-width: 0; }
.order-layout .pay-choice legend { font: 500 var(--text-base)/1.4 var(--font-body); color: var(--ink-900); }
.order-layout .pay-choice .choice-tiles { margin-top: var(--s-3); grid-template-columns: minmax(0, 1fr); }
.order-layout .pay-choice .choice-tile > span { color: var(--ink-900); background-color: var(--ivory-50); border-color: var(--ink-500); }
.order-layout .pay-choice .choice-tile:hover > span { border-color: var(--green-900); }
.order-layout .pay-choice .choice-tile input:checked + span { color: var(--ivory-50); background-color: var(--green-900); border-color: var(--green-900); }
.order-layout .pay-choice .choice-tile input:focus-visible + span { outline: 3px solid var(--green-900); outline-offset: 3px; }
.order-layout .pay-choice .choice-tile input:disabled + span { color: var(--ink-500); background-color: var(--ivory-100); border-style: dashed; cursor: not-allowed; }
.order-layout .pay-choice .field-hint { margin-top: var(--s-3); font-size: var(--text-sm); color: var(--ink-500); }
