/* ==========================================================================
   Darseys: product card + product page image uniformity
   Loaded from layout/theme.liquid (line marked "Darseys custom: product media").
   NOTE: these rules use !important and OVERRIDE the editor's image ratio /
   image fit settings for product cards and the product gallery.
   To give control back to the theme editor: delete this file and its one
   line in layout/theme.liquid.
   ========================================================================== */

/* ==========================================================================
   OPTIONAL suggestion: uniform product cards  (START)
   Square 1:1 image box, whole image visible (contain) on white,
   vendor 1 line, title 2 lines with fixed min-height so prices line up.
   To remove: delete everything down to "(END)".
   ========================================================================== */
.card-wrapper .card__inner.ratio {
  --ratio-percent: 100% !important;
}
.card-wrapper .card__media {
  background: #ffffff;
}
.card-wrapper .card__media .media,
.card-wrapper .card__media .media img {
  background: #ffffff;
}
.card-wrapper .card__media .media img {
  object-fit: contain !important;
}
.card-wrapper .caption-with-letter-spacing {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-wrapper:not(.card--block) .card__heading,
.product-card-wrapper.card--block .card__heading .text-block > .text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-height: calc(2 * 1.5em);
  line-height: 1.5;
}
/* OPTIONAL suggestion: uniform product cards  (END) */

/* Block-based card markup (Ella 7.3 product grid) */
.card-wrapper .card--block-media:not(.homepage-promo-media) > .ratio { --ratio-percent: 100% !important; background: #fff; }
.card-wrapper .card--block-media .card__media .media,
.card-wrapper .card--block-media .card__media { background: #fff; }
.card-wrapper .card--block-media .card__media .media img { object-fit: contain !important; }
.card-wrapper .card--block-vendor { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.swiper-slide:has(> .product-card-wrapper.card--block > .card.flex-column) {
  height: auto;
}

:where(.grid__item, .product-grid__item, .swiper-slide) > .product-card-wrapper.card--block:has(> .card.flex-column):not(.product-grid[data-view='1'] *) {
  height: 100%;
}

.product-card-wrapper.card--block > .card.flex-column:not(.product-grid[data-view='1'] *) > .card--block-button {
  margin-block-start: auto;
}


/* ==========================================================================
   Product page media: uniform main image + thumbnails (START)
   Main slides: square 1:1 frame, whole image visible (contain), white, centered.
   Thumbnails: equal squares, contain, white. All widths.
   Zoom dialog (.dialog-zoomed-gallery) and slider arrows are not touched.
   To remove: delete everything down to "(END)".
   ========================================================================== */
media-gallery .product-media-container:not(.dialog-zoomed-gallery *) {
  aspect-ratio: 1 / 1 !important;
  max-height: none !important;
  background: #ffffff;
}
media-gallery .product-media-container:not(.dialog-zoomed-gallery *) .product-media-constraint-wrapper {
  width: 100% !important;
  height: 100%;
}
media-gallery .product-media-container:not(.dialog-zoomed-gallery *) .media,
media-gallery .product-media-container:not(.dialog-zoomed-gallery *) :is(img, .deferred-media__poster-image) {
  background: #ffffff !important;
}
media-gallery .product-media-container:not(.dialog-zoomed-gallery *) :is(img, .deferred-media__poster-image) {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

media-gallery .swiper-controls__thumbnail {
  --aspect-ratio: 1 !important;
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  background: #ffffff;
  overflow: hidden;
  border-radius: var(--media-radius, 0px);
}
media-gallery .swiper-controls__thumbnail img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center;
  background: #ffffff;
  border-radius: 0;
}
/* Product page media: uniform main image + thumbnails (END) */

/* Keep the main product heading above the price and secondary details. */
.template-product #MainContent product-info .product-details {
  .text-block > h1 {
    font-size: clamp(2.3rem, 2.2vw, 3.2rem);
    font-weight: 700;
    line-height: 1.2;
  }

  product-info-list {
    display: block;
    color: #625047;
    font-size: clamp(1.6rem, 1.25vw, 1.8rem);
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .product-info-list {
    gap: 4px;
  }

  .product-info-name {
    font-weight: 600;
  }

  .product-info-value a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  product-price > .price-product-container {
    font-size: clamp(2rem, 1.7vw, 2.4rem);
  }

  .price-product-container .price-item--percent {
    font-size: clamp(1.5rem, 1.11vw, 1.6rem);
  }

  .hotStock-text {
    display: block;
    font-size: clamp(1.6rem, 1.2vw, 1.7rem);
    line-height: 1.4;
  }

  .hotStock-progress {
    margin-block-start: 6px;
  }

  product-countdown:has(.product-countdown-wrapper:empty),
  .delivery-time:not(:has(.group-block-content > *)) {
    display: none;
  }

  > .group-block > .group-block-content:has(> .productView-hotStock:not(.hidden)) {
    row-gap: clamp(1.2rem, 1.1vw, 1.8rem);
  }
}


/* Homepage cards opt in to these actions from their media block. */
.template-index .homepage-product-media > .ratio {
  isolation: isolate;
}

.template-index .homepage-product-media .card__badge {
  inset: 4px auto auto 4px;
}

.template-index .homepage-product-media .sale-badge {
  --color-badge-border: transparent;
  background: var(--color-primary);
  color: var(--color-background);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 1.1rem;
  line-height: 1.25;
}

.template-index .homepage-product-media .card-wishlist,
.template-index .homepage-product-media__quick-add {
  position: absolute;
  z-index: 3;
  inset-inline-end: 4px;
}

.template-index .homepage-product-media .card-wishlist {
  inset-block-start: 4px;
}

.template-index .homepage-product-media__quick-add {
  inset-block-end: 4px;
}

.template-index .homepage-product-media__quick-add:has(.quick-add__error) {
  inset-inline-start: 4px;
  pointer-events: none;
}

.template-index .homepage-product-media__quick-add .card--block-button:has(.quick-add__error) {
  inline-size: 100%;
}

.template-index .homepage-product-media__quick-add:has(.quick-add__error) .quick-add {
  display: flex;
  justify-content: flex-end;
}

.template-index .homepage-product-media__quick-add :is(.quick-add__submit, .quick-add__error) {
  pointer-events: auto;
}

:is(.template-index, .template-collection, .template-product) #MainContent .product-card-wrapper .quick-add__error:not([hidden]) {
  position: absolute;
  inset-inline: 0;
  inset-block-end: calc(100% + var(--gap-xs));
  display: flex;
  align-items: flex-start;
  gap: var(--gap-xs);
  margin: 0;
  padding: var(--padding-sm);
  border-radius: var(--inputs-radius);
  background: var(--color-error-background);
  color: var(--color-foreground-heading);
  font-size: var(--font-size--xs);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

:is(.template-index, .template-collection, .template-product) #MainContent .product-card-wrapper .quick-add__error .svg-wrapper {
  flex: none;
  inline-size: 1.5rem;
  block-size: 1.5rem;
}

@media screen and (max-width: 749px) {
  .template-index .homepage-product-media__quick-add:has(.quick-add__error) {
    inset-block-start: 4px;
    display: flex;
    align-items: flex-end;
  }

  .template-index .homepage-product-media__quick-add .card--block-button:has(.quick-add__error) {
    position: static;
  }

  .template-index .homepage-product-media__quick-add .quick-add__error:not([hidden]) {
    inset-block-end: calc(var(--size-32) + var(--gap-xs));
    max-block-size: calc(100% - var(--size-32) - var(--gap-xs));
    overflow-y: auto;
  }

  :is(.template-index, .template-collection, .template-product) #MainContent .product-card-wrapper .quick-add__error:not([hidden]) {
    display: block;
    padding: var(--padding-2xs) var(--padding-xs);
    font-size: var(--font-size--2xs);
    line-height: 1.25;
  }

  :is(.template-index, .template-collection, .template-product) #MainContent .product-card-wrapper .quick-add__error .svg-wrapper {
    display: none;
  }
}

.template-index .homepage-product-media__wishlist,
.template-index .homepage-product-media__quick-add .quick-add__submit {
  display: grid;
  place-items: center;
  inline-size: var(--size-32);
  block-size: var(--size-32);
  min-inline-size: 0;
  min-block-size: 0;
  padding: 0;
  border: 1px solid rgb(var(--color-primary-rgb) / 18%);
  border-radius: 50%;
  background: var(--color-background);
  color: var(--color-primary);
  cursor: pointer;
}

.template-index .homepage-product-media__quick-add .quick-add__submit .icon-cart {
  inline-size: 12px;
  block-size: 12px;
}

.template-index .homepage-product-media__wishlist.wishlist-added {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-background);
}

.template-index .homepage-product-media__wishlist .svg-wrapper {
  inline-size: 16px;
  block-size: 16px;
}

.template-index .homepage-product-media__wishlist:hover,
.template-index .homepage-product-media__quick-add .quick-add__submit:hover {
  border-color: currentColor;
}

.template-index .homepage-product-media__wishlist:focus-visible,
.template-index .homepage-product-media__quick-add .quick-add__submit:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Product cutouts embedded in a homepage banner use the banner's background. */
.template-index .card-wrapper .homepage-promo-media > .ratio {
  background: transparent;
}

.template-index .card-wrapper .homepage-promo-media :is(.card__media, .card__media .media, .card__media .media img) {
  background: transparent;
}

.template-index .homepage-promo-media .card__media .media img {
  mix-blend-mode: multiply;
}

/* Homepage hero controls sit outside the image except for the side arrows. */
.template-index [id$="__slideshow_6Xxg76"] .slideshow .slideshow__slides:has(.swiper-pagination) {
  --hero-pagination-height: 38px;
  box-sizing: content-box;
  padding-block-end: var(--hero-pagination-height);
}

.template-index [id$="__slideshow_6Xxg76"] .swiper-actions {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.template-index [id$="__slideshow_6Xxg76"] .swiper-actions .swiper-button {
  top: calc((100% - var(--hero-pagination-height)) / 2);
  margin-top: 0;
  transform: translateY(-50%);
  pointer-events: auto;
}

.template-index [id$="__slideshow_6Xxg76"] .swiper-button-prev {
  left: clamp(6px, 1.1vw, 16px);
}

.template-index [id$="__slideshow_6Xxg76"] .swiper-button-next {
  right: clamp(42px, 6.5vw, 54px);
}

.template-index [id$="__slideshow_6Xxg76"] .swiper-actions .swiper-pagination {
  top: auto;
  bottom: 0;
  display: flex;
  align-items: center;
  block-size: var(--hero-pagination-height);
  pointer-events: auto;
  --swiper-pagination-bullet-inactive-color: #a28c8c;
  --swiper-pagination-color: #741320;
}

@media screen and (min-width: 750px) {
  .template-index [id$="__slideshow_6Xxg76"] .slideshow__slide .background-image-fit {
    padding-inline: clamp(48px, 5.5vw, 72px);
  }
}

@media screen and (max-width: 749px) {
  .template-index [id$="__slideshow_6Xxg76"] .slideshow__slides:has(.swiper-slide-active .background-image-fit) .swiper-actions .swiper-button {
    top: calc((100% - var(--hero-pagination-height)) * 0.78);
  }
}

/* Keep the centre column's two small photographs level with the adjacent tiles. */
@media screen and (min-width: 1025px) {
  .template-index [id$="__section_R8imh7"] .section-content-wrapper > .group-block:nth-child(2) {
    > .group-block-content > .group-block:last-child {
      flex: 1;

      > .group-block-content > .group-block {
        display: flex;

        > .group-block-content > .group-block--content-overlay {
          flex: 1;
          display: flex;

          > .group-block__media-wrapper {
            width: 100%;

            > .background-image-container {
              height: 100%;
            }
          }
        }
      }
    }
  }
}

/* Video popups use the height required by the player and title. */
.popup__inner.popup__inner--video {
  width: min(100rem, calc(100vw - 24px), max(32rem, calc((100dvh - 132px) * 16 / 9)));
  max-width: none;
  height: auto;
  max-height: calc(100dvh - 32px);
}

.popup__inner--video > .popup__inner--content {
  height: auto;
  padding: clamp(16px, 2vw, 28px);
}

.popup__inner--video deferred-media {
  display: block;
}

/* Give the dining cards a full row when the feature stacks on tablets. */
@media (750px <= width <= 1024px) {
  .template-index [id$="__section_KFRDwF"] .section-content-wrapper {
    flex-direction: column;

    > .group-block {
      width: 100%;
    }

    > .group-block--content-overlay {
      --overlay-ratio: 2.25;
    }
  }
}

/* Center each Inside Darseys action independently of the caption. */
@media (width < 1280px) {
  .template-index [id$="__video_carousel_reviews"] .multicolumn-list > li
    > .group-block--content-overlay > .group-block-content > .group-block--height-fill {
    position: absolute;
    inset-block-start: var(--inside-darseys-action-position, 46%);
    inset-inline: 0;
    transform: translateY(-50%);
  }
}

.template-index [id$="__explore-darseys-anniversary"]
  .tablet-layout-panel-flex--row > .group-block--content-overlay {
  align-self: center;

  > .group-block__media-wrapper .background-image-fit img {
    object-fit: contain;
  }
}

/* Share the anniversary row between the banner and collections on tablet. */
@media (750px <= width < 1280px) {
  .template-index:has(#multitasking-bar) [id$="__explore-darseys-anniversary"]
    .tablet-layout-panel-flex--row:has(> .image-carousel) {
    padding-inline-end: var(--size-44);
  }

  .template-index [id$="__explore-darseys-anniversary"] .tablet-layout-panel-flex--row > .image-carousel {
    width: var(--size-style-width);
    min-width: 0;
    align-self: center;
  }
}

@media (750px <= width < 900px) {
  .template-index [id$="__explore-darseys-anniversary"] .multicolumn-list .button--icon {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding-inline: var(--padding-2xs);
    gap: var(--gap-2xs);
    white-space: normal;
    line-height: 1.25;
  }

  .template-index [id$="__explore-darseys-anniversary"] .multicolumn-list .button--icon .icon-button {
    width: var(--size-12);
    height: var(--size-12);
  }
}

.template-index [id$="__explore-darseys-showroom"]
  .group-block--content-overlay:has(> .group-block-content side-drawer-opener) {
  > .group-block-content {
    justify-content: flex-end;
  }

  > .group-block-content > .group-block:has(side-drawer-opener) {
    position: absolute;
    inset: 46% 0 auto;
    transform: translateY(-50%);
  }

  > .group-block-content h3 {
    font-size: clamp(2.4rem, 3.4vw, 4.8rem);
  }
}

.template-index :is([id$="__video_carousel_reviews"], [id$="__explore-darseys-showroom"]) .popup__button {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  padding-block: 8px;
  line-height: 1.25;
}

@media (640px <= width < 960px) {
  .template-index [id$="__video_carousel_reviews"] .multicolumn-list > li > .group-block--content-overlay {
    --overlay-ratio: 4 / 3;
  }
}

@media (960px <= width <= 1024px) {
  .template-index [id$="__video_carousel_reviews"] .multicolumn-list {
    --card-grid-per-row: 4;
  }
}

@media (width < 360px) {
  .template-index [id$="__video_carousel_reviews"] {
    --inside-darseys-action-position: 42%;
  }
}


/* Darseys storefront and campaign palette. */
:is(.template-index, .template-collection, .template-product) {
  --darseys-burgundy: #6a0000;
  --darseys-cream: #fff6ed;
  --darseys-gold: #d6aa5e;
  --darseys-wine: #4c101a;
  --darseys-ivory: #fffaf3;
  --darseys-parchment: #f4ede4;
  --darseys-paper: #fffdf9;
  --darseys-ink: #2c2320;
  --darseys-muted: #625047;
  --darseys-line: #dfd1c3;
  --darseys-warm-gold: #e6c48b;
}

.template-index .product-card-wrapper.card--block:has(.homepage-product-media),
:is(.template-collection, .template-product) #MainContent .product-card-wrapper {
  .card--block-vendor {
    color: var(--darseys-muted);
  }

  .card--block-vendor > div {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card--block-vendor a {
    color: inherit;
  }

  > .card > .view-details-block {
    min-block-size: 3.8rem;
  }
}

.template-index .product-card-wrapper.card--block:has(.homepage-product-media),
:is(.template-collection, .template-product) #MainContent .product-card-wrapper,
.darseys-sale .sale-card {
  .price__regular .price-item--regular {
    color: var(--default-price-color);
  }

  .price__sale .price-item--sale {
    color: var(--default-sale-color, #d12442);
    white-space: nowrap;
  }

  .price__sale s.price-item--regular {
    color: var(--default-compare-color);
    font-size: 1.2rem;
    font-weight: 400;
    white-space: nowrap;
  }

  .price__sale .price-item {
    margin-inline: 0;
  }

  .price:not(.price--on-sale) .price__sale,
  .price--on-sale .price__regular {
    display: none;
  }

  .price--on-sale .price__sale {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.45rem;
  }

  @media (max-width: 359px) {
    .price__sale > span:has(> s) {
      flex-basis: 100%;
    }
  }
}

/* Match the homepage controls on Ella's collection and product cards. */
:is(.template-collection, .template-product) #MainContent .product-card-wrapper.card--block {
  --card-action-color: #741320;
  --card-action-offset: 5px;

  > .card {
    background: #fff;
    border: 1px solid var(--darseys-line);
    border-radius: 12px;
  }

  > .card:not(.product-grid[data-view='1'] *) {
    padding: 8px 8px 10px;
  }

  > .card.flex-column:has(> .card--block-media):has(> .card--block-button .quick-add__submit--icon):not(.product-grid[data-view='1'] *) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: min-content;
    align-content: start;
    align-items: start;

    > .card--block-media,
    > .card--block-button:has(.quick-add__submit--icon) {
      grid-area: 1 / 1;
    }

    > .card--block-button:has(.quick-add__submit--icon) {
      align-self: end;
      z-index: 3;
      margin: 0;
      padding: 0 var(--card-action-offset) var(--card-action-offset);
      pointer-events: none;
    }
  }

  .card--block-media :is(.card-product__group-wrapper, .card-product__group) {
    display: contents;
  }

  .card--block-media :is(.card-quickview, .card-wishlist) {
    position: absolute;
    z-index: 3;
    inline-size: auto;
  }

  .card--block-media .card-quickview {
    inset-inline-start: var(--card-action-offset);
    inset-block-end: var(--card-action-offset);
  }

  .card--block-media .card-wishlist {
    inset-inline-end: var(--card-action-offset);
    inset-block-start: var(--card-action-offset);
  }

  .card-compare {
    display: none;
  }

  .card-product-information {
    align-items: flex-start;
    gap: 6px;
  }

  .card--block-title .text-block > .text {
    margin-inline-start: 0;
    text-align: start;
  }

  .card__badge.top.left {
    inset-block-start: 4px;
    inset-inline-start: 4px;
  }

  .sale-badge {
    --color-badge-border: transparent;
    background: var(--card-action-color);
    color: #fff;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 1.1rem;
    line-height: 1.25;
  }

  :is(.card--block-vendor, .caption-with-letter-spacing) {
    font-size: 1.2rem;
    color: var(--darseys-muted);
  }

  .card__heading a {
    color: var(--card-action-color);
    font-size: 1.4rem;
    font-weight: 700;
  }

  .price {
    font-size: 1.4rem;
    font-weight: 700;
  }

  .quick-add:has(.quick-add__submit--icon) {
    display: flex;
    justify-content: flex-end;
  }

  :is(.quickview-button, .wishlist-button, .quick-add__submit--icon) {
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--card-action-color) 20%, white);
    border-radius: 50%;
    color: var(--card-action-color);
    background: #fff;
    inline-size: var(--size-32);
    block-size: var(--size-32);
    min-inline-size: var(--size-32);
    padding: 0;
    box-shadow: none;

    &::after {
      content: none;
    }

    &:hover:not(:disabled) {
      border-color: currentColor;
    }

    &:focus-visible {
      outline: 2px solid var(--card-action-color);
      outline-offset: 1px;
    }

    .text {
      display: none;
    }

    svg {
      color: inherit;
    }
  }

  :is(.quickview-button, .quick-add__submit--icon, .quick-add__error) {
    pointer-events: auto;
  }

  .quickview-button:is(:hover, :focus-visible),
  .wishlist-button.wishlist-added {
    border-color: var(--card-action-color);
    background: var(--card-action-color);
    color: #fff;
  }

  .quick-add__submit--icon .icon-cart {
    inline-size: 12px;
    block-size: 12px;
  }

  .quickview-button.loading .quickview-button__icon {
    visibility: hidden;
  }
}

/* Keep the in-carousel arrows clear of the card actions at the foot of the image. */
.template-product #MainContent :is(product-recommendations, recently-viewed-products)
  .swiper-btns-wrap--inside {
  --swiper-navigation-top-offset: calc(50% - 3.6rem);
}

.darseys-card-quick-view {
  position: absolute;
  z-index: 3;
  inset-inline-start: 5px;
  inset-block-end: 5px;
}

.darseys-card-quick-view .quickview-button {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 3.8rem;
  block-size: 3.8rem;
  padding: 0;
  border: 1px solid var(--darseys-line);
  border-radius: 50%;
  background: #fff;
  color: var(--darseys-burgundy);
  cursor: pointer;
}

.darseys-card-quick-view .quickview-button:hover {
  border-color: var(--darseys-burgundy);
  background: var(--darseys-burgundy);
  color: #fff;
}

.darseys-card-quick-view .quickview-button.loading .quickview-button__icon {
  visibility: hidden;
}

@media (hover: hover) and (pointer: fine) {
  :is(.template-index, .template-collection, .template-product) #MainContent
    .product-card-wrapper .quickview-button:not(.group-btn--show-always *) {
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
  }

  :is(.template-index, .template-collection, .template-product) #MainContent
    .product-card-wrapper:is(:hover, :focus-within) .quickview-button {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.template-index, .template-collection, .template-product) #MainContent
    .product-card-wrapper .quickview-button {
    transition: none;
  }
}

.template-index :where(
  [id$="__explore-darseys-anniversary"], [id$="__flash_deals"], [id$="__section_cFMTam"],
  [id$="__section_TYLNVm"], [id$="__explore-darseys-showroom"]
) .section-content-wrapper > .group-block:first-child {
  box-shadow: inset 0 2px var(--darseys-gold);
}

.template-index :where([id$="__explore-darseys-anniversary"]) .image-carousel-item__image {
  outline: 1px solid var(--darseys-gold);
  outline-offset: -1px;
  border-radius: 6px;
}

.template-index :where([id$="__explore-darseys-anniversary"], [id$="__explore-darseys-showroom"])
  .multicolumn-list .button--icon,
.template-index :where([id$="__flash_deals"]) a[class*="__view-all"] {
  --button-color: var(--darseys-burgundy);
  --button-background-color: var(--darseys-cream);
}

.template-index :where([id$="__section_cFMTam"]) a[href^="/search?"] {
  --button-color: var(--darseys-cream);
  --button-background-color: var(--darseys-burgundy);
}

/* Keep showroom actions readable over photos. */
.template-index :where([id$="__video_carousel_reviews"]) .button-secondary,
.template-index :where([id$="__section_AUpnnf"])
  .button-secondary[class*="__cta"] {
  --color-secondary-button-text: var(--darseys-cream);
  --color-secondary-button-background: var(--darseys-burgundy);
  --color-secondary-button-hover-text: var(--darseys-cream);
  --color-secondary-button-hover-background: #491019;
}

/* Place the room collection captions beneath the photos in their outlined cards. */
.template-index [id$="__section_PYykB8"] {
  .section-content-wrapper > .group-block--content-overlay {
    display: flex;
    flex-direction: column;
    overflow: hidden;

    > .group-block__media-wrapper {
      flex: none;
    }

    > .group-block-content {
      position: relative;
      inset: auto;
      height: auto;
      flex: 1 0 auto;
      justify-content: center;

      > .group-block {
        margin: 0;
        width: 100%;

        > .group-block-content {
          flex-flow: row wrap;
          align-items: center;
          justify-content: space-between;
          gap: 8px 12px;

          > .text-block {
            width: auto;
          }
        }
      }
    }
  }

  h3 {
    font-size: clamp(1.8rem, 1.55vw, 2.2rem);
  }

  .button-secondary {
    --color-secondary-button-text: var(--darseys-burgundy);
    --color-secondary-button-background: transparent;
    --color-secondary-button-border: var(--darseys-burgundy);
    --color-secondary-button-hover-text: var(--darseys-burgundy);
    --color-secondary-button-hover-background: var(--darseys-cream);
    --color-secondary-button-hover-border: var(--darseys-burgundy);

    min-block-size: 44px;
  }
}

/* Collection, dining, review, and story palettes share the same warm neutrals. */
.template-index :is(
  [id$="__section_R8imh7"],
  [id$="__section_KFRDwF"],
  [id$="__darseys-customer-reviews"],
  [id$="__darseys-story"]
) {
  background: var(--darseys-paper);

  h2 {
    letter-spacing: -0.028em;
    line-height: 1.09;
    text-wrap: pretty;
  }

  a:is(
    [class*="__cta"], [class*="__view-all"], [class*="__more-reviews"],
    [class*="__read-story"], [class*="__get-directions"]
  ) {
    min-height: 42px;
    width: fit-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--darseys-action-border, var(--darseys-burgundy));
    border-radius: 6px;
    padding: 9px 15px;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.25;
    background: var(--darseys-action-background, transparent);
    color: var(--darseys-action-text, var(--darseys-burgundy));
    text-decoration: none;
    white-space: normal;

    &:hover {
      text-decoration: underline;
      text-underline-offset: 0.2em;
    }

    &:focus-visible {
      outline: 2px solid currentColor;
      outline-offset: 2px;
    }
  }
}

.template-index [id$="__section_R8imh7"] {
  .section {
    background: var(--darseys-paper);
    padding-block: 24px;
  }

  .group-block--content-overlay {
    border-radius: 12px;

    > .group-block-content {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      justify-content: flex-end;
      padding: 12px;

      @media (width < 750px) {
        padding: 8px;
      }

      > .group-block {
        background: var(--darseys-wine);
        border: 1px solid #ffffff33;
        border-radius: 8px;
        color: var(--darseys-ivory);
        box-shadow: 0 4px 14px #26121622;
        padding: 12px 14px;
        width: fit-content;
        max-width: min(100%, 310px);
        margin: 0;

        @media (width < 750px) {
          padding: 8px 10px;
        }

        > .group-block-content {
          gap: 4px;
        }
      }
    }
  }

  h3 {
    color: var(--darseys-ivory);
    font-size: clamp(1.7rem, 2.15vw, 2.8rem);
    line-height: 1.12;
    letter-spacing: -0.018em;
    text-wrap: balance;
  }

  p {
    color: #f0dfd2;
    font-size: clamp(1.25rem, 1.03vw, 1.46rem);
    line-height: 1.38;
  }

  a[class*="__cta"] {
    --darseys-action-text: var(--darseys-warm-gold);

    border: 0;
    border-radius: 3px;
    padding: 0 1px;
    min-height: 34px;
    gap: 7px;
    justify-content: flex-start;
    font-size: 1.3rem;
    text-align: left;

    @media (width < 750px) {
      min-height: 44px;
    }

    &::after {
      content: '→' / '';
      font-size: 1.6rem;
    }
  }

  a[class*="__cta"]:hover {
    text-decoration: none;
  }

  a.link[class*="__cta"] > .text,
  a[class*="__cta"]:hover > .text {
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }
}

.template-index :is([id$="__section_KFRDwF"], [id$="__darseys-customer-reviews"]) h2 {
  color: var(--darseys-burgundy);
  font-size: clamp(2.6rem, 2.65vw, 3.9rem);
}

.template-index :is([id$="__section_KFRDwF"], [id$="__flash_deals"]) .view-details-block .link {
  display: block;
  line-height: 1.35;
}

.template-index [id$="__section_KFRDwF"] {
  .section-content-wrapper > .group-block:not(.group-block--content-overlay) {
    --color-foreground: var(--darseys-ink);
    --color-foreground-heading: var(--darseys-burgundy);
    --color-primary: var(--darseys-burgundy);

    border: 1px solid var(--darseys-line);
    border-radius: 12px;
    background: var(--darseys-parchment);
    padding: clamp(14px, 1.65vw, 24px);

    p {
      color: var(--darseys-muted);
    }
  }

  .section-content-wrapper > .group-block--content-overlay {
    @media (width < 750px) {
      background: var(--darseys-parchment);
    }

    > .group-block-content {
      @media (width < 750px) {
        grid-area: 2 / 1;
        background: var(--darseys-parchment);
      }

      > .group-block {
        background: var(--darseys-ivory);
        color: var(--darseys-ink);
        border-radius: 8px;
        padding: 13px 15px;

        @media (width < 750px) {
          margin: 0;
          background: transparent;
          padding: 12px 14px;
        }
      }
    }

    h3 {
      color: var(--darseys-burgundy);
      font-size: clamp(2rem, 1.8vw, 2.7rem);
      line-height: 1.12;
      letter-spacing: -0.014em;
    }

    p {
      font-size: 1.35rem;
      color: var(--darseys-muted);
    }
  }

  a[class*="__cta"] {
    --darseys-action-background: var(--darseys-burgundy);
    --darseys-action-text: var(--darseys-ivory);
  }

  a[class*="__view-all"] {
    flex-shrink: 0;
  }

  .product-card-wrapper > .card {
    background: #fff;
    border: 1px solid var(--darseys-line);
    border-radius: 8px;
    padding: 7px 8px 11px;
    height: 100%;
  }

  .view-details-block .link {
    color: var(--darseys-ink);
  }
}

.template-index [id$="__darseys-customer-reviews"] {
  .section-content-wrapper > .group-block {
    background: var(--darseys-parchment);
    border-block: 1px solid var(--darseys-line);
    padding-block: clamp(24px, 3.4vw, 54px);

    @media (width < 750px) {
      padding-block: 36px;
    }
  }

  .multicolumn-list {
    @media (width < 750px) {
      --card-grid-per-row: 2;
    }

    > li > .group-block {
      background: var(--darseys-paper);
      border: 1px solid var(--darseys-line);
      border-radius: 10px;
      height: 100%;

      > .group-block-content {
        height: 100%;

        > .group-block {
          padding: 14px 16px 16px;
          flex: 1 0 auto;
          height: auto;

          @media (width < 420px) {
            padding: 11px;
          }
        }
      }
    }
  }

  .image-block {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  /* Each review card's copy wraps the quote and the existing byline group. */
  .multicolumn-list > li > .group-block > .group-block-content > .group-block > .group-block-content {
    gap: 16px;
    height: 100%;
    justify-content: space-between;

    > .text-block p {
      color: var(--darseys-ink);
      font-size: clamp(1.55rem, 1.49vw, 2.14rem);
      line-height: 1.26;
      min-block-size: 2.52em;
      letter-spacing: -0.015em;
      text-wrap: pretty;

      @media (width < 750px) {
        min-block-size: 3.78em;
      }
    }

    > .group-block > .group-block-content {
      gap: 9px;

      > .group-block > .group-block-content {
        flex-wrap: wrap;
        gap: 4px 7px;

        @media (width < 420px) {
          align-items: flex-start;
          flex-direction: column;
        }
      }

      p {
        font-size: 1.3rem;
        color: var(--darseys-muted);
      }

      .text-block:first-child p {
        color: var(--darseys-burgundy);
        font-weight: 700;
      }
    }
  }
}

.template-index [id$="__darseys-story"] {
  .section-content-wrapper > .group-block {
    background: var(--darseys-wine);
    border: 1px solid var(--darseys-wine);
    border-radius: 12px;

    > .group-block-content > .group-block:has(h2) {
      background: var(--darseys-wine);
      padding: clamp(25px, 4.2vw, 64px);

      @media (750px <= width <= 1024px) {
        padding: 36px 32px;
      }

      @media (width < 750px) {
        padding: 30px 22px 32px;
      }
    }
  }

  h2 {
    color: var(--darseys-ivory);
    font-size: clamp(3rem, 3.8vw, 5.5rem);
    font-weight: 600;
  }

  p {
    color: #f1dfd4;
    line-height: 1.55;
    max-width: 52ch;
  }

  .group-block:has(> .group-block-content > .text-block h2)
    > .group-block-content > .text-block:first-child p {
    color: var(--darseys-warm-gold);
    font-size: 1.2rem;
    letter-spacing: 0.11em;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 10px;

    &::before {
      content: '';
      display: block;
      width: 22px;
      height: 1px;
      background: var(--darseys-warm-gold);
    }
  }

  a[class*="__read-story"] {
    --darseys-action-background: var(--darseys-ivory);
    --darseys-action-text: var(--darseys-wine);
    --darseys-action-border: var(--darseys-ivory);
  }

  a[class*="__get-directions"] {
    --darseys-action-text: var(--darseys-ivory);
    --darseys-action-border: #e6c48b99;
  }
}

/* Separate the store details from the showroom feature and the footer. */
.template-index [id$="__section_bLRgDL"] {
  .multicolumn-list {
    padding: clamp(16px, 2.1vw, 30px);
    gap: clamp(14px, 2vw, 28px);
    background: var(--darseys-wine);
    border-radius: 12px;
  }

  .icon-block {
    display: grid;
    place-items: center;
    inline-size: 42px;
    block-size: 42px;
    border: 1px solid rgb(255 250 243 / 32%);
    border-radius: 50%;
    background: rgb(255 250 243 / 10%);
    color: var(--darseys-ivory);

    .icon-block--size-style {
      display: grid;
      place-items: center;
      width: 22px;
    }

    svg {
      width: 100%;
      height: auto;
    }
  }

  h3 {
    color: var(--darseys-ivory);
    font-size: clamp(1.5rem, 1.4vw, 1.8rem);
    line-height: 1.25;
  }

  p {
    color: #f7e5e8;
    overflow-wrap: anywhere;
  }

  p a {
    display: inline-block;
    min-block-size: 44px;
    color: var(--darseys-ivory);
    text-underline-offset: 0.2em;

    &:focus-visible {
      outline: 2px solid var(--darseys-ivory);
      outline-offset: 2px;
    }
  }
}
