/* =========================================================
   Flavor Guide - Product Detail Component
   Desktop-first layout for [fg_product_detail] output.
   ========================================================= */

.fg-product-detail {
  --fg-detail-type-size-desktop: 1.2rem;

  display: grid;
  gap: var(--wp--preset--spacing--fg-24);
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg-text-primary);
}

.fg-product-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 60px; /*var(--wp--preset--spacing--fg-24);*/
  width: 100%;
  align-items: start;
}

/* ---------------------------------------------------------
   Left column media
   --------------------------------------------------------- */
.fg-product-detail__media {
  display: grid;
  gap: var(--wp--preset--spacing--fg-16);
  align-content: start;
  padding-top: 6px;
}

.fg-product-detail__primary-image {
  display: block;
  width: 100%;
  min-height: 420px;
  object-fit: contain;
  object-position: center;
  padding: 8px; /*var(--wp--preset--spacing--fg-12);*/
  border-radius: 14px;
  background: var(--fg-text-reverse);
}

.fg-product-detail__gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr)); /*repeat(auto-fit, minmax(130px, 1fr));*/
  column-gap: 40px;
  row-gap: 24px;
}

.fg-product-detail__gallery-item {
  margin: 0;
}

.fg-product-detail__gallery-image {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 10px;
  background: var(--fg-text-reverse);
  padding: var(--wp--preset--spacing--fg-8);
}

/* ---------------------------------------------------------
   Right column: single vertical stack
   --------------------------------------------------------- */
.fg-product-detail__right-column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 26px;
}

.fg-product-detail__header {
  display: grid;
  gap: var(--wp--preset--spacing--fg-8);
}

.fg-product-detail .fg-product-card__title_inner {
    font-size: 0.7em;
}

.fg-product-detail__module {
    width: min(385px, 31.937vw);
}

.fg-product-detail__title,
.fg-product-detail__brand,
.fg-product-detail__buy {
  margin: 0;
}

.fg-product-detail__buy {
    font-family: var(--fg-font-body);
    font-size: var(--fg-size-body-lg);
    text-align: center;
}

.fg-product-detail__title {
  display: block;
  align-items: baseline;
  flex-wrap: wrap;
  align-items: center;
  line-height: 1;
}

.fg-product-detail__brand,
.fg-product-detail__brand a,
.fg-product-detail__brand a:visited {
    font-family: var(--fg-font-title);
    line-height: var(--fg-lh-tight);
}

.fg-product-detail__brand a,
.fg-product-detail__buy-link {
  text-decoration: underline;
}

.fg-product-detail__buy-link {
  display: inline;
  font-style: italic;
}

.fg-product-detail__brand a:focus-visible,
.fg-product-detail__buy-link:focus-visible {
  outline: 3px solid var(--fg-data);
  outline-offset: 2px;
  border-radius: 4px;
}

.fg-product-detail .fg-product-card__section-title,
.fg-product-detail .fg-product-detail__section-title,
.fg-product-detail .fg-flavor-graph__label,
.fg-product-detail .fg-flavor-graph__value {
    font-size: var(--fg-detail-type-size-desktop);
}

.fg-product-detail .fg-product-card__awesome-label {
    font-size: 1.1rem;
}

.fg-product-detail .fg-product-card__section-title,
.fg-product-detail .fg-product-detail__section-title {
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.4rem;
}

.fg-product-detail__reviews .fg-product-detail__section-title {
    margin-bottom: -8px;
}

/* ---------------------------------------------------------
   Detail-only Awesome On layout
   Keep all overrides scoped to fg-product-detail so shared
   component CSS remains untouched elsewhere.
   --------------------------------------------------------- */

.fg-product-detail .fg-product-card__awesome {
  display: grid;
  justify-items: center;
  max-width: unset !important;
}

.fg-product-detail .fg-product-card__awesome-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;

  display: grid;
  grid-template-columns: repeat(2, 80px);
  gap: 21.5px;

  width: max-content;
  max-width: 100%;
  justify-content: center;
}

.fg-product-detail .fg-product-card__awesome-item {
  width: 70px;
  height: 62px;
  grid-template-rows: 40px;
  justify-self: stretch;
}

/* Wide enough for a single-row layout */
@media (min-width: 1080px) {
  /* Exactly 3 items */
  .fg-product-detail .fg-product-card__awesome-list:has(> .fg-product-card__awesome-item:nth-child(3)):not(:has(> .fg-product-card__awesome-item:nth-child(4))) {
    grid-template-columns: repeat(3, 80px);
  }

  /* 4 or more items */
  .fg-product-detail .fg-product-card__awesome-list:has(> .fg-product-card__awesome-item:nth-child(4)) {
    grid-template-columns: repeat(4, 80px);
  }
}

/*.fg-product-detail .fg-product-card__awesome {
    max-width: unset!important;
}

.fg-product-detail .fg-product-card__awesome-list {
    justify-content: start;
    flex-wrap: wrap;
    gap: 21.5px;
}

.fg-product-detail .fg-product-card__awesome-item {
    width: 70px;
    height: 62px;
    grid-template-rows: 40px;
}*/


.fg-product-detail .fg-flavor-graph {
  grid-area: auto;
}

.fg-product-detail .fg-flavor-graph__rows {
  margin: 0;
  max-width: none;
  gap: 14px;
}

.fg-product-detail .fg-flavor-graph__axis {
    grid-template-columns: 69px 19px 1fr;
    /*column-gap: 18px;*/
}

.fg-product-detail .fg-flavor-graph__tick {
    /*height: 30px;*/
}

/* ---------------------------------------------------------
   Reviews + awards
   --------------------------------------------------------- */
.fg-product-detail__reviews {
  display: grid;
  gap: 18px;
}

.fg-product-detail__review {
  display: grid;
  grid-template-columns: minmax(auto, auto) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.fg-product-detail__review-byline {
  display: grid;
  /*grid-template-columns: 60px 1fr;*/
  grid-template-rows: 1fr;
  gap: var(--wp--preset--spacing--fg-8);
  align-items: center;
  margin-bottom: 14px;
  padding-top: 6px;
}

.fg-product-detail__review-mugshot {
  width: 88px;
  height: 110px;
  border-radius: 8px;
  background-color: var(--fg-system-substrate);
  background-size: cover;
  background-position: center;
}

.fg-product-detail__review-mugshot img {
    width: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.fg-product-detail__review-byline-text,
.fg-product-detail__review-title,
.fg-product-detail__review-name,
.fg-product-detail__review-body {
  margin: 0;
}

.fg-product-detail__review-title {
  font-family: var(--fg-font-title);
  font-size: var(--fg-size-photo-label);
  font-weight: 500;
  /*line-height: var(--fg-lh-tight);*/
  text-transform: uppercase;
}

.fg-product-detail__review-byline-text {
    max-width: 80px;
}

.fg-product-detail__review-name {
  font-family: var(--fg-font-title);
  font-size: var(--fg-size-status);
  /*color: var(--fg-meta-ink);*/
}

.fg-product-detail__review-body {
  font-family: var(--fg-font-body);
  font-size: var(--fg-size-body);
  line-height: 1.45;
}

.fg-product-detail__awards-list {
  margin: 0;
  padding-left: 0;
  font-size: 1rem;
  display: flex;
  justify-content: center;
  list-style: none;
  flex-wrap: wrap;
}

.fg-product-detail__award-item {
  margin: 0 0 var(--wp--preset--spacing--fg-8);
  text-align: center;
}

.fg-product-detail__award-item::before {
}

.fg-product-detail .mobile {
    display: none;
}

/* ---------------------------------------------------------
   Responsive guard rails (mobile/tablet fallback only)
   --------------------------------------------------------- */
@media (max-width: 767px) {
  .fg-product-detail__layout {
    grid-template-columns: 1fr;
  }

  .fg-product-detail__right-column {
    gap: 30px;
  }

  .fg-product-detail__layout {
      gap: 20px;
  }

    .fg-product-detail__gallery-image,
    .fg-product-detail__primary-image {
        min-height: auto;
        width: calc(100% - 16px); /* To account for the padding used to make the image not touch the edge */
    }

  .fg-product-detail .desktop {
      display: none;
  }
  .fg-product-detail .mobile {
      display: block;
  }

  .fg-product-detail__gallery.mobile {
      display: grid;
      gap: 20px;
      grid-template-columns: 100%;
  }

  .fg-product-detail__review {
    /*grid-template-columns: 1fr;*/
    gap: 20px;
  }

  .fg-product-detail__module {
      width: unset;
  }

    .fg-product-detail__module--awesome-on {
        max-width: 165px;
    }

    .fg-detail__awesome-bottle {
        display: flex;
        gap: 20px;
        justify-content: center;
    }

    .fg-product-detail .fg-product-card__awesome-list {
        grid-template-columns: repeat(2, 74px);
        gap: 14px;
        width: max-content;
        max-width: 182px;
        margin: 0 auto;
    }

    .fg-product-detail .fg-product-card__awesome-item {
        width: 64px;
        height: 54px;
        grid-template-rows: 37px;
    }

    .fg-detail__awesome-bottle .fg-product-card__image-well {
        width: 140px;
    }
  
  /*.fg-product-detail__module--awesome-on {
      max-width: 165px;
  }

  .fg-detail__awesome-bottle {
      display: flex;
      gap: 20px;
      justify-content: center;
  }

  .fg-product-detail .fg-product-card__awesome-list {
      gap: 14px;
      justify-content: space-between;
      max-width: 182px;
      margin: 0 auto;
  }

  .fg-product-detail .fg-product-card__awesome-item {
      width: 64px;
      height: 54px;
      grid-template-rows: 37px;
  }*/

  .fg-detail__awesome-bottle .fg-product-card__image-well {
      width: 140px;
  }

  /*.fg-product-detail .fg-product-card__section-title,
  .fg-product-detail .fg-product-detail__section-title,
  .fg-product-detail .fg-flavor-graph__label,
  .fg-product-detail .fg-flavor-graph__value,
  .fg-product-detail .fg-product-card__awesome-label,
  .fg-product-detail__title,
  .fg-product-detail__brand {
    font-size: var(--fg-size-body);
  }*/
}
