.rhm-product-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  background: var(--rhm-color-surface, #fff);
  border: 1px solid var(--rhm-color-outline, #d9dcd7);
  border-radius: 10px;
  box-shadow: none;
  transition: border-color 160ms ease;
}

.rhm-product-card:hover {
  border-color: var(--rhm-color-brand, #765816);
}

.rhm-product-card__image-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: var(--rhm-product-card-image-ratio, 4 / 3);
  padding: 0;
  background: var(--rhm-product-card-image-fill, #fff);
}

.rhm-product-card__image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.rhm-product-card__picture {
  display: block;
  width: 100%;
  height: 100%;
}

.rhm-product-card__image-wrapper::after {
  display: none;
  content: none;
}

.rhm-product-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--rhm-product-card-image-fit, cover);
  border-radius: 0;
}

.rhm-product-card__body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
}

.rhm-product-card__title {
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--rhm-color-ink, #171817);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.rhm-product-card__title a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.rhm-product-card__title-text {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--rhm-product-card-title-lines, 1);
  line-clamp: var(--rhm-product-card-title-lines, 1);
}

.rhm-product-card__excerpt {
  display: -webkit-box;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--rhm-color-ink-muted, #626660);
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--rhm-product-card-excerpt-lines, 2);
  line-clamp: var(--rhm-product-card-excerpt-lines, 2);
}

.rhm-product-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  margin: 0;
  padding: 0;
  color: var(--rhm-color-brand-strong, #59400c);
  font-size: 15px;
  font-weight: 700;
}

.rhm-product-card__price--current {
  color: var(--rhm-color-brand-strong, #59400c);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0;
}

.rhm-product-card__price del,
.rhm-product-card__price--original {
  color: var(--rhm-color-ink-muted, #626660);
  font-size: 11px;
  font-weight: 400;
  opacity: .72;
  text-decoration: line-through;
}

.rhm-product-card .rhm-product-card__price del .amount {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.rhm-product-card .rhm-product-card__price ins,
.rhm-product-card .rhm-product-card__price ins .amount,
.rhm-product-card .rhm-product-card__price--current .amount {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.rhm-product-card__rating {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.rhm-rating-summary {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: 3px;
  color: var(--rhm-color-ink, #171817);
  line-height: 1.2;
  white-space: nowrap;
}

.rhm-rating-summary__stars {
  display: block;
  width: 60px;
  height: 11.25px;
  flex: 0 0 auto;
  shape-rendering: geometricPrecision;
}

.rhm-rating-summary__track {
  fill: #cbd2ce;
}

.rhm-rating-summary__fill {
  fill: #007a5a;
}

.rhm-rating-summary__star {
  fill: #fff;
}

.rhm-rating-summary__value {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.rhm-rating-summary__score,
.rhm-rating-summary__rated {
  font-weight: 750;
}

.rhm-rating-summary__score {
  font-size: 12px;
}

.rhm-rating-summary__rated {
  font-size: 11px;
}

.rhm-rating-summary__reviews {
  margin-left: 1px;
  color: var(--rhm-color-ink-muted, #626660);
  font-size: 10px;
  font-weight: 400;
  white-space: nowrap;
}

.rhm-product-card__actions {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  gap: 8px;
  margin: auto 0 0;
  padding: 0;
}

.rhm-product-card__actions > * {
  min-width: 0;
}

.rhm-product-card__actions .rhm-product-card__wishlist {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  color: var(--rhm-color-brand-strong, #59400c);
  background: var(--rhm-color-surface, #fff);
  border: 1px solid var(--rhm-color-outline, #d9dcd7);
  border-radius: 10px;
  place-items: center;
}

.rhm-product-card__actions .rhm-add-to-cart-form,
.rhm-product-card .rhm-product-card__actions .rhm-btn--add-to-cart,
.rhm-product-card .rhm-product-card__actions .rhm-btn--view-product,
.rhm-product-card .rhm-product-card__actions .rhm-btn--external,
.rhm-product-card .rhm-product-card__actions .rhm-btn--disabled {
  width: 100%;
  flex: 1 1 auto;
}

.rhm-product-card__actions .rhm-add-to-cart-form {
  margin: 0;
}

.rhm-product-card .rhm-product-card__actions .rhm-btn--add-to-cart,
.rhm-product-card .rhm-product-card__actions .rhm-btn--view-product,
.rhm-product-card .rhm-product-card__actions .rhm-btn--external,
.rhm-product-card .rhm-product-card__actions .rhm-btn--disabled {
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.2;
}

.rhm-product-card .rhm-product-card__actions .rhm-btn--add-to-cart span,
.rhm-product-card .rhm-product-card__actions .rhm-btn--view-product span,
.rhm-product-card .rhm-product-card__actions .rhm-btn--external span,
.rhm-product-card .rhm-product-card__actions .rhm-btn--disabled span {
  white-space: normal;
  text-wrap: balance;
}

.rhm-product-card__add-to-cart.is-added {
  animation: rhm-add-button-confirm 420ms ease;
}

@keyframes rhm-add-button-confirm {
  50% { filter: brightness(.94); }
}

.rhm-product-card__actions .rhm-quantity-selector {
  display: none;
}

.rhm-product-card__badge,
.rhm-product-card__title-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  color: #fff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}

.rhm-badge--sale {
  background: var(--rhm-color-danger, #a63a32);
}

.rhm-badge--best-seller {
  background: var(--rhm-color-brand, #765816);
}

.rhm-badge--new {
  background: var(--rhm-color-success, #1e6b46);
}

.rhm-badge--out-of-stock {
  position: static;
  display: inline-block;
  margin-top: 4px;
  background: var(--rhm-color-ink-muted, #626660);
}

.rhm-var-panel[hidden] {
  display: none;
}

.rhm-var-panel {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.rhm-var-panel__overlay {
  position: absolute;
  inset: 0;
  background: rgb(23 24 23 / 55%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.rhm-var-panel__sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  max-height: min(85vh, 720px);
  flex-direction: column;
  overflow: hidden;
  background: var(--rhm-color-surface, #fff);
  border-radius: 10px 10px 0 0;
  transform: translateY(100%);
  transition: transform 220ms ease;
}

.rhm-var-panel.is-open .rhm-var-panel__overlay {
  opacity: 1;
}

.rhm-var-panel.is-open .rhm-var-panel__sheet {
  transform: translateY(0);
}

.rhm-var-panel__header {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--rhm-color-outline, #d9dcd7);
}

.rhm-var-panel__title {
  margin: 0;
  color: var(--rhm-color-ink, #171817);
  font-size: 18px;
  line-height: 1.25;
}

.rhm-var-panel__close {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  color: var(--rhm-color-ink, #171817);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
}

.rhm-var-panel__close:hover {
  background: var(--rhm-color-surface-subtle, #f6f7f8);
}

.rhm-var-panel__close:focus-visible,
.rhm-var-panel__chip:focus-visible,
.rhm-var-panel__confirm:focus-visible,
.rhm-var-panel__fallback-link:focus-visible {
  outline: 3px solid var(--rhm-color-info, #176b73);
  outline-offset: 2px;
}

.rhm-var-panel__close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.rhm-var-panel__body {
  overflow-y: auto;
  padding: 16px;
}

.rhm-var-panel__image {
  width: 88px;
  height: 88px;
  margin-bottom: 16px;
  object-fit: cover;
  background: var(--rhm-color-surface-subtle, #f6f7f8);
  border-radius: 10px;
}

.rhm-var-panel__attrs {
  min-block-size: 88px;
}

.rhm-var-panel__loading,
.rhm-var-panel__error {
  display: flex;
  min-block-size: 88px;
  align-items: center;
  gap: 10px;
  color: var(--rhm-color-ink-muted, #626660);
  font-size: 14px;
  line-height: 1.4;
}

.rhm-var-panel__spinner {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 2px solid var(--rhm-color-brand-soft, #f4eddc);
  border-right-color: var(--rhm-color-brand, #765816);
  border-radius: 50%;
  animation: rhm-var-panel-spin 700ms linear infinite;
}

.rhm-var-panel__error {
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
}

.rhm-var-panel__error p {
  margin: 0;
}

.rhm-var-panel__fallback-link {
  color: var(--rhm-color-brand-strong, #59400c);
  font-weight: 700;
  text-underline-offset: 3px;
}

@keyframes rhm-var-panel-spin {
  to {
    transform: rotate(360deg);
  }
}

.rhm-var-panel__attr-row {
  margin-bottom: 16px;
}

.rhm-var-panel__attr-label {
  display: block;
  margin-bottom: 8px;
  color: var(--rhm-color-ink, #171817);
  font-size: 14px;
  font-weight: 700;
}

.rhm-var-panel__attr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rhm-var-panel__chip {
  min-height: 44px;
  padding: 8px 14px;
  color: var(--rhm-color-ink, #171817);
  background: var(--rhm-color-surface, #fff);
  border: 1px solid var(--rhm-color-outline, #d9dcd7);
  border-radius: 10px;
}

.rhm-var-panel__chip:hover,
.rhm-var-panel__chip.is-active {
  color: var(--rhm-color-brand-strong, #59400c);
  background: var(--rhm-color-brand-soft, #f4eddc);
  border-color: var(--rhm-color-brand, #765816);
}

.rhm-var-panel__price {
  min-height: 24px;
  margin: 4px 0 16px;
  color: var(--rhm-color-brand-strong, #59400c);
  font-size: 18px;
  font-weight: 700;
}

.rhm-var-panel__confirm {
  width: 100%;
  min-height: 48px;
}

.rhm-var-panel__confirm:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

body.rhm-var-panel-open {
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .rhm-product-card__price--current {
    font-size: 16px;
  }

  .rhm-product-card__rating {
    align-content: center;
  }

  .rhm-product-card__rating .rhm-rating-summary {
    width: 100%;
    flex-wrap: wrap;
    align-content: center;
    column-gap: 3px;
    row-gap: 2px;
  }

  .rhm-product-card__rating .rhm-rating-summary__stars {
    width: 46px;
    height: 8.625px;
  }

  .rhm-product-card__rating .rhm-rating-summary__score {
    font-size: 11px;
  }

  .rhm-product-card__rating .rhm-rating-summary__rated {
    font-size: 10px;
  }

  .rhm-product-card__rating .rhm-rating-summary__reviews {
    flex-basis: 100%;
    margin-left: 0;
  }

}

@media (max-width: 359.98px) {
  /* Keep the compact action row stable when two-column cards get very narrow. */
  .rhm-product-card .rhm-product-card__actions .rhm-btn--add-to-cart,
  .rhm-product-card .rhm-product-card__actions .rhm-btn--view-product,
  .rhm-product-card .rhm-product-card__actions .rhm-btn--external,
  .rhm-product-card .rhm-product-card__actions .rhm-btn--disabled {
    padding-inline: 6px;
    font-size: 12px;
    white-space: nowrap;
  }

  .rhm-product-card .rhm-product-card__actions .rhm-btn--add-to-cart span,
  .rhm-product-card .rhm-product-card__actions .rhm-btn--view-product span,
  .rhm-product-card .rhm-product-card__actions .rhm-btn--external span,
  .rhm-product-card .rhm-product-card__actions .rhm-btn--disabled span {
    white-space: nowrap;
    text-wrap: nowrap;
  }
}

@media (min-width: 768px) {
  .rhm-var-panel__sheet {
    top: 50%;
    right: 24px;
    bottom: auto;
    left: auto;
    width: min(440px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    border-radius: 10px;
    transform: translateY(calc(-50% + 24px));
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .rhm-var-panel.is-open .rhm-var-panel__sheet {
    transform: translateY(-50%);
    opacity: 1;
  }
}

@media (min-width: 1024px) {
  .rhm-product-card .rhm-product-card__actions .rhm-btn--add-to-cart,
  .rhm-product-card .rhm-product-card__actions .rhm-btn--view-product,
  .rhm-product-card .rhm-product-card__actions .rhm-btn--external,
  .rhm-product-card .rhm-product-card__actions .rhm-btn--disabled {
    min-height: 40px;
  }

  .rhm-var-panel__chip {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rhm-var-panel__spinner {
    animation: none;
  }

  .rhm-product-card__add-to-cart.is-added {
    animation: none;
  }

  .rhm-var-panel__overlay,
  .rhm-var-panel__sheet {
    transition: none;
  }
}
