/* Compact compositions sized for the store's existing 175–478px square covers. */
html[data-template-layout] .hero-banner {
  margin: 24px 0 28px;
  padding: 32px 36px;
  border-radius: 20px;
}
html[data-template-layout] .hero-banner h1 {
  font-size: 32px;
  margin-bottom: 12px;
}
html[data-template-layout] .hero-banner p {
  font-size: 16px;
  line-height: 1.7;
}
html[data-template-layout] .category-tabs {
  gap: 8px;
  margin-bottom: 22px;
}
html[data-template-layout] .category-tabs a {
  padding: 9px 16px;
  font-size: 14px;
}

html[data-template-layout] .products-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
html[data-template-layout] .product-card {
  --product-thumb: 76px;
  display: grid;
  grid-template-columns: var(--product-thumb) minmax(0, 1fr) 154px 96px;
  grid-template-areas: 'image info meta action';
  align-items: center;
  align-content: center;
  gap: 12px 18px;
  padding: 14px 18px;
  border-radius: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px #18283d04;
}
html[data-template-layout] .product-image,
.related-image,
.detail-cover {
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid #e9edf2;
  border-radius: 12px;
  background: #fff;
}
html[data-template-layout] .product-image {
  grid-area: image;
  width: var(--product-thumb);
  height: var(--product-thumb);
  flex: none;
  aspect-ratio: 1;
  align-self: center;
}
html[data-template-layout] .product-image img,
.related-image img,
.detail-cover img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
  aspect-ratio: auto;
}
html[data-template-layout] .product-info {
  grid-area: info;
  min-width: 0;
}
html[data-template-layout] .product-info h2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  overflow-wrap: anywhere;
  height: 1.5em;
  min-height: 1.5em;
  line-height: 1.5;
  font-size: 16px;
  margin: 0 0 5px;
}
html[data-template-layout] .product-info p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.5;
  height: 3em;
  min-height: 3em;
  margin: 0;
}
html[data-template-layout] .product-meta {
  grid-area: meta;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  width: auto;
  min-width: 0;
  padding: 0;
  text-align: left;
}
html[data-template-layout] .product-card .product-price {
  font-size: 21px;
  line-height: 1.4;
}
html[data-template-layout] .product-card .product-badges {
  justify-content: flex-start;
  gap: 4px;
}
html[data-template-layout] .product-card .stock-badge,
html[data-template-layout] .product-card .auto-delivery-badge {
  font-size: 10.5px;
  padding: 3px 6px;
  margin: 0;
}
html[data-template-layout] .product-action {
  grid-area: action;
  width: auto;
  border: 0;
  padding: 0;
  align-self: center;
  justify-self: stretch;
}
html[data-template-layout] .product-card .buy-button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 9px;
  white-space: nowrap;
}

html[data-template-layout='cards'] .products-list,
html[data-template-layout='mint'] .products-list,
html[data-template-layout='boutique'] .products-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
html[data-template-layout='cards'] .product-card,
html[data-template-layout='mint'] .product-card,
html[data-template-layout='boutique'] .product-card {
  --product-thumb: 80px;
  grid-template-columns: var(--product-thumb) minmax(0, 1fr) 84px;
  grid-template-areas: 'image info info' 'image meta action';
  gap: 8px 14px;
  padding: 14px;
}
html[data-template-layout='cards'] .product-meta,
html[data-template-layout='mint'] .product-meta,
html[data-template-layout='boutique'] .product-meta {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 4px 10px;
}
html[data-template-layout='compact'] .product-card {
  --product-thumb: 64px;
  padding: 12px 16px;
  border-radius: 10px;
}
html[data-template-layout='compact'] .products-list {
  gap: 10px;
}
html[data-template-layout='compact'] .product-info p {
  -webkit-line-clamp: 1;
  height: 1.5em;
  min-height: 1.5em;
}
html[data-template-layout='mint'] .product-card {
  border-left: 3px solid color-mix(in srgb, var(--primary) 30%, var(--surface));
}
html[data-template-layout='boutique'] .product-card {
  border-radius: 10px;
}
html[data-template-layout='lavender'] .products-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
html[data-template-layout='lavender'] .product-card {
  --product-thumb: 72px;
  grid-template-columns: var(--product-thumb) minmax(0, 1fr);
  grid-template-areas: 'image info' 'meta meta' 'action action';
  padding: 14px;
  gap: 10px 12px;
  border-top: 2px solid color-mix(in srgb, var(--primary) 35%, var(--surface));
}
html[data-template-layout='lavender'] .product-meta {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
}
html[data-template-layout='lavender'] .product-info h2 {
  -webkit-line-clamp: 2;
  height: 3em;
  min-height: 3em;
  font-size: 15px;
}
html[data-template-layout='lavender'] .product-info p {
  -webkit-line-clamp: 1;
  height: 1.5em;
  min-height: 1.5em;
}

.product-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.product-heading-copy {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.detail-cover {
  width: 124px;
  height: 124px;
  flex: 0 0 124px;
  border-radius: 16px;
}
.product-heading .product-price-info {
  margin-bottom: 0;
}
html[data-template-layout] .product-info-left {
  padding: 26px;
}
html[data-template-layout] .purchase-sidebar {
  padding: 26px;
}
.rich-content img {
  width: auto;
  height: auto;
  max-width: 100%;
  border-radius: 12px;
}
.related-grid {
  gap: 12px;
}
.related-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-areas: 'image title' 'image price' 'badges badges';
  gap: 5px 12px;
  padding: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  align-content: start;
}
.related-image {
  grid-area: image;
  width: 64px;
  height: 64px;
  margin: 0;
  align-self: center;
}
.related-card h3 {
  grid-area: title;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 14px;
  height: 3em;
  min-height: 3em;
  line-height: 1.5;
  margin: 0;
}
.related-card .product-price {
  grid-area: price;
  font-size: 18px;
  line-height: 1.3;
}
.related-card .product-badges {
  grid-area: badges;
  justify-content: flex-start;
  gap: 4px;
  margin-top: 5px;
}
.related-card .stock-badge,
.related-card .auto-delivery-badge {
  font-size: 10.5px;
  padding: 3px 6px;
  margin: 0;
}
@media (max-width: 1100px) {
  html[data-template-layout='lavender'] .products-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  html[data-template-layout='cards'] .products-list,
  html[data-template-layout='mint'] .products-list,
  html[data-template-layout='boutique'] .products-list {
    grid-template-columns: minmax(0, 1fr);
  }
  html[data-template-layout] .product-card {
    gap: 10px 14px;
    padding: 12px 14px;
  }
  .product-heading {
    gap: 16px;
  }
  .detail-cover {
    width: 104px;
    height: 104px;
    flex-basis: 104px;
  }
}
@media (max-width: 650px) {
  html[data-template-layout] .hero-banner {
    margin: 16px 0 20px;
    padding: 24px 20px;
    border-radius: 16px;
  }
  html[data-template-layout] .hero-banner h1 {
    font-size: 25px;
  }
  html[data-template-layout] .hero-banner p {
    font-size: 14px;
  }
  html[data-template-layout] .category-tabs {
    justify-content: flex-start;
    margin-bottom: 18px;
    gap: 7px;
  }
  html[data-template-layout] .category-tabs a {
    padding: 8px 12px;
    font-size: 13px;
  }
  html[data-template-layout] .products-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  html[data-template-layout] .product-card {
    --product-thumb: 72px;
    grid-template-columns: var(--product-thumb) minmax(0, 1fr) 82px;
    grid-template-areas: 'image info info' 'image meta action';
    gap: 8px 12px;
    padding: 12px;
  }
  html[data-template-layout] .product-info h2 {
    font-size: 15px;
    -webkit-line-clamp: 1;
    height: 1.5em;
    min-height: 1.5em;
    line-height: 1.5;
    margin-bottom: 3px;
  }
  html[data-template-layout] .product-info p {
    font-size: 12.5px;
    -webkit-line-clamp: 1;
    height: 1.5em;
    min-height: 1.5em;
  }
  html[data-template-layout] .product-meta {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 3px 8px;
  }
  html[data-template-layout] .product-card .product-price {
    font-size: 18px;
  }
  html[data-template-layout] .product-card .buy-button {
    font-size: 12.5px;
    padding: 8px 9px;
  }
  html[data-template-layout] .product-info-left,
  html[data-template-layout] .purchase-sidebar {
    padding: 20px;
  }
  .product-heading {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    align-items: flex-start;
  }
  .product-heading-copy {
    display: contents;
  }
  .product-heading-copy h1 {
    grid-column: 2;
    grid-row: 1;
    font-size: 20px;
    margin: 0;
  }
  .product-heading-copy .product-subtitle {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
  }
  .product-heading-copy .product-price-info {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 0;
    padding: 14px;
  }
  .detail-cover {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 88px;
    height: 88px;
    flex-basis: 88px;
    border-radius: 12px;
  }
  .related-grid {
    gap: 10px;
  }
  .related-card {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 5px 8px;
    padding: 10px;
  }
  .related-image {
    width: 52px;
    height: 52px;
    border-radius: 10px;
  }
  .related-card h3 {
    font-size: 12.5px;
  }
  .related-card .product-price {
    font-size: 16px;
  }
  .related-card .stock-badge,
  .related-card .auto-delivery-badge {
    font-size: 10px;
    padding: 2px 5px;
  }
}

/* Shortage stays distinct from the ordinary inventory badges in every template. */
html[data-template-layout] .product-badges .stock-badge.sold-out {
  background: #cf2940;
  color: #fff;
  border: 1px solid #bf2138;
  font-weight: 750;
  font-size: 12px;
  padding: 3px 8px;
  box-shadow: 0 2px 5px #b51f350c;
}
.product-image,
.detail-cover,
.related-image {
  position: relative;
}
.cover-shortage {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  padding: 3px 7px;
  border-radius: 0 0 0 8px;
  background: #cf2940;
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: 1px;
  white-space: nowrap;
  pointer-events: none;
}
.cover-shortage[hidden] {
  display: none;
}
.detail-cover .cover-shortage {
  font-size: 12px;
  padding: 4px 10px;
}
