/* ==========================================================================
   Kaluchie — WooCommerce
   PDP, cart page, checkout, my-account. Woo's own three stylesheets are
   dequeued in inc/enqueue.php; everything Woo renders is styled here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   PDP
   -------------------------------------------------------------------------- */

.k-pdp {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
}

.k-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--color-accent-400);
  margin-bottom: 24px;
}

.k-breadcrumb a:hover { color: var(--color-bg); }
.k-breadcrumb__current { color: var(--color-bg); }

.k-gallery {
  display: flex;
  gap: 16px;
}

.k-gallery__strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 76px;
  flex: none;
  list-style: none;
  margin: 0;
  padding: 0;
}

.k-gallery__thumb {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--color-accent-700);
  background: var(--color-accent-800);
  cursor: pointer;
  width: 100%;
}

.k-gallery__thumb[aria-current="true"] { border-color: var(--color-accent-400); }

.k-gallery__main {
  flex: 1;
  background: var(--color-accent-800);
  overflow: hidden;
}

.k-gallery__frame {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  cursor: zoom-in;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.k-gallery__frame[data-zoom="true"] { cursor: zoom-out; }

.k-gallery__frame img {
  transition: transform var(--zoom-duration) ease;
}

.k-gallery__frame[data-zoom="true"] img { transform: scale(1.6); }

/* --- Summary column ------------------------------------------------------- */

.k-pdp__collection {
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-accent-300);
  margin-bottom: 12px;
}

.k-pdp__title {
  font-size: var(--type-pdp-title);
  line-height: 0.94;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}

.k-pdp__price {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 18px;
}

.k-pdp__price del { color: var(--color-accent-400); margin-right: 10px; }
.k-pdp__price ins { text-decoration: none; }

.k-pdp__blurb {
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-accent-200);
  margin: 0 0 26px;
  max-width: 48ch;
}

.k-pdp__block {
  border-top: 1px solid var(--color-accent-700);
  padding-top: 20px;
  margin-bottom: 20px;
}

.k-pdp__block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.k-pdp__block-title {
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}

.k-pdp__block-aside {
  font-size: 14px;
  color: var(--color-accent-400);
}

.k-sizeguide-link {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-300);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-accent-400);
  padding: 0 0 2px;
  cursor: pointer;
}

.k-sizeguide-link:hover { color: var(--color-bg); }

.k-pdp__ship {
  font-size: 13px;
  color: var(--color-accent-400);
  text-align: center;
  margin: 10px 0 26px;
}

/* Woo prints its own variation form; the theme drives colour and size from
   the swatch/chip UI and keeps Woo's selects present but hidden for the
   no-JS path. */
.k-variations__native {
  margin-bottom: 20px;
}

.js .k-variations__native { display: none; }

.woocommerce-variation-price,
.woocommerce-variation-availability { display: none; }

/* --------------------------------------------------------------------------
   Cart page (the drawer is the primary surface; this is the fallback route)
   -------------------------------------------------------------------------- */

/* Same reasoning as the checkout: single column, so a side panel can never
   squeeze the table next to it. */
.k-cart-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.woocommerce-cart-form__contents {
  width: 100%;
  border-collapse: collapse;
}

.woocommerce-cart-form__contents th {
  text-align: left;
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--color-accent-300);
  padding: 0 0 12px;
  border-bottom: 2px solid var(--color-accent-500);
}

.woocommerce-cart-form__contents td {
  padding: 18px 0;
  border-bottom: 1px solid var(--color-accent-700);
  vertical-align: top;
}

.k-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-accent-600);
}

.k-qty button {
  width: 34px;
  height: 34px;
  background: transparent;
  border: 0;
  color: var(--color-bg);
  cursor: pointer;
  font-size: 16px;
}

.k-qty button:hover { background: var(--color-accent-800); }

.k-qty input {
  width: 44px;
  height: 34px;
  text-align: center;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--color-accent-700);
  border-right: 1px solid var(--color-accent-700);
  color: var(--color-bg);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

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

/* --------------------------------------------------------------------------
   Checkout — express first
   -------------------------------------------------------------------------- */

/* The design specifies a 1100px checkout column. That was drawn against a
   simplified form; WooCommerce actually renders name, company, country,
   address 1, address 2, city, state, ZIP, phone and email. At 1100px the form
   side lands around 590px, which splits into two ~288px columns — narrow
   enough that the uppercase tracked labels wrap and the inputs read as slots.
   Filling in an address is the single most effortful thing a customer does on
   this site, so the width goes to the form. */
/* Single column by default. The two-column layout only switches on when there
   is genuinely enough width for it (see the min-width rule below).
   Previously this went two-column at anything above 1024px, which left a band
   between roughly 1024 and 1180 where the form track was too narrow for the
   fields inside it — they overflowed their track and ran under the order
   summary. A layout that only splits when it fits cannot do that. */
.k-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* Cap the form column. Without this, the single-column layout lets the form
   run the full content width and auto-fit spreads the fields four across,
   which reads as a spreadsheet rather than something you fill in. A form is
   easier to complete in a single readable column of sensible width. The cap
   never bites in the two-column layout, where the track is already narrower. */
.k-checkout > *:first-child { max-width: 820px; }

/* There is deliberately NO two-column variant.
 *
 * The side-by-side layout was cramped on the owner's display and I could not
 * observe the width it was actually rendering at, so tuning a breakpoint
 * against it was guesswork. Single column is correct at every width by
 * construction: the form cannot be squeezed by a summary sitting next to it,
 * because nothing sits next to it.
 *
 * This is also the better pattern on merit. A single column keeps the eye on
 * one task at a time instead of bouncing between the form and the totals, and
 * the summary reading directly above the pay button is where a customer wants
 * it at the moment they commit. */

/* The summary reads better above the form on a single-column checkout: you
   confirm what you are buying, then fill in where it goes. */
.k-checkout > .k-summary { order: -1; }

.k-summary {
  position: static;
  max-width: 820px;
}

.k-express {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.k-express__btn {
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-accent-600);
  background: transparent;
  color: var(--color-bg);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.k-express__btn:hover { border-color: var(--color-accent-400); }

.k-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0 32px;
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--color-accent-300);
}

.k-divider::before,
.k-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-accent-700);
}

.k-step {
  border-top: 1px solid var(--color-accent-700);
  padding-top: 30px;
  margin-bottom: 44px;
}

.k-step:last-child { margin-bottom: 0; }

.k-step__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 26px;
}

.k-step__num {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--color-accent-500);
  font-variant-numeric: tabular-nums;
}

.k-step__title {
  font-size: 28px;
  margin: 0;
}

/* Woo form rows.
   auto-fit rather than a fixed two columns: a field never drops below 250px,
   so pairs sit side by side when there is room and stack when there is not,
   instead of being crushed into two narrow columns regardless. */
.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper,
.woocommerce-additional-fields__field-wrapper {
  display: grid;
  /* min(250px, 100%) rather than a bare 250px: a plain minmax floor refuses to
     shrink below 250px, so in a container narrower than that the column
     overflows its track instead of wrapping. This is the standard guard. */
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 22px 20px;
}

.form-row { margin: 0; min-width: 0; }
.form-row-wide { grid-column: 1 / -1; }

/* Address lines, order notes and the account fields want the full width. */
#billing_address_1_field,
#billing_address_2_field,
#shipping_address_1_field,
#shipping_address_2_field,
#billing_email_field,
#order_comments_field,
.woocommerce-account-fields,
.woocommerce-additional-fields { grid-column: 1 / -1; }

.form-row label {
  display: block;
  font-family: var(--font-heading);
  font-size: 12px;
  /* 0.20em tracking on a 12px label is enough to wrap "First name *" in a
     narrow column. Tighter here than elsewhere, deliberately. */
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-300);
  margin-bottom: 9px;
  /* Labels wrap rather than truncate. An earlier version clipped them with
     an ellipsis to stop "First name *" breaking onto two lines in a narrow
     column — but that turned "Company name (optional)" into "Company name
     (option…" and hid the word that tells you it can be skipped. Losing
     information is worse than losing a line. The tighter tracking above plus
     the 300px column floor make wrapping rare anyway. */
  line-height: 1.35;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="password"],
.form-row textarea,
.form-row select,
.select2-container .select2-selection {
  width: 100%;
  /* 16px minimum on the font size: anything smaller makes iOS Safari zoom the
     viewport when the field is focused, which on a checkout reads as the page
     jumping around while you type your address. */
  font-size: 16px;
  padding: 16px 18px;
  min-height: 54px;
  background: transparent;
  border: 1px solid var(--color-accent-600);
  border-radius: var(--radius-md);
  color: var(--color-bg);
  height: auto;
  line-height: 1.3;
}

.form-row textarea {
  min-height: 120px;
  line-height: 1.55;
  resize: vertical;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--color-accent-400); }

/* Shipping options. */
.k-shipping-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--color-accent-600);
  margin-bottom: 10px;
  cursor: pointer;
}

.k-shipping-row--active { background: var(--color-accent-800); border-color: var(--color-accent-400); }

/* Order summary. Not sticky — there is no second column for it to stick
   alongside, and a sticky panel in a single-column flow just fights the
   scroll. */
.k-summary {
  border: 1px solid var(--color-accent-600);
  padding: 30px 28px;
}

/* The panel had a lot of frame around not much type — the totals a customer
   is actually checking read smaller than the box containing them. */
.k-summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  font-size: 17px;
}

.k-summary .k-kicker {
  font-size: 13px;
  margin-bottom: 18px;
}

.k-summary .k-line__title {
  font-size: 19px !important;
  line-height: 1.15;
}

.k-summary .k-line__meta { font-size: 14px; }
.k-summary .k-line__price { font-size: 17px; }

.k-summary__row--total {
  border-top: 1px solid var(--color-accent-700);
  margin-top: 12px;
  padding-top: 20px;
  font-family: var(--font-heading);
  font-size: 26px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.k-summary__row span:last-child { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   My account
   -------------------------------------------------------------------------- */

.woocommerce-MyAccount-navigation ul {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  border-bottom: 1px solid var(--color-accent-700);
}

.woocommerce-MyAccount-navigation li a {
  display: inline-block;
  padding: 16px 24px;
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-MyAccount-navigation li a:hover {
  border-bottom-color: var(--color-accent-400);
  color: var(--color-bg);
}

.woocommerce-orders-table,
.woocommerce-table--order-details {
  width: 100%;
  border-collapse: collapse;
}

.woocommerce-orders-table th,
.woocommerce-table--order-details th {
  text-align: left;
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--color-accent-300);
  padding: 0 0 12px;
  border-bottom: 2px solid var(--color-accent-500);
}

.woocommerce-orders-table td,
.woocommerce-table--order-details td {
  padding: 18px 0;
  border-bottom: 1px solid var(--color-accent-700);
}

/* --------------------------------------------------------------------------
   Woo messages
   -------------------------------------------------------------------------- */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  list-style: none;
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid var(--color-accent-600);
  border-left-width: 2px;
  border-left-color: var(--color-accent-400);
  font-size: 15px;
  background: var(--color-accent-800);
}

.woocommerce-error { border-left-color: #d98a8a; }

.woocommerce-message .button,
.woocommerce-info .button { float: right; }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.woocommerce-pagination ul {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  justify-content: center;
}

.woocommerce-pagination a,
.woocommerce-pagination span {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--color-accent-700);
  font-variant-numeric: tabular-nums;
}

.woocommerce-pagination .current {
  background: var(--color-accent-700);
  border-color: var(--color-accent-400);
}

.woocommerce-pagination a:hover { border-color: var(--color-accent-400); }
