/* Product image standard v2
   One visual contract everywhere:
   - Display frame: 5:4
   - Standard rendered output: 1250 x 1000 px
   - Default owner behavior: contain / no automatic crop
   - Optional owner-controlled fill: the owner chooses zoom and position before save
*/

:root {
  --wigo-product-image-ratio: 5 / 4;
  --wigo-product-image-bg: #f4f2ee;
}

/* CUSTOMER CARDS — same frame everywhere. */
.product-card .product-art,
.featured-card .product-art,
.rc8-row-product-card .product-art {
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: var(--wigo-product-image-ratio);
  overflow: hidden;
  background: var(--wigo-product-image-bg) !important;
}

.product-art.has-photo,
.rc8-row-product-card .product-art.has-photo {
  padding: 0 !important;
  background: var(--wigo-product-image-bg) !important;
}

.product-art.has-photo .product-photo,
.rc8-row-product-card .product-art.has-photo .product-photo,
.product-card .product-photo,
.featured-card .product-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain !important;
  object-position: center center;
  background: var(--wigo-product-image-bg);
}

/* PRODUCT DETAIL — same 5:4 frame, not a second surprise shape. */
.sheet-image.has-photo,
.product-sheet.rc8-product-detail-ready .sheet-image {
  width: auto;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: var(--wigo-product-image-ratio);
  overflow: hidden;
  background: var(--wigo-product-image-bg) !important;
}

.sheet-image.has-photo .product-photo,
.product-sheet.rc8-product-detail-ready .sheet-image.has-photo .product-photo {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center center;
  background: var(--wigo-product-image-bg);
}

/* OWNER UPLOAD — make the upload area itself match the customer card. */
.rc8-product-step-content .image-picker-block {
  width: 100%;
}

.rc8-product-step-content .image-picker-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px !important;
  align-items: stretch !important;
  width: 100%;
}

.product-image-standard {
  display: grid;
  gap: 3px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #e7e3dd;
  border-radius: 18px;
  background: #faf9f7;
}

.product-image-standard strong {
  color: #1d1c1a;
  font-size: 15px;
  font-weight: 800;
}

.product-image-standard span {
  color: #77736d;
  font-size: 12px;
  line-height: 1.4;
}

.rc8-product-step-content #product-image-preview {
  position: relative;
  width: 100% !important;
  max-width: 680px !important;
  min-height: 0 !important;
  height: auto !important;
  aspect-ratio: var(--wigo-product-image-ratio) !important;
  justify-self: center;
  border: 1px dashed #c9c5bf;
  border-radius: 28px;
  background: var(--wigo-product-image-bg);
  overflow: hidden;
}

.rc8-product-step-content #product-image-preview.has-image {
  border-style: solid;
}

.rc8-product-step-content #product-image-preview.has-image img {
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  display: block;
  object-fit: contain !important;
  object-position: center center;
  background: var(--wigo-product-image-bg);
}

.rc8-product-step-content #product-image-preview.has-image::after {
  content: "Preview ya mteja · 5:4";
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(20,20,20,.80);
  color: #fff;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .01em;
  pointer-events: none;
}

.rc8-product-step-content .image-picker-actions {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px !important;
  width: 100%;
  max-width: 680px;
  justify-self: center;
}

.rc8-product-step-content .image-picker-actions #product-image {
  display: none !important;
}

.product-image-change-button {
  cursor: pointer;
}

.rc8-product-step-content .image-picker-actions small {
  flex: 1 0 100%;
  color: #7c7871;
  font-size: 12px;
  line-height: 1.4;
}

/* OWNER POSITIONING — deliberate crop only, never automatic. */
.product-image-editor {
  width: 100%;
  max-width: 680px;
  justify-self: center;
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid #e6e2dc;
  border-radius: 20px;
  background: #faf9f7;
}

.product-image-editor[hidden] {
  display: none !important;
}

.product-image-mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.product-image-mode {
  min-height: 44px;
  border: 1px solid #dedad4;
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  color: #4f4c47;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
}

.product-image-mode.is-active {
  border-color: #1d1c1a;
  background: #1d1c1a;
  color: #fff;
}

.product-image-adjustments {
  display: grid;
  gap: 10px;
}

.product-image-adjustments[hidden] {
  display: none !important;
}

.product-image-adjustments label {
  display: grid;
  grid-template-columns: minmax(110px, auto) 1fr;
  align-items: center;
  gap: 12px;
  color: #55514c;
  font-size: 12px;
  font-weight: 720;
}

.product-image-adjustments input[type="range"] {
  width: 100%;
  accent-color: #1d1c1a;
}

#product-image-editor-status {
  color: #77736d;
  font-size: 12px;
  line-height: 1.4;
}

/* REVIEW — exact same visual contract before save. */
.rc8-product-review-image {
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: var(--wigo-product-image-ratio);
  background: var(--wigo-product-image-bg) !important;
  overflow: hidden;
}

.rc8-product-review-image img {
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  display: block;
  object-fit: contain !important;
  object-position: center center;
  background: var(--wigo-product-image-bg);
}

@media (max-width: 470px) {
  .rc8-product-step-content #product-image-preview,
  .rc8-product-step-content .image-picker-actions,
  .product-image-editor {
    max-width: none !important;
  }

  .product-image-adjustments label {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}


/* Image-step typography polish: smaller and lighter than the generic wizard title. */
.rc8-product-step-image h1,
.rc8-product-step:has(.image-picker-block) h1 {
  font-size: clamp(30px, 6.4vw, 48px) !important;
  line-height: 1.04 !important;
  letter-spacing: -.04em !important;
  font-weight: 650 !important;
}

.rc8-product-step-image > p,
.rc8-product-step:has(.image-picker-block) > p {
  display: none !important;
}

.rc8-product-step-image .rc8-product-step-content,
.rc8-product-step:has(.image-picker-block) .rc8-product-step-content {
  margin-top: 4px;
}

.rc8-product-step-image .product-image-standard,
.rc8-product-step:has(.image-picker-block) .product-image-standard {
  margin: 0;
  width: 100%;
  max-width: 680px;
  justify-self: center;
}


/* Featured/Popular cards: same compact footprint as category product cards.
   Promotion cards stay untouched. */
.featured-row {
  gap: 14px;
}

.featured-row .featured-card {
  flex: 0 0 min(43vw, 210px) !important;
  min-width: 150px !important;
  max-width: 210px;
  border-radius: 26px !important;
  scroll-snap-align: start;
}

.featured-row .featured-card .product-art {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: var(--wigo-product-image-ratio) !important;
  padding: 0 !important;
}

.featured-row .featured-card .card-copy {
  min-height: 78px;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 13px 15px 15px;
}

.featured-row .featured-card .card-copy h3 {
  margin: 0;
  overflow: hidden;
  color: #1b1b1d;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -.025em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.featured-row .featured-card .card-copy p,
.featured-row .featured-card .availability {
  display: none !important;
}

.featured-row .featured-card .price {
  display: block;
  color: #1b1b1d;
  font-size: 15px;
  font-weight: 750;
}

@media (max-width: 470px) {
  .featured-row .featured-card {
    flex-basis: 43vw !important;
    max-width: none;
  }
}

@media (min-width: 700px) {
  .featured-row .featured-card {
    flex-basis: 190px !important;
    max-width: 190px;
  }
}


/* Edge-to-edge card image hotfix:
   photo touches the top edge and inherits rounded top corners. */
.product-card,
.featured-card,
.rc8-row-product-card {
  overflow: hidden !important;
  padding-top: 0 !important;
}

.product-card .product-art,
.featured-card .product-art,
.rc8-row-product-card .product-art {
  position: relative;
  margin: 0 !important;
  padding: 0 !important;
  border-top-left-radius: inherit !important;
  border-top-right-radius: inherit !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.product-card .product-art.has-photo .product-photo,
.featured-card .product-art.has-photo .product-photo,
.rc8-row-product-card .product-art.has-photo .product-photo {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}


/* Full-screen product detail keeps the 5:4 image contract but removes the bottom-sheet chrome. */
.product-sheet.rc8-product-detail-ready.rc8-commerce-product .sheet-image,
.product-sheet.rc8-product-detail-ready.rc8-commerce-product .sheet-image.has-photo{
  width:auto !important;
  margin:0 -20px 24px !important;
  border-radius:0 0 28px 28px !important;
}


/* Owner product photo step — compact actions, gallery button above sizing note. */
.rc8-product-step-image > .rc8-product-kicker {
  display: none !important;
}

.rc8-product-step-content .product-image-preview-wrap {
  position: relative;
  width: 100%;
  max-width: 680px;
  justify-self: center;
}

.rc8-product-step-content .product-image-preview-wrap #product-image-preview {
  max-width: none !important;
  justify-self: stretch;
}

.rc8-product-step-content .product-image-remove-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 8;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(20,20,20,.78);
  color: #fff;
  font: 600 25px/1 Arial,sans-serif;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(0,0,0,.18);
}

.rc8-product-step-content .product-image-remove-icon:disabled {
  display: none;
}

.rc8-product-step-content .image-picker-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, .72fr);
  gap: 10px !important;
}

.rc8-product-step-content .image-picker-actions .soft-button {
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-align: center;
  line-height: 1.15;
}

.rc8-product-step-content .product-gallery-inline-add {
  cursor: pointer;
}

.rc8-product-step-content .product-image-standard {
  order: 3;
  width: 100%;
  max-width: 680px;
  justify-self: center;
  margin: 0 !important;
}

.rc8-product-step-content .product-gallery-owner {
  margin: -2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.rc8-product-step-content .product-gallery-owner-meta {
  display: flex;
  justify-content: flex-end;
  min-height: 18px;
  margin: 0 2px 6px;
}

.rc8-product-step-content .product-gallery-owner-meta #product-gallery-count {
  color: #77736d;
  font-size: 12px;
  font-weight: 750;
}

.rc8-product-step-content .product-gallery-owner-grid:has(.product-gallery-owner-empty) {
  display: none;
}

@media (max-width: 430px) {
  .rc8-product-step-content .image-picker-actions {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    gap: 8px !important;
  }

  .rc8-product-step-content .image-picker-actions .soft-button {
    padding: 0 10px;
    font-size: 13px;
  }

  .rc8-product-step-content .product-image-remove-icon {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
  }
}
