/* Product media is intentionally contained, not cropped. This keeps the full
   silhouette visible across cards, product sheets, and both cart views. */
:root {
  --product-media-bg: #f7f4ef;
  --product-media-line: rgba(62, 48, 35, .09);
}

body .product-card .product-img-wrap {
  aspect-ratio: 2 / 3 !important;
  background: var(--product-media-bg) !important;
  border: 1px solid var(--product-media-line);
  border-radius: 12px !important;
}

/* Keep the compact new-arrival cards portrait too, so the storefront has one
   consistent fashion-card silhouette. */
body.page-home .flash-card-img {
  aspect-ratio: 2 / 3 !important;
  height: auto !important;
}

body.page-home .flash-card-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  transition: opacity .24s ease !important;
}

body .product-card .product-img-wrap > a {
  padding: 0 !important;
}

html body .product-card .product-img,
html body .product-card:hover .product-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  transform: none !important;
  filter: none !important;
  transition: opacity .24s ease !important;
}

.product-card .product-info {
  padding: .8rem .25rem .35rem !important;
}

.product-card .product-name {
  min-height: 2.75em !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.product-card .product-price-wrap {
  margin-bottom: 0 !important;
}

/* Product sheet */
#productSheet {
  max-height: min(94vh, 900px);
}

#productSheet .psheet-gallery {
  padding: .7rem 1rem .8rem;
}

#productSheet .psheet-main-img {
  position: relative;
  width: auto;
  height: min(52vh, 500px);
  max-width: 100%;
  aspect-ratio: 2 / 3 !important;
  margin-inline: auto;
  border: 1px solid var(--product-media-line);
  border-radius: 18px !important;
  background: var(--product-media-bg) !important;
  box-shadow: 0 14px 34px rgba(45, 34, 24, .1);
}

#productSheet .psheet-main-media {
  position: absolute;
  inset: 0;
}

#productSheet .psheet-media-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  background: rgba(20,16,12,.48);
  color: #fff;
  box-shadow: 0 7px 18px rgba(0,0,0,.16);
  backdrop-filter: blur(8px);
  transform: translateY(-50%);
  cursor: pointer;
  transition: opacity .18s ease, transform .18s ease, background .18s ease;
}

#productSheet .psheet-media-prev { inset-inline-start: .65rem; }
#productSheet .psheet-media-next { inset-inline-end: .65rem; }

#productSheet .psheet-media-nav:hover {
  background: rgba(20,16,12,.72);
  transform: translateY(-50%) scale(1.06);
}

#productSheet .psheet-media-nav:disabled {
  opacity: .24;
  cursor: default;
  transform: translateY(-50%);
}

#productSheet .psheet-media-count {
  position: absolute;
  inset-inline-start: 50%;
  bottom: .65rem;
  z-index: 3;
  min-width: 54px;
  padding: .28rem .6rem;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 999px;
  background: rgba(20,16,12,.56);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
  direction: ltr;
  unicode-bidi: isolate;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

#productSheet .psheet-media-zoom {
  position: absolute;
  top: .65rem;
  inset-inline-end: .65rem;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  background: rgba(20,16,12,.5);
  color: #fff;
  box-shadow: 0 7px 18px rgba(0,0,0,.16);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

#productSheet .psheet-main-img.is-video .psheet-media-zoom {
  display: none;
}

body.psheet-lightbox-open {
  overflow: hidden !important;
}

.psheet-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483600 !important;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: rgba(8,7,6,.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.psheet-lightbox.open {
  opacity: 1;
  visibility: visible;
}

.psheet-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  color: #fff;
  font-weight: 800;
}

#psheetLightboxCount {
  direction: ltr;
  unicode-bidi: isolate;
}

.psheet-lightbox-close,
.psheet-lightbox-nav {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: #fff;
  cursor: pointer;
}

.psheet-lightbox-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
}

.psheet-lightbox-stage img {
  width: 100%;
  height: 100%;
  max-width: min(92vw, 900px);
  max-height: calc(100vh - 100px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  object-fit: contain;
  user-select: none;
}

.psheet-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  background: rgba(0,0,0,.48);
  backdrop-filter: blur(8px);
}

.psheet-lightbox-prev { inset-inline-start: .25rem; }
.psheet-lightbox-next { inset-inline-end: .25rem; }
.psheet-lightbox-nav:disabled { opacity: .2; cursor: default; }

#productSheet .psheet-main-img img {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: cover !important;
  object-position: center top !important;
  filter: none;
  transition: opacity .18s ease;
}

/* Product videos are mostly portrait fashion clips. Match the 4:5 product
   cards instead of stretching them inside the desktop landscape frame. */
#productSheet .psheet-main-img.is-video {
  height: min(52vh, 500px);
  width: auto;
  aspect-ratio: 2 / 3 !important;
  background: #080808 !important;
}

#productSheet .psheet-main-img.is-video video {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  background: #080808;
}

#productSheet .psheet-thumb,
#productSheet .psheet-reco-img {
  background: var(--product-media-bg);
}

#productSheet .psheet-thumbs {
  justify-content: flex-start;
  gap: .6rem;
  padding: .8rem .2rem .2rem;
  scroll-snap-type: x proximity;
}

#productSheet .psheet-thumb {
  width: 68px;
  height: 88px;
  border-radius: 12px;
  border-width: 2px;
  scroll-snap-align: start;
  box-shadow: 0 5px 14px rgba(35, 26, 19, .07);
}

#productSheet .psheet-thumb.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,97,.2), 0 7px 18px rgba(35,26,19,.12);
}

#productSheet .psheet-thumb img,
#productSheet .psheet-thumb video {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: cover !important;
  object-position: center top;
}

#productSheet .psheet-reco-img img {
  object-fit: cover !important;
  padding: 0;
}

#productSheet .psheet-info {
  padding-top: .55rem;
}

#productSheet .psheet-name {
  font-size: clamp(1rem, 3.8vw, 1.2rem);
  line-height: 1.5;
}

/* Cart bottom sheet */
#cartSheet .cart-sheet-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: .85rem;
  align-items: center;
  padding: .9rem 1rem;
}

#cartSheet .csi-img {
  width: 88px;
  height: 108px;
  border: 1px solid var(--product-media-line);
  border-radius: 13px;
  background: var(--product-media-bg);
}

#cartSheet .csi-img img {
  width: 100% !important;
  height: 100% !important;
  padding: .32rem;
  object-fit: contain !important;
  object-position: center !important;
}

#cartSheet .csi-name {
  font-size: .91rem;
  line-height: 1.5;
  margin-bottom: .25rem;
}

#cartSheet .csi-brand {
  line-height: 1.45;
}

#cartSheet .csi-row {
  flex-wrap: wrap;
  row-gap: .45rem;
}

#cartSheet .csi-del {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Full cart page */
body.page-cart .cart-page-head,
body.page-cart .cart-page-row {
  grid-template-columns: 104px minmax(160px, 1fr) auto auto auto !important;
}

body.page-cart .cart-page-img {
  width: 104px !important;
  height: 124px !important;
  border: 1px solid var(--product-media-line);
  border-radius: 12px !important;
  background: var(--product-media-bg);
}

body.page-cart .cart-page-img img {
  width: 100%;
  height: 100%;
  padding: .4rem;
  object-fit: contain !important;
  object-position: center !important;
}

body.page-cart .cart-page-name {
  font-size: .96rem;
  line-height: 1.55;
}

@media (min-width: 769px) {
  #productSheet {
    width: min(820px, calc(100vw - 32px));
  }

  #productSheet .psheet-main-img {
    height: min(54vh, 520px);
    width: auto;
    aspect-ratio: 2 / 3 !important;
  }

  #productSheet .psheet-main-img.is-video {
    height: min(54vh, 520px);
    width: auto;
    aspect-ratio: 2 / 3 !important;
  }
}

@media (max-width: 480px) {
  #productSheet .psheet-gallery {
    padding-inline: .75rem;
  }

  #productSheet .psheet-main-img,
  #productSheet .psheet-main-img.is-video {
    height: min(48vh, 460px);
  }

  #productSheet .psheet-thumb {
    width: 62px;
    height: 82px;
  }

  #productSheet .psheet-media-nav {
    width: 38px;
    height: 38px;
  }

  .psheet-lightbox {
    padding-inline: .5rem;
  }

  .psheet-lightbox-nav {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 700px) {
  .product-card .product-info {
    padding: .62rem .1rem .25rem !important;
  }

  #cartSheet .cart-sheet-item {
    grid-template-columns: 78px minmax(0, 1fr);
    padding-inline: .8rem;
  }

  #cartSheet .csi-img {
    width: 78px;
    height: 98px;
  }

  body.page-cart .cart-page-head {
    display: none !important;
  }

  body.page-cart .cart-page-row {
    grid-template-columns: 84px minmax(0, 1fr) !important;
    gap: .7rem !important;
    align-items: start !important;
  }

  body.page-cart .cart-page-img {
    width: 84px !important;
    height: 106px !important;
    grid-row: 1 / span 4;
  }

  body.page-cart .cart-page-row > div:nth-child(n+3) {
    grid-column: 2 !important;
  }
}

body.dark {
  --product-media-bg: #27231f;
  --product-media-line: rgba(255,255,255,.08);
}

/* Muted card video previews: hover on desktop, viewport focus on touch devices. */
.product-img-wrap,
.flash-card-img {
  isolation: isolate;
}

.product-card-preview-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: inherit;
  background: var(--product-media-bg, #f7f4ef);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.product-card.is-video-previewing .product-card-preview-video,
.flash-card.is-video-previewing .product-card-preview-video {
  opacity: 1;
}

.product-card.is-video-previewing .product-img,
.flash-card.is-video-previewing .flash-card-img > img {
  opacity: 0;
}

.product-card .product-video-badge,
.flash-card .product-video-badge,
.product-card .product-badge,
.flash-card .flash-card-discount,
.product-card .product-card-actions,
.product-card .product-quick-add,
.flash-card-img > span {
  z-index: 4;
}

.product-card [data-video-toggle],
.flash-card [data-video-toggle]{
  pointer-events:auto!important;
  cursor:pointer!important;
  touch-action:manipulation;
  user-select:none;
}
.product-card [data-video-toggle]:focus-visible,
.flash-card [data-video-toggle]:focus-visible{
  outline:3px solid rgba(201,169,97,.48);
  outline-offset:3px;
}

.is-video-previewing .product-video-badge {
  background: rgba(20, 15, 11, .7) !important;
  color: #fff !important;
  backdrop-filter: blur(7px);
}

.product-video-badge::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid transparent;
  border-top-color: rgba(255,255,255,.95);
  border-radius: 50%;
  opacity: 0;
}

.is-video-loading .product-video-badge i {
  opacity: .35;
}

.is-video-loading .product-video-badge::after {
  opacity: 1;
  animation: product-video-spin .75s linear infinite;
}

.is-video-previewing .product-video-badge i {
  animation: product-video-pulse 1.5s ease-in-out infinite;
}

@keyframes product-video-spin {
  to { transform: rotate(360deg); }
}

@keyframes product-video-pulse {
  50% { transform: scale(.82); opacity: .62; }
}

@media (prefers-reduced-motion: reduce) {
  .product-card-preview-video {
    display: none;
  }

  .product-video-badge::after,
  .is-video-previewing .product-video-badge i {
    animation: none;
  }
}
