/* Shared storefront presentation; tenant branding and commerce data remain authoritative. */
.storefront .home-premium {
  --sf-tile-gap: 18px;
}

/* Give both home collections the same width, photography and type hierarchy. */
.storefront .home-premium :is(#bestSellerRow.premium-products-grid, #newArrivalRow.new-arrivals-scroll) {
  width: 100%;
  max-width: none;
  margin-inline: auto;
  gap: 24px var(--sf-tile-gap);
  align-items: stretch;
  grid-auto-rows: auto;
}

.storefront .home-premium .premium-section-head {
  align-items: center;
  text-align: center;
  margin-bottom: 22px;
}

.storefront .home-premium .premium-section-title {
  font-weight: 500;
  letter-spacing: -.02em;
}

/* Reference layout: equal photo frames and aligned details within complete cards. */
.storefront .sf-product-tile,
.storefront .sf-product-tile:hover {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color, #e2ded7);
  border-radius: 22px !important;
  background: var(--bg-white, #fff);
  overflow: hidden;
  box-shadow: none;
  transform: none;
}

.storefront .sf-product-tile :is(.premium-product-media, .product-image-wrapper) {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  flex: none;
  padding: 0 !important;
  border: 0;
  border-bottom: 1px solid var(--border-color, #e2ded7);
  border-radius: 21px 21px 0 0;
  overflow: hidden;
  background: var(--bg-light);
}

.storefront .sf-product-tile .sf-tile-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.storefront .sf-product-tile :is(.premium-product-media img, .product-image) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0;
  transform: none;
}

.storefront .sf-product-tile:hover :is(.premium-product-media img, .product-image) {
  transform: none;
}

.storefront .sf-product-tile :is(.premium-wishlist-form, .product-actions) {
  position: absolute;
  top: 8px !important;
  right: 8px !important;
  bottom: auto;
  left: auto;
  margin: 0;
  opacity: 1;
  transform: none;
}

.storefront .sf-product-tile :is(.premium-heart, .action-btn) {
  display: grid;
  place-items: center;
  width: 44px !important;
  height: 44px !important;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--bg-white, #fff);
  box-shadow: none;
}

.storefront .sf-product-tile :is(.premium-heart, .action-btn) svg {
  width: 20px;
  height: 20px;
}

.storefront .sf-product-tile :is(.premium-product-body, .product-info) {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 3px;
  height: auto;
  min-height: 0 !important;
  padding: 10px 12px 12px !important;
}

.storefront .sf-product-tile :is(.premium-product-body h3, .product-name) {
  order: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  height: auto;
  min-height: 0 !important;
  flex: none;
  margin: 0 !important;
  font-family: inherit;
  font-size: 14px !important;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .01em;
  color: var(--text-dark);
}

.storefront .sf-product-tile :is(h3, .product-name) a {
  color: inherit;
  text-decoration: none;
}

.storefront .sf-product-tile :is(.premium-product-meta, .product-price) {
  order: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  min-height: 0;
  font-size: 18px;
  line-height: 1.3;
  flex: none;
  gap: 6px;
  margin: 0 !important;
}

.storefront .sf-product-tile :is(.premium-product-meta strong, .current-price) {
  font-size: 18px !important;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.02em;
  color: var(--text-dark);
  overflow-wrap: anywhere;
}

.storefront .sf-product-tile :is(.sf-home-tile-details, .product-meta, .product-category) {
  order: 2;
  min-height: 0;
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.4;
  color: var(--text-light);
}

.storefront .sf-product-tile .sf-home-tile-details {
  order: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storefront .sf-product-tile .sf-home-tile-stock {
  order: 3;
  min-width: 0;
}

.storefront .sf-product-tile .sf-home-tile-stock p {
  min-height: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-light);
}

/* The product page retains the existing purchase/enquiry flow. */
.storefront .sf-product-tile :is(.premium-card-actions, .collection-card-actions, .related-card-action),
.storefront .sf-product-tile .product-info > form {
  display: none;
}

.storefront .collections-modern .products-grid.list-view .collection-card-actions {
  display: flex;
}

.storefront .sf-product-tile a:focus-visible,
.storefront .sf-product-tile button:focus-visible {
  outline: 2px solid var(--primary-color) !important;
  outline-offset: -3px;
}

@media (min-width: 1024px) {
  .storefront .home-premium :is(#bestSellerRow.premium-products-grid, #newArrivalRow.new-arrivals-scroll) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 721px) and (max-width: 1023px) {
  .storefront .home-premium :is(#bestSellerRow.premium-products-grid, #newArrivalRow.new-arrivals-scroll) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .storefront .home-premium {
    --sf-tile-gap: 12px;
  }

  .storefront .home-premium .premium-container {
    width: calc(100% - 28px);
  }

  .storefront .home-premium .premium-section {
    padding-top: 32px;
  }

  .storefront .home-premium .premium-section-head {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
  }

  .storefront .home-premium .premium-section-kicker {
    margin-bottom: 6px;
  }

  .storefront .home-premium .premium-view-all {
    position: static;
    font-size: 13px;
    font-weight: 600;
  }

  .storefront .home-premium #bestSellerRow.premium-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Retain New Arrivals' horizontal browsing, with two complete tiles visible. */
  .storefront .home-premium #newArrivalRow.new-arrivals-scroll {
    grid-auto-columns: calc((100% - var(--sf-tile-gap)) / 2);
  }

  .storefront .sf-product-tile :is(.premium-product-body, .product-info) {
    padding: 8px 10px 10px !important;
    gap: 3px;
  }

  .storefront .sf-product-tile :is(.premium-product-body h3, .product-name) {
    font-size: 14px !important;
  }

  .storefront .sf-product-tile :is(.premium-product-meta, .product-price) {
    font-size: 17px;
  }

  .storefront .sf-product-tile :is(.premium-product-meta strong, .current-price) {
    font-size: 17px !important;
  }

  .storefront .collections-modern .products-grid:not(.list-view) {
    column-gap: 12px !important;
    row-gap: 20px !important;
    align-items: stretch;
  }

  .storefront .home-premium .category-circle strong {
    overflow-wrap: anywhere;
  }

  .storefront .collections-modern :is(.products-container, .products-toolbar-left, .products-toolbar-right) {
    min-width: 0;
  }

  .storefront .collections-modern .applied-filter-row {
    flex-wrap: wrap;
    overflow-wrap: anywhere;
  }

  .storefront .collections-modern .sort-select {
    max-width: 100%;
  }

  .storefront .product-detail-modern .single-product-details h1,
  .storefront .product-detail-modern .spec-row > *,
  .storefront .product-detail-modern .lole-summary-row > * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .storefront .product-detail-modern .mobile-purchase-price strong,
  .storefront .product-detail-modern .mobile-purchase-bar .btn-gold {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .storefront:has(.product-detail-modern .mobile-purchase-bar) {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

/* Match the reference's five-across desktop rows; use the complete section width. */
@media (min-width: 1280px) {
  .storefront .home-premium :is(#bestSellerRow.premium-products-grid, #newArrivalRow.new-arrivals-scroll),
  .storefront .collections-modern .products-grid.grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.storefront .collections-modern .products-grid.grid-5 {
  gap: 24px 16px;
  align-items: stretch;
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .storefront .collections-modern .products-grid.grid-5 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 721px) and (max-width: 1023px) {
  .storefront .collections-modern .products-grid.grid-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .storefront .collections-modern .products-grid.grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.storefront .collections-modern .view-toggle .view-icon.grid-5 {
  width: 20px;
}

/* Stretch only within each row, so one long description cannot inflate all other rows. */
.storefront .collections-modern .products-grid:not(.list-view),
.storefront .product-detail-modern .you-may-like-grid {
  align-items: stretch;
  grid-auto-rows: auto;
}

.storefront .sf-product-tile :is(.premium-product-body, .product-info) > * {
  min-width: 0;
}

/* Keep collection headings close to their products and stock status on the photo. */
.storefront .home-premium :is(.home-best-sellers, .home-new-arrivals) {
  padding-top: 28px;
}

.storefront .home-premium :is(.home-best-sellers, .home-new-arrivals) .premium-section-head {
  margin-bottom: 14px;
}

.storefront .home-premium :is(.home-best-sellers, .home-new-arrivals) .premium-section-kicker {
  margin-bottom: 4px;
}

.storefront .home-premium :is(.home-best-sellers, .home-new-arrivals) .premium-section-title {
  font-size: clamp(24px, 2.2vw, 32px);
}

.storefront .sf-product-tile .sf-tile-stock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 72px);
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--primary-color);
  color: var(--bg-white, #fff);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  pointer-events: none;
}

@media (max-width: 720px) {
  .storefront .home-premium :is(.home-best-sellers, .home-new-arrivals) {
    padding-top: 24px;
  }
}

/* Home cards follow their natural text flow: name, metal/weight, then price. */
.storefront .home-premium .sf-product-tile .premium-product-meta {
  order: 2;
}

/* Real single-row tracks: existing arrows now have overflow to scroll at every breakpoint. */
.storefront .home-premium :is(#bestSellerRow.premium-products-grid, #newArrivalRow.new-arrivals-scroll) {
  --sf-visible-products: 5;
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: none;
  grid-template-rows: auto;
  grid-auto-columns: calc((100% - (var(--sf-visible-products) - 1) * var(--sf-tile-gap)) / var(--sf-visible-products));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 0;
  padding-bottom: 8px;
  scrollbar-width: thin;
  touch-action: pan-x pan-y;
}
.storefront .home-premium :is(#bestSellerRow, #newArrivalRow) > * { scroll-snap-align: start; }
.storefront .home-premium .home-category-section #homeCategoryRow {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 0 8px;
}
.storefront .home-premium #homeCategoryRow .category-circle { flex: 0 0 128px; min-width: 0; scroll-snap-align: start; }
.storefront .home-premium #homeCategoryRow .category-circle strong { overflow-wrap: anywhere; }
.storefront .home-premium [data-home-carousel] > .carousel-arrow { display: grid; left: auto; right: 4px; width: 44px; height: 44px; top: 40%; transform: translateY(-50%); background: var(--bg-white, #fff); color: var(--primary-color); border: 1px solid var(--border-color); }
.storefront .home-premium [data-home-carousel] > .carousel-arrow.left { left: 4px; right: auto; }
.storefront .home-premium [data-home-carousel] > .carousel-arrow[hidden],
.storefront .home-premium .carousel-auto-toggle[hidden] { display: none !important; }
.storefront .home-premium .category-carousel > .carousel-arrow { top: 42%; }
.storefront .home-premium .carousel-auto-toggle { display: flex; align-items: center; margin: 4px 0 0 auto; min-height: 36px; padding: 4px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-dark); font-size: 12px; cursor: pointer; }
.storefront .home-premium [data-home-carousel] [role="region"] { cursor: grab; }
.storefront .home-premium [data-home-carousel] .is-dragging { cursor: grabbing; user-select: none; scroll-snap-type: none !important; }
.storefront .home-premium [data-home-carousel] :is(button, [tabindex]):focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
@media (min-width: 1024px) and (max-width: 1279px) {
  .storefront .home-premium :is(#bestSellerRow.premium-products-grid, #newArrivalRow.new-arrivals-scroll) { --sf-visible-products: 4; }
}
@media (min-width: 721px) and (max-width: 1023px) {
  .storefront .home-premium :is(#bestSellerRow.premium-products-grid, #newArrivalRow.new-arrivals-scroll) { --sf-visible-products: 3; }
}
@media (max-width: 720px) {
  .storefront .home-premium :is(#bestSellerRow.premium-products-grid, #newArrivalRow.new-arrivals-scroll) { --sf-visible-products: 2; }
  .storefront .home-premium #homeCategoryRow .category-circle { flex-basis: 96px; }
  .storefront .home-premium .home-category-section #homeCategoryRow { gap: 14px; }
}

.storefront .home-premium .home-category-section #homeCategoryRow::-webkit-scrollbar {
  display: none;
}
