/* Products, catalog and single product */

.ms-shop-page,
.ms-single-product-page {
  padding: 58px 0 88px;
}

.ms-single-product .woocommerce-notices-wrapper {
  margin: 0 0 28px;
  padding: 0;
}

.ms-single-product .woocommerce-info,
.ms-single-product .woocommerce-message,
.ms-single-product .woocommerce-error {
  margin: 0 0 28px;
}

.ms-catalog__header,
.ms-product-archive__header {
  margin-bottom: 40px;
}

.ms-catalog__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 42px 34px;
}

.ms-category-card {
  text-align: center;
}

.ms-category-card__image {
  margin-bottom: 18px;
}

.ms-category-card__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.ms-category-card__count {
  margin: 0;
  color: var(--ms-color-muted);
  font-size: 12px;
}

.ms-with-sidebar {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 76px);
  align-items: stretch;
}

.ms-category-sidebar {
  background: var(--ms-color-cream);
  padding: 26px 22px 30px;
}

.ms-category-sidebar h2 {
  margin: 0 0 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ms-category-sidebar__list,
.ms-category-sidebar__children {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ms-category-sidebar__parent {
  display: flex;
  align-items: stretch;
  width: calc(100% + 44px);
  margin-inline: -22px;
}

.ms-category-sidebar__link,
.ms-category-sidebar__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 22px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.ms-category-sidebar__item:not(.has-children) > .ms-category-sidebar__link {
  width: calc(100% + 44px);
  margin-inline: -22px;
}

.ms-category-sidebar__parent > .ms-category-sidebar__link {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 8px;
}

.ms-category-sidebar__parent > .ms-category-sidebar__toggle {
  flex: 0 0 42px;
  justify-content: center;
  padding-inline: 8px;
}

.ms-category-sidebar__link:hover,
.ms-category-sidebar__toggle:hover,
.ms-category-sidebar__parent:hover {
  background: var(--ms-color-cream-dark);
  opacity: 1;
}

.ms-category-sidebar__link {
  text-decoration: none;
}

.ms-category-sidebar__toggle:focus-visible,
.ms-category-sidebar__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.ms-category-sidebar__item.is-active > .ms-category-sidebar__link,
.ms-category-sidebar__item.is-active > .ms-category-sidebar__parent,
.ms-category-sidebar__children .is-active > a {
  font-weight: 700;
  background: var(--ms-color-cream-dark);
}

.ms-category-sidebar__arrow {
  flex: 0 0 auto;
  transition: transform 0.18s ease;
}

.ms-category-sidebar__item.is-open
  > .ms-category-sidebar__parent
  > .ms-category-sidebar__toggle
  .ms-category-sidebar__arrow {
  transform: rotate(90deg);
}

.ms-category-sidebar__children {
  padding: 8px 0 10px 14px;
}

.ms-category-sidebar__children[hidden] {
  display: none !important;
}

.ms-category-sidebar__children a {
  display: block;
  margin-left: -36px;
  margin-right: -22px;
  padding: 5px 22px 5px 36px;
  width: calc(100% + 58px);
  color: var(--ms-color-muted);
  font-size: 12px;
}

.ms-category-sidebar__children a:hover {
  background: var(--ms-color-cream-dark);
  opacity: 1;
}

.ms-product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  list-style: none;
  text-align: center;
}

.ms-product-card__image {
  flex: 0 0 auto;
  margin-bottom: 18px;
}

.ms-product-card__body {
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: minmax(48px, auto) 24px auto;
  align-content: start;
  gap: 10px;
}

.ms-product-card__title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 55px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-transform: uppercase;
}

.ms-product-card__title a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ms-product-card__price {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  color: var(--ms-color-muted) !important;
  font-size: 13px !important;
}

.ms-product-card__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.ms-product-card__actions .button,
.woocommerce .ms-product-card__actions .button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding-inline: 12px;
  font-size: 11px;
}

.ms-product-card__actions .button:nth-child(2) {
  background-color: var(--ms-color-green) !important;
}

.ms-product-card__actions .button:nth-child(2):hover {
  background-color: var(--ms-color-green-dark) !important;
}

.woocommerce-result-count,
.woocommerce-ordering {
  margin-bottom: 28px;
}

.variations_form table {
  width: 100%;
}

.variations_form table .label {
  text-align: left;
}

.variations_form table .value {
  text-align: right;
}

.variations_form select,
.woocommerce-ordering select {
  display: block;
  min-height: 40px;
  border: 0;
  padding: 0 14px;
  background: var(--ms-color-input);
}

.single_variation_wrap .woocommerce-variation-price {
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 400;
}

.ms-single-product__content {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(320px, 1fr);
  gap: clamp(38px, 6vw, 82px);
  align-items: start;
}

.ms-single-product__main-image {
  margin-bottom: 18px;
}

.ms-single-product__thumbs {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
}

.ms-single-product__thumb-track {
  display: flex;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ms-single-product__thumb-track::-webkit-scrollbar {
  display: none;
}

.ms-single-product__thumb,
.ms-gallery-arrow {
  border: 0;
  background: transparent;
  padding: 0;
}

.ms-single-product__thumb {
  flex: 0 0 calc((100% - 40px) / 5);
  aspect-ratio: 7 / 10;
  background: var(--ms-color-product-bg);
  overflow: hidden;
  opacity: 0.5;
}

.ms-single-product__thumb.is-active {
  opacity: 1;
}

.ms-single-product__thumb img,
.ms-single-product__thumb svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ms-gallery-arrow {
  min-height: 48px;
  font-size: 34px;
  line-height: 1;
}

.ms-single-product__summary .product_title {
  margin: 0 0 16px;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ms-single-product__price {
  margin-bottom: 26px;
  font-size: 17px;
  color: var(--ms-color-muted);
}

.ms-single-product__short-description {
  max-width: 620px;
  margin-bottom: 30px;
}

.ms-single-product__cart form.cart {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 36px;
}

.quantity {
  display: inline-flex;
  align-items: center;
}

.quantity input.qty {
  width: 72px;
  min-height: 44px;
  border: 0;
  background: var(--ms-color-input);
  text-align: center;
}

.ms-qty-button {
  width: 38px;
  min-height: 44px;
  border: 0;
  background: var(--ms-color-soft-gray);
}

.ms-single-product__description {
  padding-top: 28px;
  border-top: 1px solid var(--ms-color-border);
}

.ms-single-product__description h2,
.ms-related-products h2 {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ms-related-products {
  margin-top: 72px;
}

.ms-related-products > h2 {
  text-align: center;
}

.ms-placeholder-svg {
  width: 100%;
  height: 100%;
}

/* WooCommerce adds clearfix pseudo-elements to ul.products.
   In CSS Grid, ::before/::after can become grid items and consume a product slot.
   Remove them and fully neutralize legacy float-based product columns. */
.ms-product-archive__content .woocommerce ul.products,
.woocommerce .ms-product-archive__content ul.products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 42px 34px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.woocommerce .ms-related-products ul.products::before,
.woocommerce .ms-related-products ul.products::after,
.ms-product-archive__content .woocommerce ul.products::before,
.ms-product-archive__content .woocommerce ul.products::after,
.woocommerce .ms-product-archive__content ul.products::before,
.woocommerce .ms-product-archive__content ul.products::after {
  content: none !important;
  display: none !important;
}

.ms-product-archive__content .woocommerce ul.products li.product,
.woocommerce .ms-product-archive__content ul.products li.product {
  float: none !important;
  clear: none !important;
  width: auto !important;
  margin: 0 !important;
}

@media (max-width: 1180px) {
  .ms-product-archive__content .woocommerce ul.products,
  .woocommerce .ms-product-archive__content ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ms-product-archive__content .woocommerce ul.products,
  .woocommerce .ms-product-archive__content ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .ms-product-archive__content .woocommerce ul.products,
  .woocommerce .ms-product-archive__content ul.products {
    grid-template-columns: 1fr;
  }
}

/* Results count */

.woocommerce .woocommerce-result-count {
  margin-bottom: 1.5rem !important;
}

/* Pagination */

.woocommerce-pagination {
  margin: 3rem auto 1rem;
}
