/* Paw&Ramble: keep the existing palette and layouts, refine everyday use. */
/* Share card rows so optional ratings and wrapped names cannot offset prices
   or actions within the same product row. */
.mp-theme .mp-product-grid > .mp-product-card {
  display: flex;
  flex-direction: column;
}
.mp-theme .mp-product-grid .mp-card-info {
  flex: 1;
  display: grid;
  grid-template-rows: minmax(24px, auto) minmax(2.8em, auto) auto 1fr;
  align-items: start;
}
.mp-theme .mp-product-grid .mp-card-info > .star-rating {
  grid-row: 1;
  margin: 0 0 8px;
}
.mp-theme .mp-product-grid .mp-card-info > h3 {
  grid-row: 2;
}
.mp-theme .mp-product-grid .mp-card-price {
  grid-row: 3;
}
.mp-theme .mp-product-grid .mp-card-info > .mp-card-button {
  grid-row: 4;
  align-self: end;
}
@supports (grid-template-rows: subgrid) {
  .mp-theme .mp-product-grid > .mp-product-card {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 5;
    row-gap: 0;
  }
  .mp-theme .mp-product-grid .mp-card-info {
    grid-template-rows: subgrid;
    grid-row: 2 / span 4;
    row-gap: 0;
  }
}

/* Keep the customer-photo rails free of visible controls, as requested. */
.mp-theme .pr-review-rail .pr-rv-controls {
  display: none !important;
}

.pr-rv-dialog {
  border-radius: 12px;
  overscroll-behavior: contain;
}
.pr-rv-dialog .pr-rv-close {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 10px;
}
.pr-rv-dialog .pr-rv-dialog-thumbs button {
  width: 44px;
  height: 54px;
  min-height: 44px;
  border-radius: 6px;
  overflow: hidden;
}
.mp-theme .eg-dialog {
  overscroll-behavior: contain;
}

/* Field names remain visible while the customer types. */
.mp-theme .mp-contact-form label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
.mp-theme .mp-contact-form label > span {
  font-size: inherit;
}
.mp-theme .mp-contact-form label .mp-optional {
  font-size: 12px;
  color: #626262;
  font-weight: 400;
}
.mp-theme .mp-contact-form input,
.mp-theme .mp-contact-form textarea {
  margin-top: 8px;
}
.mp-theme .mp-contact-form > small {
  font-size: 12px;
  line-height: 1.65;
  color: #626262;
}
.mp-theme .mp-footer-bottom {
  font-size: 12px;
  line-height: 1.6;
}
.mp-theme .mp-footer .mp-newsletter-terms,
.mp-theme .mp-footer .pr-footer-payment-copy p {
  font-size: 12px;
  line-height: 1.6;
}
.mp-theme .mp-footer .mp-email-field button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  top: 2px;
  right: 2px;
}

/* Give the empty basket one clear route back to the collection. */
.mp-theme .wc-block-cart__empty-cart__title {
  padding-top: 0;
  margin-top: 36px;
  margin-bottom: 18px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.25;
  text-wrap: balance;
}
.mp-theme .wc-block-cart__empty-cart__title::before {
  display: none;
}
.mp-theme .wc-block-cart__empty-cart__title + p > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 12px;
  color: #fff;
  background: var(--mp-action, #00772f);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.mp-theme .wc-block-cart__empty-cart__title + p > a:hover {
  background: #005e27;
}
.mp-theme .wp-block-woocommerce-empty-cart-block > .is-style-dots {
  display: none;
}
.mp-theme .wp-block-woocommerce-empty-cart-block > .wp-block-heading:not(.wc-block-cart__empty-cart__title) {
  margin-top: 44px;
  margin-bottom: 24px;
  text-align: left;
  font-size: 26px;
}
.mp-theme .wp-block-woocommerce-empty-cart-block .wc-block-grid__products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
}
.mp-theme .wp-block-woocommerce-empty-cart-block .wc-block-grid__product {
  display: flex;
  flex-direction: column;
  width: auto !important;
  max-width: none !important;
  padding: 0;
  margin: 0;
  border: 0;
  text-align: left;
}
.mp-theme .wp-block-woocommerce-empty-cart-block .wc-block-grid__product-image {
  border-radius: 12px;
  overflow: hidden;
}
.mp-theme .wp-block-woocommerce-empty-cart-block .wc-block-grid__product-title {
  margin: 12px 0 8px;
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.mp-theme .wp-block-woocommerce-empty-cart-block .wc-block-grid__product-price {
  color: #176743;
  font-size: 15px;
  font-weight: 700;
}
.mp-theme .wp-block-woocommerce-empty-cart-block .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.4;
  background: var(--mp-action, #00772f);
  color: #fff;
  border: 0;
}
.mp-theme .wp-block-woocommerce-empty-cart-block .wp-block-button__link:hover {
  background: #005e27;
}
.mp-theme .wp-block-woocommerce-empty-cart-block .wc-block-grid__product-add-to-cart {
  margin-top: auto;
  padding-top: 12px;
}

@media (max-width: 767px) {
  /* A single 1fr track still inherits the swatch row's minimum width. */
  .mp-theme .mp-featured-product {
    grid-template-columns: minmax(0, 1fr);
  }
  .mp-theme .mp-featured-product > * {
    min-width: 0;
  }
  .mp-theme .mp-featured-copy h2 {
    line-height: 1.2;
    text-wrap: pretty;
  }
  .mp-theme .mp-featured-copy > p {
    overflow-wrap: anywhere;
  }
  .mp-theme .mp-colour-preview {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 30px));
    gap: 8px;
    margin: 18px 0;
  }
  .mp-theme .mp-colour-preview > span {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
  .mp-theme .mp-featured-copy > .button {
    min-height: 50px;
    padding-inline: 16px;
    white-space: normal;
    text-align: center;
  }
  .mp-theme .mp-featured-copy > .mp-size-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    line-height: 1.5;
  }
  .mp-theme .mp-mini-services {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px 24px;
    margin-top: 18px;
    line-height: 1.5;
  }
  .mp-theme .mp-mini-services > span {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .mp-theme .mp-header-inner {
    grid-template-columns: 1fr auto 1fr;
    gap: 4px;
    padding: 6px 10px;
  }
  .mp-theme .mp-header .eg-icon-button {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 9px;
    flex: 0 0 44px;
  }
  .mp-theme .mp-header .mp-logo {
    width: min(133px, calc(100vw - 208px));
  }
  .mp-theme .mp-header-actions {
    gap: 0;
  }
  .mp-theme .eg-dialog-header .eg-icon-button {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .mp-theme input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
  .mp-theme textarea,
  .mp-theme select,
  .mp-theme .pr-extra select {
    font-size: 16px !important;
  }
  .mp-theme .pr-product .pr-size-trigger,
  .mp-theme .pr-product .pr-size-drawer [data-pr-size-close] {
    min-height: 44px;
  }
  .mp-theme .wp-block-woocommerce-empty-cart-block .wc-block-grid__products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 14px;
  }
  .mp-theme .wp-block-woocommerce-empty-cart-block .wc-block-grid__product-title {
    font-size: 14px;
  }
  .mp-theme .wp-block-woocommerce-empty-cart-block .wp-block-button__link {
    width: 100%;
    padding-inline: 8px;
  }
}

/* Keep the review dialog focused on the photograph and translated review. */
.mp-theme .pr-rv-dialog .pr-rv-original-details,
.mp-theme .pr-rv-dialog .pr-rv-dialog-links {
  display: none !important;
}

@media (max-width: 760px) {
  /* The current purchase bar is .pr-sticky-buy; keep preferences above it. */
  .mp-theme:has(.pr-sticky-buy:not([hidden])) #moove_gdpr_save_popup_settings_button {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
    left: auto !important;
    right: 15px !important;
  }
  .mp-theme:has(.pr-sticky-buy:not([hidden])) .mp-footer-bottom {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

/* Keep the size-specific help beside the size label. */
.pr-product .variations th.pr-variation-heading {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* On small home and product pages the existing preferences control belongs in the footer,
   outside the scrolling form and above the reserved purchase-bar space. */
@media (max-width: 760px) {
  .mp-theme:has(.pr-product) .mp-footer-bottom {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  .mp-theme .mp-footer-bottom #moove_gdpr_save_popup_settings_button.pr-cookie-settings-inline {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    flex: 0 0 44px;
    width: 44px !important;
    height: 44px !important;
    min-height: 44px;
    margin: 0 0 0 auto !important;
  }
  .mp-theme .mp-footer-bottom #moove_gdpr_save_popup_settings_button.pr-cookie-settings-inline .moove_gdpr_text {
    display: none !important;
  }
}
