/*
 * WordPress/WooCommerce compatibility layer.
 *
 * The visual rules for header, hero, sections, cards, spacing and responsive
 * behaviour intentionally remain in the four original v12 stylesheets.
 * This file only normalises WordPress-generated markup.
 */
:root {
  --mmx-admin-bar: 0px;
  --mmx-catalog-sticky-gap: 24px;
  --mmx-catalog-bottom-gap: 24px;
  --mmx-catalog-fixed-bottom: 0px;
  --mmx-catalog-sticky-top: calc(var(--mmx-admin-bar) + var(--sticky-header-height, 180px) + var(--mmx-catalog-sticky-gap));
}
html { overflow-x: clip; }
body { max-width: 100%; overflow-x: clip; }
body.admin-bar { --mmx-admin-bar: 32px; }
a,
a:hover,
a:focus { text-decoration: none; }
.site-header { top: var(--mmx-admin-bar); }

.category-nav .menu-item { list-style: none; margin: 0; }
.category-nav .menu-item a {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
}
.footer-menu,
.footer-menu ul { margin: 0; padding: 0; list-style: none; }
.footer-menu a { display: block; padding: 5px 0; color: inherit; opacity: .86; }
.footer-contact-link { color: inherit; }

.header-search { position: relative; }
.search-suggestions {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.search-suggestions.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.search-result {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  color: #10182d;
  border-bottom: 1px solid #e5eaf2;
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: #edf5ff; }
.search-result img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: #f5f8fc;
}
.search-result span,
.search-result strong,
.search-result small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result small { margin-top: 3px; color: #5d6b82; }
.search-empty { padding: 16px; color: #5d6b82; }

/* WooCommerce catalog mapping */
.catalog-section {
  overflow: visible;
  padding-bottom: clamp(52px, 6vw, 82px);
}
.mmx-catalog-layout {
  position: relative;
  align-items: stretch;
  row-gap: 24px;
}
.catalog-sidebar {
  position: relative;
  align-self: stretch !important;
}
.catalog-sidebar-sticky,
.catalog-toolbar {
  top: var(--mmx-catalog-sticky-top) !important;
}
.catalog-sidebar-sticky {
  position: sticky;
  z-index: 29;
  align-self: flex-start;
  height: max-content;
  isolation: isolate;
}
.catalog-sidebar-sticky::before,
.catalog-toolbar::before {
  position: absolute;
  z-index: -1;
  top: calc(-1 * var(--mmx-catalog-sticky-gap));
  right: calc(-.5 * var(--bs-gutter-x, 24px));
  left: calc(-.5 * var(--bs-gutter-x, 24px));
  height: calc(var(--mmx-catalog-sticky-gap) + 1px);
  content: "";
  background: #f7faff;
  pointer-events: none;
}
.catalog-filter-sticky {
  position: relative !important;
  top: auto !important;
  height: max-content;
  max-height: calc(100vh - var(--mmx-catalog-sticky-top) - var(--mmx-catalog-fixed-bottom) - var(--mmx-catalog-bottom-gap));
  max-height: calc(100dvh - var(--mmx-catalog-sticky-top) - var(--mmx-catalog-fixed-bottom) - var(--mmx-catalog-bottom-gap));
  overflow-x: hidden;
  overflow-y: auto;
  margin-bottom: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scroll-padding-block: 16px;
}
.mmx-catalog-main {
  min-width: 0;
  align-self: stretch;
}
.catalog-toolbar {
  position: sticky;
  z-index: 29;
  min-height: 68px;
  margin-bottom: 24px !important;
  isolation: isolate;
}
.mmx-filter-list { display: grid; gap: 10px; }
.mmx-filter-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  color: #34445e;
}
.mmx-filter-list a:hover,
.mmx-filter-list a.current { color: #074f96; font-weight: 700; }
.mmx-filter-list .count {
  display: inline-flex;
  min-width: 28px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #edf4fc;
  font-size: 12px;
}
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering { float: none; margin: 0; }
.woocommerce .woocommerce-ordering select {
  min-height: 42px;
  padding: 8px 38px 8px 12px;
  border: 1px solid #cbd8e8;
  border-radius: 9px;
  background-color: #fff;
}
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  list-style: none;
}
.woocommerce ul.products li.product .product-card { height: 100%; }
.product-card { height: 100%; display: flex; flex-direction: column; }
.product-card .product-body { display: flex; flex: 1 1 auto; flex-direction: column; }
.product-card .stock-line { margin-top: auto; }
.product-card .button {
  display: inline-flex !important;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Database-driven brand cards retain the locked v12 card geometry. */
.mmx-brand-card {
  grid-template-rows: auto auto;
  gap: 7px;
  width: 100%;
  height: 100%;
  min-width: 0;
  text-align: center;
}
.mmx-brand-card-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mmx-brand-card-meta {
  color: #64748b;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: 0;
  transition: color .2s ease;
}
.mmx-brand-card:hover .mmx-brand-card-meta {
  color: rgba(255, 255, 255, .78);
}
.mmx-brand-logo {
  width: auto;
  max-width: min(124px, 100%);
  height: 28px;
  object-fit: contain;
}
.mmx-brand-empty {
  padding: 24px;
  color: #52637d;
  text-align: center;
  border: 1px dashed #bfd0e4;
  border-radius: 16px;
  background: #f8fbff;
}
.mmx-compatibility-empty {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .78);
  font-size: .85rem;
}
.woocommerce ul.products .product-card .add-cart.btn-brand {
  color: #fff;
  background: linear-gradient(135deg, var(--v3-navy) 0%, #0b4387 100%);
  border-color: var(--v3-navy);
}
.woocommerce ul.products .product-card .add-cart.btn-brand:hover,
.woocommerce ul.products .product-card .add-cart.btn-brand:focus {
  color: #fff;
  background: linear-gradient(135deg, var(--v3-blue) 0%, var(--v3-blue-bright) 100%);
  border-color: var(--v3-blue);
}
.star-rating { margin: 0; color: #f5a800; }
.woocommerce nav.woocommerce-pagination { margin-top: 36px; }
.woocommerce nav.woocommerce-pagination ul {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0;
  border: 0;
}
.woocommerce nav.woocommerce-pagination ul li { border: 0; }
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  display: inline-flex;
  min-width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9e4f2;
  border-radius: 10px;
  background: #fff;
  color: #06367d;
}
.woocommerce nav.woocommerce-pagination ul li span.current {
  border-color: #06367d !important;
  background: #06367d !important;
  color: #fff !important;
}

/* Product detail mapping */
.mmx-product-detail { padding: var(--section-space) 0; }
.mmx-product-gallery,
.mmx-product-summary,
.mmx-product-tabs {
  border: 1px solid #d8e3ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(3, 37, 100, .06);
}
.mmx-product-gallery { padding: clamp(18px, 3vw, 30px); }
.mmx-product-summary { padding: clamp(24px, 4vw, 42px); }
.mmx-product-gallery .woocommerce-product-gallery { width: 100% !important; float: none !important; margin: 0 !important; }
.mmx-product-summary .summary { width: 100% !important; float: none !important; margin: 0 !important; }
.mmx-product-summary .product_title { margin-bottom: 14px; color: #10182d; font-size: clamp(2rem, 3.2vw, 3rem); }
.mmx-product-summary .price { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: #10182d !important; font-size: 1.75rem !important; font-weight: 800; }
.mmx-product-summary .price del { color: #8c9aaf; font-size: 1rem; font-weight: 500; }
.mmx-product-summary .price ins { text-decoration: none; }
.mmx-product-summary form.cart { display: flex; flex-wrap: wrap; gap: 14px; margin: 24px 0 !important; }
.mmx-product-summary .quantity .qty { min-height: 48px; border: 1px solid #cbd8e8; border-radius: 9px; }
.mmx-product-summary .single_add_to_cart_button { min-width: 220px; min-height: 50px; }
.mmx-product-tabs { margin-top: 36px; padding: clamp(22px, 4vw, 40px); }
.mmx-product-tabs .woocommerce-tabs { margin: 0; }
.mmx-product-tabs .woocommerce-tabs ul.tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 !important; }
.mmx-product-tabs .woocommerce-tabs ul.tabs::before { display: none !important; }
.mmx-product-tabs .woocommerce-tabs ul.tabs li {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: #eef4fb !important;
}
.mmx-product-tabs .woocommerce-tabs ul.tabs li::before,
.mmx-product-tabs .woocommerce-tabs ul.tabs li::after { display: none; }
.mmx-product-tabs .woocommerce-tabs ul.tabs li.active { background: #06367d !important; }
.mmx-product-tabs .woocommerce-tabs ul.tabs li.active a { color: #fff !important; }
.woocommerce #reviews #comments ol.commentlist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 0;
}
.woocommerce #reviews #comments ol.commentlist li { margin: 0 !important; }
.woocommerce #reviews #comments ol.commentlist li .comment-text {
  height: 100%;
  margin: 0 !important;
  padding: 22px !important;
  border: 1px solid #d8e3ef !important;
  border-radius: 14px !important;
}

/* Cart, checkout and account */
.woocommerce-cart .woocommerce,
.woocommerce-checkout .woocommerce,
.woocommerce-account .woocommerce { width: 100%; }
.woocommerce table.shop_table {
  overflow: hidden;
  border: 1px solid #d8e3ef;
  border-radius: 16px;
  background: #fff;
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td { padding: 16px; }
.woocommerce .cart-collaterals .cart_totals,
.woocommerce-checkout #order_review,
.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-additional-fields {
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid #d8e3ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(3, 37, 100, .05);
}
.woocommerce-checkout #order_review { position: sticky; top: var(--mmx-catalog-sticky-top); }
.woocommerce .button,
.woocommerce button.button,
.woocommerce input.button,
.wc-block-components-button {
  display: inline-flex !important;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 9px !important;
}
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.select2-container .select2-selection--single {
  min-height: 48px;
  border: 1px solid #cdd8e7;
  border-radius: 9px;
  padding: 10px 12px;
}
.select2-container .select2-selection--single .select2-selection__rendered { line-height: 27px; }
.select2-container .select2-selection--single .select2-selection__arrow { top: 10px; }
.woocommerce-account .woocommerce {
  display: block;
}
.woocommerce-account .woocommerce::before,
.woocommerce-account .woocommerce::after { display: none; }
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content { float: none; width: 100%; }
.mmx-account-layout { align-items: flex-start; }
.mmx-account-main { min-width: 0; }
.mmx-account-main > :first-child { margin-top: 0; }
.mmx-account-main > :last-child { margin-bottom: 0; }
.mmx-account-main .woocommerce-notices-wrapper:empty { display: none; }
.mmx-account-main .woocommerce-form-row { margin: 0; }
.mmx-account-main .woocommerce-address-fields__field-wrapper .form-row {
  float: none;
  width: 100%;
}
.mmx-account-main .woocommerce-orders-table .button,
.mmx-account-main .woocommerce-MyAccount-paymentMethods .button {
  min-height: 40px;
  padding: 7px 14px;
}
.mmx-order-detail-table .woocommerce-order-details {
  margin-bottom: 0;
}
.mmx-order-detail-table .woocommerce-order-details__title {
  margin-bottom: 16px;
  color: #10182d;
  font-size: 1.25rem;
  font-weight: 800;
}
.mmx-account-main address { line-height: 1.75; }
.mmx-auth-card {
  width: 100%;
  max-width: 620px;
}
.woocommerce-account.logged-in .account-nav {
  position: sticky;
  top: var(--mmx-catalog-sticky-top);
}
.woocommerce-message,
.woocommerce-info { border-top-color: #06367d; background: #edf5ff; }
.woocommerce-error { border-top-color: #d63638; }

.content-card {
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid #d9e4f2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 15px 40px rgba(3, 37, 100, .06);
}
.pulse { animation: mmxPulse .5s ease; }
@keyframes mmxPulse { 50% { transform: scale(1.35); } }

@media (max-width: 991.98px) {
  body.admin-bar { --mmx-admin-bar: 46px; }
  .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .mmx-catalog-layout { row-gap: 18px; }
  .catalog-toolbar,
  .catalog-sidebar-sticky,
  .catalog-filter-sticky,
  .woocommerce-checkout #order_review { position: static; }
  .catalog-sidebar-sticky {
    top: auto !important;
    height: auto;
  }
  .catalog-filter-sticky {
    top: auto !important;
    max-height: none;
    overflow: visible;
  }
  .catalog-toolbar {
    top: auto !important;
    min-height: auto;
  }
  .woocommerce-account.logged-in .account-nav { position: static; }
  .catalog-sidebar-sticky::before,
  .catalog-toolbar::before { display: none; }
}
@media (max-width: 767.98px) {
  .woocommerce #reviews #comments ol.commentlist { grid-template-columns: 1fr; }
  .mmx-product-summary form.cart { display: grid; grid-template-columns: 100px minmax(0, 1fr); }
  .mmx-product-summary .single_add_to_cart_button { min-width: 0; }
  .mmx-account-main .surface-card { padding: 20px !important; }
  .mmx-account-main .table {
    min-width: 680px;
  }
  .mmx-account-main .table-responsive {
    max-width: 100%;
    overflow-x: auto;
  }
}
@media (max-width: 479.98px) {
  .woocommerce ul.products { grid-template-columns: 1fr; }
  .woocommerce table.shop_table th,
  .woocommerce table.shop_table td { padding: 12px 9px; }
}
