/* Homepage bestsellers — premium card actions. Scoped to the home hits grid. */

body[data-page="home"] #bestsellers .cx-product-card {
  --hit-photo-h: 300px;
  container-type: inline-size;
  container-name: hit-card;
  position: relative;
  background: #fffdfb;
  border: 1px solid rgba(232, 210, 214, 0.95);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(90, 56, 64, 0.06);
}

body[data-page="home"] #bestsellers .merary-product-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
  margin-top: 12px;
}

body[data-page="home"] #bestsellers .merary-buy-now {
  width: 100% !important;
  min-width: 0 !important;
  height: 44px !important;
  padding: 0 10px !important;
  gap: 6px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #e86f91 !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  overflow: hidden;
}

body[data-page="home"] #bestsellers .merary-buy-now .merary-arrow {
  display: block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  stroke-width: 1.6;
}

body[data-page="home"] #bestsellers .merary-buy-now:hover:not(:disabled) {
  background: #dc6488 !important;
  color: #fff !important;
  transform: none;
  box-shadow: none !important;
}

body[data-page="home"] #bestsellers .merary-buy-now:active:not(:disabled) {
  background: #d35a80 !important;
  transform: scale(0.985);
}

body[data-page="home"] #bestsellers .merary-buy-now:focus-visible,
body[data-page="home"] #bestsellers .merary-add-cart:focus-visible {
  outline: 2px solid #e86f91;
  outline-offset: 2px;
}

body[data-page="home"] #bestsellers .merary-add-cart {
  width: 44px !important;
  min-width: 44px;
  max-width: 44px;
  height: 44px !important;
  padding: 0 !important;
  justify-self: end;
  border: 1px solid #e7b7c4 !important;
  border-radius: 50% !important;
  background: #fffdfb !important;
  color: #d56b8a !important;
  box-shadow: none !important;
}

body[data-page="home"] #bestsellers .cx-product-body h3 {
  display: block;
  height: auto;
  overflow: visible;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
}

body[data-page="home"] #bestsellers .cx-product-bottom {
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 12px;
}

body[data-page="home"] #bestsellers .merary-cart-icon,
body[data-page="home"] #bestsellers .merary-check-icon {
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
}

body[data-page="home"] #bestsellers .merary-cart-icon path,
body[data-page="home"] #bestsellers .merary-cart-icon circle,
body[data-page="home"] #bestsellers .merary-check-icon path {
  stroke-width: 1.25;
}

body[data-page="home"] #bestsellers .merary-add-cart:hover:not(:disabled) {
  background: #fff7f8 !important;
  border-color: #e0869e !important;
  color: #d56b8a !important;
}

body[data-page="home"] #bestsellers .merary-add-cart:active:not(:disabled) {
  transform: scale(0.96);
}

body[data-page="home"] #bestsellers .merary-add-cart.is-added {
  background: #e86f91 !important;
  border-color: #e86f91 !important;
  color: #fff !important;
}

@container hit-card (max-width: 240px) {
  body[data-page="home"] #bestsellers .cx-product-body {
    padding-left: 8px;
    padding-right: 8px;
  }

  body[data-page="home"] #bestsellers .merary-product-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="home"] #bestsellers .merary-add-cart {
    position: absolute !important;
    z-index: 4;
    top: calc(var(--hit-photo-h) - 54px);
    right: 10px;
    bottom: auto;
    left: auto;
    margin: 0;
  }
}

@container hit-card (max-width: 150px) {
  body[data-page="home"] #bestsellers .cx-product-body {
    padding-left: 6px;
    padding-right: 6px;
  }

  body[data-page="home"] #bestsellers .merary-buy-now {
    padding: 0 6px !important;
    gap: 0 !important;
  }

  body[data-page="home"] #bestsellers .merary-buy-now .merary-arrow {
    display: none;
  }
}

@media (max-width: 1180px) {
  body[data-page="home"] #bestsellers .cx-product-card {
    --hit-photo-h: 280px;
  }
}

@media (max-width: 600px) {
  body[data-page="home"] #bestsellers .cx-product-card {
    --hit-photo-h: 220px;
  }
}

@media (min-width: 64rem) {
  body[data-page="home"] #bestsellers .cx-product-card {
    --hit-photo-h: 23.75rem;
  }
}

/* 4-column hits: 260px through 1100px, then grow to 380px by 1360px. */
@media (min-width: 901px) and (max-width: 1360px) {
  body[data-page="home"] #bestsellers .cx-product-card {
    --hit-photo-h: clamp(260px, calc(46.15385vw - 247.6923px), 380px);
  }

  body[data-page="home"] #bestsellers .cx-product-image {
    height: clamp(260px, calc(46.15385vw - 247.6923px), 380px) !important;
    flex: 0 0 clamp(260px, calc(46.15385vw - 247.6923px), 380px) !important;
  }

  body[data-page="home"] #bestsellers .cx-product-image img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    object-position: center center;
  }
}

@media (max-width: 430px) {
  body[data-page="home"] .section--cream:has(#bestsellers) .section__header {
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
  }

  body[data-page="home"] .section--cream:has(#bestsellers) .section__title {
    min-width: 0;
    font-size: 22px;
    line-height: 1.15;
    white-space: nowrap;
  }

  body[data-page="home"] .section--cream:has(#bestsellers) .section__title .heart {
    font-size: 0.72em;
  }

  body[data-page="home"] .section--cream:has(#bestsellers) .section__link--btn {
    gap: 4px;
    padding: 7px 10px;
    font-size: 12px;
    letter-spacing: 0;
  }
}

@media (max-width: 360px) {
  body[data-page="home"] .section--cream:has(#bestsellers) .section__title {
    font-size: 19px;
  }

  body[data-page="home"] .section--cream:has(#bestsellers) .section__link--btn {
    gap: 2px;
    padding: 6px 8px;
    font-size: 11px;
  }
}

.qo-overlay {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(47, 32, 36, 0.46);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.qo-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

html.qo-open #site-viewport-overlays {
  z-index: 10080;
}

html.qo-open #site-viewport-overlays > .qo-overlay {
  z-index: 10120;
  pointer-events: auto;
}

html.qo-open .merary-support-dock,
html.qo-open .merary-support-dock__shell,
html.qo-open .merary-support-dock__tab {
  pointer-events: none !important;
}

.qo-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: min(680px, calc(100dvh - 32px));
  overflow: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  background: #fffdfb;
  color: #2f3528;
  border: 1px solid #f0e2e4;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(61, 40, 48, 0.18);
  padding: 22px 20px 18px;
  font-family: var(--font-sans, Montserrat, sans-serif);
}

.qo-dialog:focus {
  outline: none;
}

.qo-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #7a726e;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.qo-dialog {
  position: relative;
}

.qo-title {
  margin: 0 28px 14px 0;
  font-family: var(--font-serif, "Playfair Display", Georgia, serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  color: #2f3528;
}

.qo-product {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.qo-product img {
  width: 72px;
  height: 72px;
  max-width: 72px;
  object-fit: cover;
  border-radius: 14px;
  background: #fff5f8;
}

.qo-kicker {
  margin: 0 0 2px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c46b80;
  font-weight: 600;
}

.qo-name {
  margin: 0;
  font-family: var(--font-serif, "Playfair Display", Georgia, serif);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 500;
}

.qo-price {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
}

.qo-help {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #6d6560;
}

.qo-sizes-wrap {
  margin: 0 0 14px;
}

.qo-sizes-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #2b171a;
}

.qo-size-error {
  margin: 8px 0 0;
  font-size: 13px;
  color: #c5405c;
}

.qo-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.qo-channel {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #eadfdd;
  border-radius: 999px;
  background: #fff;
  color: #3d4536;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.qo-channel input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.qo-channel:has(input:focus-visible) {
  outline: 2px solid #e86f91;
  outline-offset: 2px;
}

.qo-channel:has(input:checked) {
  background: #3d4536;
  border-color: #3d4536;
  color: #fff;
}

.qo-field {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: #6d6560;
}

.qo-field[hidden],
.qo-error[hidden],
.qo-status[hidden] {
  display: none !important;
}

.qo-field input {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  border: 1px solid #eadfdd;
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: #2f3528;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  scroll-margin-bottom: 24px;
}

.qo-field input:focus {
  outline: 2px solid #e8a5b0;
  border-color: #e8a5b0;
}

.qo-error,
.qo-status {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
}

.qo-error {
  color: #a33b4a;
}

.qo-status {
  color: #6d5340;
  background: #fff6f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.qo-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  color: #4a4542;
}

.qo-consent input {
  margin-top: 2px;
  flex: 0 0 auto;
}

.qo-consent a {
  color: #c45c78;
  text-decoration: underline;
}

.qo-submit {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: #e86f91;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.qo-submit:hover {
  background: #e05d84;
}

@media (max-width: 53.125rem) {
  .qo-overlay {
    align-items: flex-end;
    padding: 8px;
  }

  .qo-dialog {
    width: 100%;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
    padding: 16px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .qo-channel {
    min-height: 40px;
  }

  .qo-title {
    font-size: 24px;
  }

  .qo-product {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .qo-product img {
    width: 60px;
    height: 60px;
  }
}
