/*
 * Book shop: WooCommerce's notices and checkout fields in the site's type.
 * WooCommerce's own stylesheets are switched off (inc/woocommerce.php), and
 * these elements are drawn by WooCommerce (and redrawn by its scripts), so
 * they are styled here rather than with Tailwind classes. Values follow the
 * basket's "Deliver to" select: Tailwind gray-300 border, gray-900 on focus.
 */

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Notices ---------------------------------------------------------------- */
.ps-notice,
.woocommerce-NoticeGroup .woocommerce-error,
.woocommerce-NoticeGroup .woocommerce-message,
.woocommerce-NoticeGroup .woocommerce-info {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.5rem;
  font-weight: 400;
}
.ps-notice li + li {
  margin-top: 0.25rem;
}
.woocommerce-error {
  color: #b91c1c;
}
.woocommerce-message,
.woocommerce-info {
  color: #4f4a45;
}
.ps-notice a {
  text-decoration: underline;
}
.ps-notice a:hover {
  color: #1c1a17;
}
.woocommerce-NoticeGroup {
  margin-bottom: 2rem;
}
/* The "no payment methods" notice inside the payment list. */
.wc_payment_methods .ps-notice {
  margin: 0;
  color: #615c56;
  font-weight: 300;
}

/* Checkout fields --------------------------------------------------------- */
.ps-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}
@media (min-width: 640px) {
  .ps-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ps-fields .form-row-wide,
  .ps-fields .notes,
  .ps-fields .address-field.form-row-wide {
    grid-column: 1 / -1;
  }
}
.ps-checkout .form-row {
  margin: 0;
}
.ps-checkout .form-row label:not(.checkbox),
.ps-checkout .ps-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 400;
  color: #615c56;
}
.ps-checkout .form-row label .required {
  text-decoration: none;
  border: 0;
  color: #615c56;
}
.ps-checkout .form-row label .optional {
  text-transform: none;
  letter-spacing: normal;
  color: #a19b94;
}
.ps-checkout .woocommerce-input-wrapper {
  display: block;
}
.ps-checkout .input-text,
.ps-checkout .form-row select,
.ps-checkout .form-row textarea {
  display: block;
  width: 100%;
  border: 1px solid #d3cfca;
  border-radius: 0;
  background-color: #fff;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 300;
  color: #1c1a17;
  transition: border-color 150ms;
  -webkit-appearance: none;
  appearance: none;
}
.ps-checkout .form-row select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem 1rem;
}
.ps-checkout .form-row textarea {
  min-height: 7rem;
  resize: vertical;
}
.ps-checkout .input-text::placeholder,
.ps-checkout textarea::placeholder {
  color: #a19b94;
}
.ps-checkout .input-text:focus,
.ps-checkout .form-row select:focus,
.ps-checkout .form-row textarea:focus {
  outline: none;
  border-color: #1c1a17;
}
/* The fixed country (only the one chosen in the basket). */
.ps-checkout #billing_country_field strong {
  display: block;
  padding: 0.75rem 0;
  font-weight: 300;
  font-size: 1rem;
  color: #1c1a17;
}
.ps-checkout .woocommerce-invalid .input-text,
.ps-checkout .woocommerce-invalid select,
.ps-checkout .woocommerce-invalid textarea {
  border-color: #b91c1c;
}
.ps-checkout .checkout-inline-error-message {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #b91c1c;
}

/* Payment ------------------------------------------------------------------ */
.ps-checkout .wc_payment_methods {
  list-style: none;
  padding: 0;
}
.ps-checkout .wc_payment_method {
  border: 1px solid #d3cfca;
  background: #fff;
  padding: 1rem;
}
.ps-checkout .wc_payment_method > label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
  font-weight: 400;
  cursor: pointer;
}
.ps-checkout .wc_payment_method > label img {
  display: inline-block;
  max-height: 1.5rem;
  width: auto;
}
.ps-checkout .wc_payment_method input[type="radio"] {
  accent-color: #1c1a17;
}
.ps-checkout .payment_box {
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 300;
  color: #4f4a45;
}
.ps-checkout .payment_box p + p {
  margin-top: 0.5rem;
}
.ps-checkout .woocommerce-privacy-policy-text,
.ps-checkout .woocommerce-terms-and-conditions-wrapper {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 300;
  color: #615c56;
}
.ps-checkout .woocommerce-terms-and-conditions-wrapper a {
  text-decoration: underline;
}
.ps-checkout #place_order:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Express payment (Apple Pay / Google Pay) above the form ------------------ */
.ps-checkout #wc-stripe-express-checkout-element {
  margin-top: 0 !important;
}
/* "— OR —" from the Stripe plugin, drawn as a hairline rule with a small "or".
   The plugin prints it with style="display:none;" and shows it with the
   express buttons (jQuery sets display back to its default), so the flex
   layout applies only while it is shown and never forces it visible. */
/* The checkout draws its own "or pay by card" line under all the express
   buttons (.ps-express-or, below), so Stripe's divider never shows there. */
.ps-checkout #wc-stripe-express-checkout-button-separator {
  display: none !important;
}
.ps-checkout #wc-stripe-express-checkout-button-separator {
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 0 !important;
  font-size: 0;
  line-height: 1rem;
  color: #615c56;
}
.ps-checkout #wc-stripe-express-checkout-button-separator::before,
.ps-checkout #wc-stripe-express-checkout-button-separator::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: rgba(17, 24, 39, 0.1);
}
.ps-checkout #wc-stripe-express-checkout-button-separator::after {
  order: 2;
}
.ps-checkout #wc-stripe-express-checkout-button-separator > .ps-or {
  order: 1;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Stripe's card form ------------------------------------------------------- */
/* The plugin puts a hidden input in the card form to read the theme's input
   style, absolutely placed with width:100%. With no positioned parent it took
   the whole window's width from its place in the page, so the page scrolled
   sideways by up to a window's width. Its own fieldset now holds it. */
.ps-checkout .payment_box,
.ps-checkout .wc-upe-form {
  position: relative;
}
.ps-checkout fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.ps-checkout #wc-stripe-hidden-style-input {
  left: 0 !important;
  top: 0 !important;
  max-width: 100%;
}
.ps-checkout #wc-stripe-upe-errors:not(:empty) {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #b91c1c;
}
/* Whatever a third-party script adds, the shop pages never scroll sideways. */
body.woocommerce-checkout,
body.woocommerce-cart {
  overflow-x: hidden;
  overflow-x: clip;
}

/* Order summary on phones and tablets: one line with the total, which opens
   the summary (shop.js sets data-collapsible and data-open; without
   JavaScript the summary simply stays open). */
@media (max-width: 1023.98px) {
  .ps-summary[data-collapsible]:not([data-open]) .ps-summary-body {
    display: none;
  }
  .ps-summary[data-open] .ps-summary-toggle {
    border-bottom-color: transparent;
  }
  /* The toggle already names the summary; its heading row is for desktop. */
  .ps-summary[data-collapsible] .ps-summary-head {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .ps-summary[data-open] .ps-summary-body {
    animation: ps-summary-open 220ms cubic-bezier(0.16, 1, 0.3, 1);
  }
}
.ps-summary-toggle:focus-visible {
  outline: 1px solid #1c1a17;
  outline-offset: 2px;
}
.ps-summary-chevron {
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.ps-summary[data-open] .ps-summary-chevron {
  transform: rotate(180deg);
}
@keyframes ps-summary-open {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* Focus that shows on the keyboard, in the site's ink. */
.ps-checkout .input-text:focus-visible,
.ps-checkout .form-row select:focus-visible,
.ps-checkout .form-row textarea:focus-visible {
  box-shadow: 0 0 0 1px #1c1a17;
}
.ps-checkout #place_order:focus-visible,
.ps-checkout .wc_payment_method input[type="radio"]:focus-visible {
  outline: 1px solid #1c1a17;
  outline-offset: 2px;
}
/* One payment method: no radio to pick and no box round Stripe's own fields;
   its name stays for screen readers. */
.ps-checkout .wc_payment_methods > li:only-child {
  border: 0;
  padding: 0;
  background: transparent;
}
.ps-checkout .wc_payment_methods > li:only-child > input[type="radio"],
.ps-checkout .wc_payment_methods > li:only-child > label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.ps-checkout .wc_payment_methods > li:only-child > .payment_box {
  margin-top: 0;
}

/* The place-order button: a moment of weight at the end of the form. */
.ps-checkout #place_order {
  min-height: 3.5rem;
  font-size: 0.875rem;
}

/* Text selection in the site's brass. */
.ps-checkout ::selection,
[data-ps-cart] ::selection {
  background: rgba(139, 115, 85, 0.22);
  color: #1c1a17;
}
.ps-checkout .input-text,
.ps-checkout textarea {
  caret-color: #8b7355;
}

/* Checkout as two panes (form-checkout.php) -------------------------------
   Like a hosted payment page: a soft shadow along the form pane's edge, fields
   with small rounded corners and a hairline shadow, and the pay button to
   match. The site's square corners stay everywhere else. */
@media (min-width: 1024px) {
  .ps-checkout--split .ps-checkout-pane {
    background: #fff;
    box-shadow: -18px 0 36px -24px rgba(28, 26, 23, 0.22);
  }
}
.ps-checkout--split .input-text,
.ps-checkout--split .form-row select,
.ps-checkout--split .form-row textarea {
  border-radius: 6px;
  box-shadow: 0 1px 1px rgba(28, 26, 23, 0.04), 0 2px 4px rgba(28, 26, 23, 0.03);
  transition: border-color 150ms, box-shadow 150ms;
}
.ps-checkout--split .input-text:focus,
.ps-checkout--split .form-row select:focus,
.ps-checkout--split .form-row textarea:focus {
  box-shadow: 0 0 0 3px rgba(28, 26, 23, 0.08);
}
.ps-checkout--split .input-text:focus-visible,
.ps-checkout--split .form-row select:focus-visible,
.ps-checkout--split .form-row textarea:focus-visible {
  box-shadow: 0 0 0 1px #1c1a17, 0 0 0 4px rgba(28, 26, 23, 0.08);
}
.ps-checkout--split .wc_payment_method {
  border-radius: 6px;
}
.ps-checkout--split #place_order {
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.12);
}
.ps-checkout--split #place_order:active:not(:disabled) {
  transform: scale(0.99);
}
@media (prefers-reduced-motion: no-preference) {
  .ps-checkout--split #place_order {
    transition: background-color 150ms, border-color 150ms, transform 100ms;
  }
}
/* The folded summary on phones in the same corners. */
.ps-checkout--split .ps-summary-body {
  border-radius: 6px;
}
@media (min-width: 1024px) {
  .ps-checkout--split .ps-summary-body {
    border-radius: 0;
  }
}

/* Express payment row: Stripe's wallet buttons, PayPal, then "or pay by card"
   (form-checkout.php). A column with gaps, so a wallet that is not shown
   leaves no space. */
.ps-checkout .ps-express {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ps-checkout .ps-express > * {
  margin-top: 0 !important;
}
.ps-checkout .ps-express-or {
  display: none;
  align-items: center;
  gap: 1rem;
  padding-top: 1.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #615c56;
}
.ps-checkout .ps-express-or::before,
.ps-checkout .ps-express-or::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: rgba(28, 26, 23, 0.1);
}
.ps-checkout .ps-express--paypal .ps-express-or,
.ps-checkout[data-ps-express] .ps-express-or {
  display: flex;
}
/* Nothing to show (no wallet on this device, no PayPal): the row takes no
   room and "Your details" starts the pane. */
.ps-checkout:not([data-ps-express]) .ps-express:not(.ps-express--paypal) + * {
  margin-top: 0;
}

/* PayPal in PayPal's own gold, the height and corners of the wallet buttons. */
.ps-paypal-button {
  display: flex;
  width: 100%;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #ffc439;
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.12);
  cursor: pointer;
  transition: filter 150ms, transform 100ms;
}
.ps-paypal-button:hover {
  filter: brightness(0.95);
}
.ps-paypal-button:active {
  transform: scale(0.99);
}
.ps-paypal-button:focus-visible {
  outline: 2px solid #1c1a17;
  outline-offset: 2px;
}
.ps-paypal-button:disabled {
  cursor: wait;
  opacity: 0.7;
}
@media (prefers-reduced-motion: reduce) {
  .ps-paypal-button {
    transition: none;
  }
}

/* Two ways to pay below (card, PayPal): each a quiet row with its radio; the
   chosen one is outlined in ink. */
.ps-checkout--split .wc_payment_methods > li:not(:only-child) {
  border-color: #e5e2de;
  padding: 1rem 1.25rem;
  transition: border-color 150ms, box-shadow 150ms;
}
.ps-checkout--split .wc_payment_methods > li:not(:only-child):has(> input:checked) {
  border-color: #1c1a17;
  box-shadow: 0 0 0 1px #1c1a17;
}
.ps-checkout--split .wc_payment_methods > li:not(:only-child) > label {
  font-size: 1rem;
}
