/* ==========================================================================
   Astro Cheveux — the WooCommerce bridge

   The other stylesheets in this folder are the design, lifted verbatim from the
   static build. This file is the only place that knows WooCommerce exists: it
   maps Woo's generated markup onto those design classes.

   Keeping the mapping in one file means the design sheets stay diffable against
   ../../../site/assets/css/, and a Woo update that changes a class name is a
   one-file fix rather than a hunt.

   Loaded last, so it always wins on equal specificity.
   ========================================================================== */


/* --------------------------------------------------------------------------
   Variation pickers

   The native <select> stays in the DOM and stays functional — Woo's script
   owns it. It is taken out of the visual and tab order, and the swatch/pill
   buttons beside it become the real control.

   With JavaScript off, nothing syncs the buttons, so the selects come back.
   -------------------------------------------------------------------------- */

.ac-variation-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
}

.no-js .ac-variation-select {
  position: static;
  width: 100%;
  height: 48px;
  margin: 12px 0 0;
  clip-path: none;
  border: 1px solid var(--cloud);
  padding: 0 12px;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--white);
}

.no-js .swatches,
.no-js .pills {
  display: none;
}

/* An option that cannot be combined with the current selection. Dimmed and
   struck rather than removed — seeing that a shade exists but is unavailable in
   this length is more useful than watching it vanish. */
.swatch.is-unavailable,
.pill.is-unavailable {
  opacity: 0.32;
  cursor: not-allowed;
}

.pill.is-unavailable {
  text-decoration: line-through;
}

.swatch.is-unavailable::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, transparent 46%, var(--ink) 46%, var(--ink) 54%, transparent 54%);
  opacity: 0.5;
}

.swatch { position: relative; }

.pdp__reset { margin-top: 18px; }

.reset_variations {
  font-size: 13px;
  color: var(--muted);
}

/* Woo prints the resolved variation price inside .single_variation; the design
   shows it high in the buy column instead, and product.js lifts it there. */
.woocommerce-variation-price,
.woocommerce-variation-availability .stock:empty {
  display: none;
}

.woocommerce-variation-description {
  font-size: 14px;
  line-height: 1.6;
  color: var(--charcoal);
  margin-top: 14px;
}

.woocommerce-variation-availability .stock {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

.woocommerce-variation-availability .out-of-stock {
  color: var(--ink);
}

/* Each piece is made for one person, so the PDP stepper is hidden by default.
   It returns for anything genuinely sold in multiples — see
   variation-add-to-cart-button.php. */
.quantity--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.pdp__buy { margin-top: 20px; }

.pdp__buy--with-qty {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.pdp__buy--with-qty .quantity {
  display: flex;
  border: 1px solid var(--ink);
  width: 96px;
  flex-shrink: 0;
}

.pdp__buy--with-qty .quantity .qty {
  width: 100%;
  border: 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 14px;
  background: transparent;
}

.single_add_to_cart_button[disabled],
.single_add_to_cart_button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Product grid
   -------------------------------------------------------------------------- */

.product-grid.products {
  list-style: none;
  padding-left: 0;
  padding-right: 0;
}

/* The loop stamps --ac-grid-cols with the real product count (capped at the
   design's three). Columns keep three-up card width and the row centers, so
   a two-line store reads as composed rather than missing a product. */
@media (min-width: 1024px) {
  .product-grid.products {
    grid-template-columns: repeat(var(--ac-grid-cols, 3), minmax(0, calc((var(--content-max) - 48px) / 3)));
    justify-content: center;
  }
}

.product-grid.is-empty::after {
  content: 'Nothing matches that filter.';
  display: block;
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 15px;
}

.product-card__name a {
  color: inherit;
  text-decoration: none;
}

/* Woo's sort dropdown, restyled as the design's quiet "Sort · Featured" text
   button. The design keeps sorting off the mobile bar — chips own that row. */
.woocommerce-ordering {
  display: none;
}

@media (min-width: 1024px) {
  .woocommerce-ordering {
    display: flex;
    position: relative;
    align-items: center;
    gap: 6px;
  }
}

.woocommerce-ordering::before {
  content: 'Sort ·';
}

.woocommerce-ordering::before,
.woocommerce-ordering select {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--charcoal);
}

.woocommerce-ordering select {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0 18px 0 0;
  cursor: pointer;
}

.woocommerce-ordering::after {
  content: '';
  position: absolute;
  right: 4px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* Pagination */
.woocommerce-pagination ul,
.pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.woocommerce-pagination a,
.woocommerce-pagination span,
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--cloud);
  font-size: 14px;
  text-decoration: none;
  color: var(--ink);
}

.woocommerce-pagination .current,
.pagination .page-numbers.current {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

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

.woocommerce-notices-wrapper:empty { display: none; }

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  list-style: none;
  margin: 0 auto 24px;
  padding: 14px 18px;
  max-width: var(--content-max);
  border-left: 2px solid var(--ink);
  background: var(--mist);
  font-size: 14px;
  line-height: 1.5;
}

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

.woocommerce-message .button,
.woocommerce-error .button {
  float: right;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Cart drawer state
   -------------------------------------------------------------------------- */

.cart-drawer.is-busy {
  pointer-events: none;
}

.cart-drawer.is-busy .cart-drawer__body {
  opacity: 0.45;
  transition: opacity 0.2s ease-out;
}

/* The drawer opens on the add-to-cart click itself and the fragments land a
   beat later; a quiet ring says the beat is coming. */
.cart-drawer.is-busy::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid var(--cloud);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: ac-spin 0.7s linear infinite;
}

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

.line-item__name a {
  color: inherit;
  text-decoration: none;
}

.cart-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.cart-coupon {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}

.cart-coupon .field { flex: 1; }

/* --------------------------------------------------------------------------
   Checkout

   Woo renders each field as <p class="form-row"><label><span class="woocommerce-input-wrapper"><input class="input-text">.
   The design's inputs are `.field`, labelled by placeholder. The real <label>
   stays in the DOM for assistive tech and is hidden visually.
   -------------------------------------------------------------------------- */

.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.form-row {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
}

.form-row-first,
.form-row-last {
  grid-column: span 2;
}

.ac-col-city { grid-column: span 2; }
.ac-col-state { grid-column: span 1; }
.ac-col-zip { grid-column: span 1; }

.form-row > label:not(.checkbox):not(.woocommerce-form__label-for-checkbox) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.form-row .input-text,
.form-row select,
.form-row textarea,
.select2-container .select2-selection--single {
  width: 100%;
  height: 52px;
  border: 1px solid var(--cloud);
  border-radius: 0;
  padding: 0 14px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
}

.form-row textarea {
  height: auto;
  min-height: 96px;
  padding: 14px;
  line-height: 1.6;
}

.form-row .input-text:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--ink);
  outline: none;
}

.form-row.woocommerce-invalid .input-text,
.form-row.woocommerce-invalid select {
  border-color: #8c2f2f;
}

.form-row .required {
  color: var(--muted);
  text-decoration: none;
}

/* Select2, which Woo uses for country and state. */
.select2-container .select2-selection--single {
  display: flex;
  align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: normal;
  padding: 0;
  color: var(--ink);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 50px;
}

.select2-dropdown {
  border-color: var(--cloud);
  border-radius: 0;
}

/* The design's checkbox, driven by a real input rather than aria-checked.
   Scoped with :has(+ .checkbox__box) so ONLY inputs that come with the
   design's replacement box are visually hidden. WooCommerce's own checkbox
   labels (the required terms-and-conditions box, most importantly) also carry
   the `checkbox` class but have no box element — hiding their input would
   leave a required control invisible and block checkout. Those stay native,
   tinted to the palette below. */
.checkbox input[type="checkbox"]:has(+ .checkbox__box) {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.checkbox input[type="checkbox"]:checked + .checkbox__box {
  background: var(--ink);
}

.checkbox input[type="checkbox"]:checked + .checkbox__box::after {
  content: '✓';
}

.checkbox input[type="checkbox"]:focus-visible + .checkbox__box {
  outline: 2px solid var(--citrine);
  outline-offset: 2px;
}

/* WooCommerce-rendered checkboxes (terms, etc.) — native, on-palette. */
.woocommerce-form__label-for-checkbox input[type="checkbox"],
.woocommerce-terms-and-conditions-wrapper input[type="checkbox"] {
  accent-color: var(--ink);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.co-login {
  font-size: 13px;
  color: var(--charcoal);
  margin-top: 10px;
}

.co-login a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Delivery step */
.delivery-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.delivery-option { cursor: pointer; }

.delivery-option:has(input:checked) {
  border-color: var(--ink);
}

.delivery-option input[type="radio"]:checked ~ .delivery-option__dot { opacity: 1; }

.delivery-option--single input[type="radio"] { display: none; }

.delivery-option--single .delivery-option__dot { opacity: 1; }

.delivery-option--pending {
  color: var(--muted);
}

/* Payment methods, restyled into the design's .pay-row / .pay-panel. */
.wc_payment_methods {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.wc_payment_method {
  margin-top: 10px;
}

.wc_payment_method > input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.wc_payment_method > label {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--cloud);
  background: var(--white);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.wc_payment_method > label::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wc_payment_method > input[type="radio"]:checked + label {
  border-color: var(--ink);
}

.wc_payment_method > input[type="radio"]:checked + label::before {
  box-shadow: inset 0 0 0 3px var(--white), inset 0 0 0 12px var(--ink);
}

.wc_payment_method > input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--citrine);
  outline-offset: 2px;
}

.wc_payment_method > label img {
  max-height: 22px;
  width: auto;
  margin-left: auto;
}

.payment_box {
  padding: 16px;
  border: 1px solid var(--cloud);
  border-top: 0;
  background: var(--mist);
  font-size: 13px;
  line-height: 1.6;
  color: var(--charcoal);
}

.payment_box p:last-child { margin-bottom: 0; }

.place-order {
  margin-top: 24px;
}

.co-place__total { font-weight: 500; }

.woocommerce-terms-and-conditions-wrapper {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 16px;
}

.woocommerce-terms-and-conditions-wrapper a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Order review totals inside the summary rail. */
.co-totals .woocommerce-shipping-methods {
  list-style: none;
  margin: 0;
  padding: 0;
}

.co-totals .shipping__list li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.co-summary__list .line-item__actions { display: none; }

/* The summary rail reuses the shared line-item renderer; compact it to the
   design's .co-item proportions — the drawer's media size is too big here. */
.co-summary__list .line-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.co-summary__list .line-item + .line-item { margin-top: 16px; }

.co-summary__list .line-item__media img {
  width: 64px;
  height: 82px;
  object-fit: cover;
  background: var(--champagne);
  display: block;
}

.co-summary__list .line-item__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  color: var(--ink);
}

.co-summary__list .line-item__variant { font-size: 12px; margin-top: 2px; }
.co-summary__list .line-item__meta { font-size: 11px; opacity: 0.7; margin-top: 3px; }
.co-summary__list .line-item__price { font-size: 13px; font-weight: 500; white-space: nowrap; }

@media (min-width: 1024px) {
  .co-summary__list .line-item__media img { width: 72px; height: 92px; }
  .co-summary__list .line-item__name { font-size: 19px; }
}

/* Blocked state while Woo recalculates. */
.blockUI.blockOverlay {
  background: var(--white) !important;
  opacity: 0.6 !important;
}

/* --------------------------------------------------------------------------
   Simple products — the Swatch Kit's own PDP

   Variable products render the designed button via the theme's template
   override; simple products go through Woo core's add-to-cart/simple.php,
   so the design is applied to core's classes here.
   -------------------------------------------------------------------------- */

form.cart .single_add_to_cart_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease-out;
}

form.cart .single_add_to_cart_button:hover {
  background: var(--midnight);
}

form.cart:not(.variations_form) {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

form.cart:not(.variations_form) .quantity {
  display: flex;
  border: 1px solid var(--ink);
  width: 96px;
  flex-shrink: 0;
}

form.cart:not(.variations_form) .quantity .qty {
  width: 100%;
  border: 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 14px;
  background: transparent;
}

/* The cart page's editable quantity — a real input where the drawer has a
   span, so Woo's Update-cart submit and the no-JS path keep working. */
.qty .qty__input {
  width: 34px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: center;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  -moz-appearance: textfield;
  appearance: textfield;
}

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

/* --------------------------------------------------------------------------
   Breadcrumb — a safety net where a page's own stylesheet doesn't cover it
   -------------------------------------------------------------------------- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Wordmark fallback — the header before a logo is uploaded
   -------------------------------------------------------------------------- */

.site-header__wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   My Account — functional inside the design's rhythm
   -------------------------------------------------------------------------- */

.woocommerce-MyAccount-navigation ul {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  border-bottom: 1px solid var(--cloud);
  padding-bottom: 16px;
}

.woocommerce-MyAccount-navigation a {
  font-size: 14px;
  text-decoration: none;
  color: var(--charcoal);
}

.woocommerce-MyAccount-navigation .is-active a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.woocommerce-MyAccount-content .woocommerce-Button,
.woocommerce-MyAccount-content .button,
.woocommerce-form-login .button,
.woocommerce-form-register .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border: 0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.woocommerce-MyAccount-content table.shop_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.woocommerce-MyAccount-content table.shop_table th,
.woocommerce-MyAccount-content table.shop_table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--cloud);
  text-align: left;
}

/* Order received — core's .woocommerce-order details */
.woocommerce-order ul.woocommerce-order-overview {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  font-size: 14px;
}

.woocommerce-order ul.woocommerce-order-overview li strong {
  display: block;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Reviews
   -------------------------------------------------------------------------- */

.reviews-empty {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin-top: 32px;
}

.reviews-write {
  max-width: 640px;
  margin: 48px auto 0;
}

.reviews-write .comment-reply-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 23px;
  line-height: 1.25;
  color: var(--ink);
}

.reviews-write .comment-form {
  margin-top: 20px;
}

.reviews-write .comment-form p {
  margin: 0 0 12px;
}

.reviews-write .field,
.reviews-write input[type="text"],
.reviews-write input[type="email"],
.reviews-write textarea {
  width: 100%;
  border: 1px solid var(--cloud);
  border-radius: 0;
  padding: 14px;
  font-family: var(--sans);
  font-size: 15px;
}

.reviews-write .stars a {
  color: var(--citrine);
  text-decoration: none;
}

.reviews-write .comment-form-rating label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}


/* --------------------------------------------------------------------------
   Elementor coexistence

   Elementor wraps page content in .elementor; keep it from inheriting the
   narrow measure the design applies to editorial pages.
   -------------------------------------------------------------------------- */

.page-body:has(.elementor) {
  padding: 0;
}

.page-body .elementor {
  max-width: none;
}

/* --------------------------------------------------------------------------
   WordPress admin bar

   Logged-in admins get WP's toolbar; the design's sticky headers slide under
   it without these offsets. Below 601px the bar is absolute and scrolls away
   with the page, so the headers keep top: 0 there.
   -------------------------------------------------------------------------- */

@media (min-width: 601px) {
  body.admin-bar .site-header,
  body.admin-bar .co-header { top: 46px; }
}

@media (min-width: 783px) {
  body.admin-bar .site-header,
  body.admin-bar .co-header { top: 32px; }
}


/* --------------------------------------------------------------------------
   PDP accordion content

   The panels carry Woo's tab output — description copy and the
   additional-information table — mapped onto the design's quiet typography.
   -------------------------------------------------------------------------- */

.faq__a > :first-child { margin-top: 0; }
.faq__a > :last-child { margin-bottom: 0; }
.faq__a p { margin: 0; }
.faq__a p + p { margin-top: 10px; }

.faq__a .woocommerce-product-attributes { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.faq__a .woocommerce-product-attributes tr + tr th,
.faq__a .woocommerce-product-attributes tr + tr td { border-top: 1px solid var(--cloud); }
.faq__a .woocommerce-product-attributes th {
  text-align: left;
  font-weight: 500;
  color: var(--ink);
  padding: 9px 16px 9px 0;
  vertical-align: top;
  white-space: nowrap;
}
.faq__a .woocommerce-product-attributes td { color: var(--charcoal); padding: 9px 0; }

