/**
 * Nova Commerce Suite - Sprint 1.3 UI Polish.
 * Small visual refinements layered above stable components.
 */

/* Premium but restrained product-card feedback. */
.ncd-product-card {
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .ncd-product-card:hover {
    border-color: color-mix(in srgb, var(--ncd-primary) 18%, var(--ncd-border));
    box-shadow: 0 7px 22px rgba(15, 23, 42, .075);
    transform: translateY(-1px);
  }
}

/* Compact recommendation cards: more products remain visible in the scroll zone. */
.ncd-recommendations {
  padding: 12px !important;
}

.ncd-recommendations__head {
  margin-bottom: 9px !important;
}

.ncd-recommendations__grid {
  gap: 8px !important;
}

.ncd-rec {
  grid-template-columns: 56px minmax(0, 1fr) auto !important;
  min-height: 72px !important;
  gap: 9px !important;
  padding: 8px !important;
  border-radius: 13px !important;
}

.ncd-rec__image img {
  width: 56px !important;
  height: 56px !important;
  border-radius: 9px !important;
}

.ncd-rec__name {
  line-height: 1.25 !important;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ncd-rec__price {
  margin-top: 3px !important;
}

.ncd-rec__add {
  min-width: 82px !important;
  min-height: 42px !important;
  padding: 8px 12px !important;
  border-radius: 999px !important;
}

/* Payment Center 2.2 surface and consistent optical logo alignment. */
.ncd-payment-panel {
  border-color: color-mix(in srgb, var(--ncd-primary) 12%, var(--ncd-border)) !important;
  box-shadow: 0 7px 24px rgba(15, 23, 42, .045) !important;
}

.ncd-payment-icons--logos .ncd-pay {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, #fdfefe 100%) !important;
  border-color: color-mix(in srgb, var(--ncd-primary) 10%, var(--ncd-border)) !important;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .055) !important;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ncd-payment-icons--logos .ncd-pay::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.9), transparent 62%);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .ncd-payment-icons--logos .ncd-pay:hover {
    border-color: color-mix(in srgb, var(--ncd-primary) 30%, var(--ncd-border)) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .09) !important;
    transform: translateY(-2px);
  }
}

.ncd-payment-icons--logos .ncd-pay--stripe .ncd-payment-mark {
  transform: translateY(1px);
}

.ncd-payment-icons--logos .ncd-pay--applepay .ncd-payment-mark,
.ncd-payment-icons--logos .ncd-pay--googlepay .ncd-payment-mark {
  max-width: 88px !important;
}

.ncd-payment-panel__note {
  margin-top: 10px !important;
}

/* Full two-way coupon motion. */
.ncd-coupon-form {
  transform-origin: top center;
}

.ncd-coupon-form.is-visible {
  animation: ncdCouponOpen 180ms cubic-bezier(.2,.75,.3,1) both;
}

.ncd-coupon-form.is-closing {
  animation: ncdCouponClose 180ms cubic-bezier(.4,0,.8,.25) both;
  pointer-events: none;
}

.ncd-coupon-box.is-open .ncd-coupon-toggle__chevron {
  transform: rotate(180deg);
}

.ncd-coupon-toggle__chevron {
  transition: transform 180ms ease;
}

@keyframes ncdCouponOpen {
  from { opacity: 0; transform: translateY(-6px) scaleY(.96); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}

@keyframes ncdCouponClose {
  from { opacity: 1; transform: translateY(0) scaleY(1); }
  to { opacity: 0; transform: translateY(-5px) scaleY(.97); }
}

@media (max-width: 420px) {
  .ncd-rec {
    grid-template-columns: 52px minmax(0, 1fr) auto !important;
    min-height: 68px !important;
  }

  .ncd-rec__image img {
    width: 52px !important;
    height: 52px !important;
  }

  .ncd-rec__add {
    min-width: 76px !important;
    min-height: 40px !important;
    padding-inline: 10px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ncd-product-card,
  .ncd-payment-icons--logos .ncd-pay,
  .ncd-coupon-toggle__chevron,
  .ncd-coupon-form.is-visible,
  .ncd-coupon-form.is-closing {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
