/* Maintheme WooCommerce presentation. Theme-owned product card classes are added in PHP. */

.woocommerce .woocommerce-breadcrumb { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }

.woocommerce .onsale,
.wc-block-components-product-sale-badge {
  align-items: center;
  background: var(--wp--preset--color--highlight);
  border: 0;
  border-radius: var(--wp--custom--radius--pill);
  color: var(--wp--preset--color--contrast);
  display: inline-flex;
  font-size: var(--wp--preset--font-size--x-small);
  font-weight: 750;
  justify-content: center;
  line-height: 1.2;
  min-height: 1.75rem;
  min-width: 3.25rem;
  padding: .25rem .625rem;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price,
.wc-block-components-product-price { color: var(--wp--preset--color--accent-strong); font-weight: 750; }
.woocommerce div.product p.price del,
.woocommerce div.product span.price del,
.wc-block-components-product-price del { color: var(--wp--preset--color--muted); font-size: .85em; margin-inline-end: .375rem; }

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner { border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--custom--radius--small); box-shadow: none; padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40); }
.woocommerce-message,
.wc-block-components-notice-banner.is-success { background: var(--wp--preset--color--base); background: color-mix(in srgb, var(--wp--preset--color--success) 10%, var(--wp--preset--color--base)); border-inline-start: 4px solid var(--wp--preset--color--success); }
.woocommerce-info,
.wc-block-components-notice-banner.is-info { background: var(--wp--preset--color--base); background: color-mix(in srgb, var(--wp--preset--color--accent) 8%, var(--wp--preset--color--base)); border-inline-start: 4px solid var(--wp--preset--color--accent); }
.woocommerce-error,
.wc-block-components-notice-banner.is-error { background: var(--wp--preset--color--base); background: color-mix(in srgb, var(--wp--preset--color--danger) 9%, var(--wp--preset--color--base)); border-inline-start: 4px solid var(--wp--preset--color--danger); }

.woocommerce :where(input.input-text, select, textarea),
.wc-block-components-text-input input,
.wc-blocks-components-select .wc-blocks-components-select__select { background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--custom--radius--small); color: var(--wp--preset--color--contrast); min-height: var(--wp--custom--control--height); }

.woocommerce input[type="tel"],
.woocommerce input[name*="postcode"],
.wc-block-components-address-form input[type="tel"],
.wc-block-components-address-form input[autocomplete*="postal-code"] { direction: ltr; font-variant-numeric: tabular-nums; text-align: start; }

.maintheme-shop-layout { align-items: flex-start; gap: var(--wp--preset--spacing--50); }
.maintheme-shop-filters { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--custom--radius--medium); position: sticky; top: var(--wp--preset--spacing--30); }
.maintheme-shop-filters .wp-block-heading:first-child { margin-block-start: 0; }
.maintheme-shop-filters input,
.maintheme-shop-filters select { max-width: 100%; }
.maintheme-shop-toolbar { border-block-end: 1px solid var(--wp--preset--color--border); gap: var(--wp--preset--spacing--30); margin-block-end: var(--wp--preset--spacing--40); padding-block-end: var(--wp--preset--spacing--30); }
.maintheme-shop-toolbar select { background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--custom--radius--small); min-height: var(--wp--custom--control--height); min-width: 13rem; padding-inline: var(--wp--preset--spacing--30); }

.maintheme-product-card {
  background: var(--wp--preset--color--base);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--wp--custom--radius--medium);
  box-shadow: var(--wp--preset--shadow--subtle);
  display: flex !important;
  flex-direction: column;
  gap: var(--wp--custom--product--card-gap);
  min-width: 0;
  padding: var(--wp--preset--spacing--30);
  transition: box-shadow var(--wp--custom--transition--standard), transform var(--wp--custom--transition--standard);
}
.maintheme-product-card:hover,
.maintheme-product-card:focus-within { box-shadow: var(--wp--preset--shadow--medium); transform: translateY(-2px); }
.maintheme-product-card .wp-block-woocommerce-product-image img { aspect-ratio: var(--wp--custom--product--image-ratio); border-radius: var(--wp--custom--radius--small); object-fit: cover; width: 100%; }
.maintheme-product-card .wp-block-post-title { line-height: 1.55; margin-block: 0; }
.maintheme-product-card .wp-block-woocommerce-product-button { margin-block-start: auto; }
.maintheme-product-card .wp-block-button__link,
.maintheme-product-card .wp-element-button { width: 100%; }
.maintheme-product-card--compact { padding: var(--wp--preset--spacing--20); }
.maintheme-product-card--minimal { border-color: transparent; box-shadow: none; padding: 0; }

.maintheme-product-layout { align-items: start !important; display: grid !important; gap: clamp(2rem, 5vw, 4.5rem) !important; grid-template-columns: minmax(0, 1.12fr) minmax(19rem, .88fr); }
.maintheme-product-layout > .wp-block-column { min-width: 0; }
.maintheme-product-gallery { min-width: 0; }
.maintheme-product-summary { align-self: start; position: sticky; top: var(--wp--preset--spacing--30); }
.maintheme-product-summary > :first-child { margin-block-start: 0; }
.maintheme-product-summary .cart { align-items: center; display: flex; flex-wrap: wrap; gap: var(--wp--preset--spacing--20); }
.maintheme-product-summary .quantity .qty { min-height: var(--wp--custom--control--height); }
.maintheme-product-reassurance { border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--custom--radius--medium); display: grid; gap: var(--wp--preset--spacing--20); padding: var(--wp--preset--spacing--30); }
.maintheme-product-reassurance p { margin: 0; }

.maintheme-commerce-page { margin-inline: auto; max-width: var(--wp--custom--layout--checkout); width: 100%; }
.maintheme-commerce-page .wp-block-post-content { width: 100%; }
.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout { margin-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--70); }
.wc-block-checkout__sidebar { align-self: start; position: sticky; top: var(--wp--preset--spacing--30); }
.wc-block-components-checkout-step,
.wc-block-checkout__sidebar .wc-block-components-totals-wrapper { scroll-margin-block-start: var(--wp--preset--spacing--40); }

.woocommerce table.shop_table,
.woocommerce-cart table.cart,
.woocommerce-checkout #order_review table { border: 1px solid var(--wp--preset--color--border); border-collapse: separate; border-radius: var(--wp--custom--radius--medium); border-spacing: 0; }
.woocommerce table.shop_table td,
.woocommerce table.shop_table th { border-block-end: 1px solid var(--wp--preset--color--border); padding: var(--wp--preset--spacing--30); }
.woocommerce table.shop_table tr:last-child td,
.woocommerce table.shop_table tr:last-child th { border-block-end: 0; }

.woocommerce-account .maintheme-account-page { min-height: 50vh; }
.woocommerce-account .woocommerce { margin-block-end: var(--wp--preset--spacing--70); }
.woocommerce-account .woocommerce-MyAccount-navigation ul { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--custom--radius--medium); display: grid; gap: var(--wp--preset--spacing--10); list-style: none; margin: 0; padding: var(--wp--preset--spacing--30); }
.woocommerce-account .woocommerce-MyAccount-navigation a { border-radius: var(--wp--custom--radius--small); display: block; padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30); }
.woocommerce-account .woocommerce-MyAccount-navigation .is-active > a { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--base); }
.woocommerce-account .woocommerce-form-login,
.woocommerce-account .woocommerce-form-register { background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--custom--radius--medium); box-shadow: var(--wp--preset--shadow--subtle); margin-inline: auto; max-width: 38rem; padding: var(--wp--preset--spacing--50); }

.woocommerce .price,
.woocommerce .amount,
.woocommerce .quantity,
.woocommerce .sku,
.wc-block-components-product-price,
.wc-block-components-quantity-selector { font-variant-numeric: tabular-nums; }

@media (max-width: 960px) {
  .maintheme-shop-layout { flex-wrap: wrap !important; }
  .maintheme-shop-layout > .wp-block-column:first-child { flex-basis: 100% !important; }
  .maintheme-shop-filters { position: static; }
}

@media (max-width: 781px) {
  .maintheme-shop-toolbar { align-items: stretch; }
  .maintheme-shop-toolbar select { max-width: 100%; min-width: 0; width: 100%; }
  .maintheme-product-summary,
  .wc-block-checkout__sidebar { position: static; }
  .woocommerce-account .woocommerce-MyAccount-navigation,
  .woocommerce-account .woocommerce-MyAccount-content { float: none; width: 100%; }
  .woocommerce-account .woocommerce-MyAccount-navigation { margin-block-end: var(--wp--preset--spacing--40); }
}

@media (max-width: 680px) {
  .maintheme-product-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .maintheme-product-card { padding: var(--wp--preset--spacing--20); }
  .woocommerce-account .woocommerce-form-login,
  .woocommerce-account .woocommerce-form-register { padding: var(--wp--preset--spacing--30); }
}
