/* ============================================================================
   Goodnessline — product page sections

   Colours follow the theme's own --primary custom property, so everything here
   changes with the store's colour in the theme settings.
   ============================================================================ */

:root {
  --gl-accent: var(--primary, #c6a87a);
  --gl-text: #1a1a1a;
  --gl-muted: #6b6b6b;
  --gl-line: #e7e2da;
  --gl-soft: #faf7f2;
  --gl-ok: #1e7b4a;
  --gl-warn: #b4441e;
}

.gl-assurance {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 16px 0 4px;
  color: var(--gl-text);
  font-size: 14px;
}

/* ---------------------------------------------------------- delivery checker */

.gl-delivery__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-weight: 600;
}

.gl-delivery__form {
  display: flex;
  max-width: 360px;
  border: 1px solid var(--gl-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.gl-delivery__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  font-size: 14px;
  letter-spacing: .08em;
  outline: none;
}

.gl-delivery__button {
  flex: 0 0 auto;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: var(--gl-accent);
  font-weight: 600;
  cursor: pointer;
}

.gl-delivery__button:disabled { opacity: .6; cursor: progress; }

.gl-delivery__result:empty { display: none; }

.gl-delivery__result {
  margin-top: 8px;
  line-height: 1.5;
}

.gl-delivery__result .gl-ok { color: var(--gl-ok); font-weight: 600; }
.gl-delivery__result .gl-warn { color: var(--gl-warn); }
.gl-delivery__result .gl-sub { display: block; color: var(--gl-muted); font-size: 13px; }

/* -------------------------------------------------------------------- offers */

.gl-offers {
  padding: 12px 14px;
  border: 1px dashed var(--gl-accent);
  border-radius: 8px;
  background: var(--gl-soft);
}

.gl-offers__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-weight: 600;
}

.gl-offers__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gl-offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gl-offer__code {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--gl-accent);
  border-radius: 6px;
  background: #fff;
  color: var(--gl-text);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
}

.gl-offer__code.is-copied { border-color: var(--gl-ok); color: var(--gl-ok); }

/* -------------------------------------------------------------- trust badges */

.gl-trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px 6px;
  border-top: 1px solid var(--gl-line);
  border-bottom: 1px solid var(--gl-line);
  list-style: none;
}

.gl-trust__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.gl-trust__icon {
  margin-bottom: 4px;
  color: var(--gl-accent);
  font-size: 24px;
  line-height: 1;
}

.gl-trust__title { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.gl-trust__subtitle { color: var(--gl-muted); font-size: 11.5px; line-height: 1.3; }

@media (max-width: 575.98px) {
  .gl-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
}

/* ------------------------------------------------- returns line and payments */

.gl-returns {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--gl-muted);
  font-size: 13px;
}

.gl-returns a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.gl-payments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.gl-payments__label { margin-right: 2px; color: var(--gl-muted); font-size: 12.5px; }

.gl-payments__badge {
  padding: 3px 8px;
  border: 1px solid var(--gl-line);
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* --------------------------------------------------------------- model info */

.gl-model-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 12px;
  color: var(--gl-muted);
  font-size: 13px;
}

/* ---------------------------------------------------------------- size guide */

.gl-size-link {
  margin-left: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gl-accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.gl-size-guide {
  /* The theme's CSS reset zeroes margins, which takes away the browser's own centring of a dialog. */
  margin: auto;
  width: min(640px, 94vw);
  max-height: 86vh;
  padding: 0;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.gl-size-guide::backdrop { background: rgba(0, 0, 0, .45); }

.gl-size-guide__header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gl-line);
  background: #fff;
}

.gl-size-guide__title { margin: 0; font-size: 18px; }

.gl-size-guide__close {
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.gl-size-guide__body { padding: 16px 18px 20px; overflow-x: auto; font-size: 14px; }

.gl-size-guide__body table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }

.gl-size-guide__body th,
.gl-size-guide__body td {
  padding: 8px 10px;
  border: 1px solid var(--gl-line);
  text-align: center;
  white-space: nowrap;
}

.gl-size-guide__body th { background: var(--gl-soft); font-weight: 600; }

/* ----------------------------------------------------- expandable sections */

.gl-sections {
  margin: 18px 0 8px;
  border-top: 1px solid var(--gl-line);
}

.gl-section { border-bottom: 1px solid var(--gl-line); }

.gl-section__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 2px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.gl-section__title::-webkit-details-marker { display: none; }

.gl-section__title::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.gl-section[open] > .gl-section__title::after { transform: rotate(-135deg); }

.gl-section__list { margin: 0 0 14px; padding-left: 18px; line-height: 1.7; }
.gl-section__text { margin: 0 0 14px; line-height: 1.6; color: #333; }

.gl-faq { margin: 0 0 14px; }
.gl-faq dt { margin-top: 10px; font-weight: 600; }
.gl-faq dd { margin: 4px 0 0; color: #444; line-height: 1.6; }

/* ------------------------------------------------- phone photo slider */

/* Below the md breakpoint the theme lays the photos out as a grid, which puts the
   price and Add to cart a long scroll down. There they become a slider instead:
   one photo per screen width, swiped sideways, with dots underneath. */
@media (max-width: 767.98px) {
  .picture-gallery:has(.gl-swipe-marker) .picture-grid {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .picture-gallery:has(.gl-swipe-marker) .picture-grid::-webkit-scrollbar { display: none; }

  .picture-gallery:has(.gl-swipe-marker) .picture-grid__item {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
  }

  .picture-gallery:has(.gl-swipe-marker) .picture-grid__show-all { display: none !important; }

  .gl-gallery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 2px;
  }

  .gl-gallery-dots button {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d6d0c6;
    transition: width .2s ease, background .2s ease;
  }

  .gl-gallery-dots button.is-active {
    width: 18px;
    border-radius: 4px;
    background: var(--gl-accent);
  }
}

@media (min-width: 768px) {
  .gl-gallery-dots { display: none; }
}

/* ------------------------------------------------------------ review slider */

/* The theme stacks every review full width; here they become cards in a row,
   swiped sideways, so the section is the height of one card. */
#review-items-container.gl-review-slider {
  display: flex !important;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

#review-items-container.gl-review-slider .product-review-item {
  display: block !important;
  flex: 0 0 86%;
  margin: 0 !important;
  padding: 16px !important;
  border: 1px solid var(--gl-line);
  border-radius: 8px;
  background: #fff;
  scroll-snap-align: start;
}

#review-items-container.gl-review-slider .product-review-item + .product-review-item { border-top: 1px solid var(--gl-line); }

@media (min-width: 768px) {
  #review-items-container.gl-review-slider .product-review-item { flex-basis: calc(50% - 6px); }
}

.gl-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gl-clamp.is-open { display: block; -webkit-line-clamp: unset; }

.gl-read-more {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gl-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.gl-slider-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.gl-slider-nav { display: flex; gap: 6px; }

.gl-slider-nav button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--gl-line);
  border-radius: 50%;
  background: #fff;
  color: var(--gl-text);
  font-size: 18px;
  cursor: pointer;
}

.gl-slider-nav button:hover { border-color: var(--gl-accent); color: var(--gl-accent); }

/* ------------------------------------------------ folded review form */

#review-form.gl-collapsed form { display: none; }

#review-form.gl-form-ready > .title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

#review-form.gl-form-ready > .title::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-135deg);
  transition: transform .2s ease;
}

#review-form.gl-form-ready.gl-collapsed > .title::after { transform: rotate(45deg); }

/* ------------------------------------------------ photo uploads */

.gl-upload { margin: 14px 0 6px; }

.gl-upload__label { display: block; margin-bottom: 8px; font-weight: 600; }

.gl-upload__row { display: flex; flex-wrap: wrap; gap: 8px; }

.gl-upload__item,
.gl-upload__add {
  position: relative;
  width: 76px;
  height: 92px;
  border-radius: 6px;
  overflow: hidden;
}

.gl-upload__item { border: 1px solid var(--gl-line); background: var(--gl-soft); }

.gl-upload__item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gl-upload__item button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 15px;
  line-height: 22px;
  cursor: pointer;
}

.gl-upload__item.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--gl-accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: gl-spin .7s linear infinite;
}

@keyframes gl-spin { to { transform: rotate(360deg); } }

.gl-upload__add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px dashed var(--gl-accent);
  background: #fff;
  color: var(--gl-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.gl-upload__add i { font-size: 22px; }

.gl-upload__add[hidden] { display: none; }

.gl-upload__hint { display: block; margin-top: 6px; color: var(--gl-muted); font-size: 12px; }

.gl-upload__error { color: var(--gl-warn); font-size: 13px; }

.gl-upload__error:empty { display: none; }

/* ------------------------------------------------ review photos */

.gl-review-photos { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }

.gl-photo {
  display: block;
  width: 64px;
  height: 78px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--gl-soft);
}

.gl-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }

.gl-photo:hover img { transform: scale(1.06); }

.gl-customer-photos { margin: 0 0 18px; }

.gl-customer-photos__title { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-weight: 600; }

.gl-customer-photos__row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.gl-customer-photos__row::-webkit-scrollbar { display: none; }

.gl-customer-photos__row .gl-photo { flex: 0 0 auto; width: 84px; height: 104px; }

@media (prefers-reduced-motion: reduce) {
  .gl-upload__item.is-loading::after { animation: none; }
}

/* ------------------------------------------------------------ offer slider */

.gl-offer-slider { margin: 4px 0 18px; }

.gl-offer-slider__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.gl-offer-slider__track::-webkit-scrollbar { display: none; }

.gl-offer-card {
  position: relative;
  flex: 0 0 min(270px, 78%);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 82px;
  padding: 12px 14px;
  border: 1px dashed color-mix(in srgb, var(--gl-accent) 70%, transparent);
  border-radius: 8px;
  background: var(--gl-soft);
  scroll-snap-align: start;
}

.gl-offer-card__body { flex: 1 1 auto; min-width: 0; }

.gl-offer-card__title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--gl-text);
}

.gl-offer-card__text { margin-top: 3px; color: #555; font-size: 12.5px; line-height: 1.4; }

.gl-offer-card .gl-offer__code { margin-top: 8px; }

.gl-offer-card__badge {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gl-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.gl-offer-card--image { padding: 0; overflow: hidden; border-style: solid; }

.gl-offer-card--image img { width: 100%; height: 100%; min-height: 82px; object-fit: cover; display: block; }

.gl-offer__code--float { position: absolute; right: 8px; bottom: 8px; }

.gl-offer-slider__progress {
  position: relative;
  height: 2px;
  margin-top: 10px;
  border-radius: 2px;
  background: var(--gl-line);
}

.gl-offer-slider__progress span {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--gl-accent);
}

.gl-offer-slider.is-static .gl-offer-slider__progress { display: none; }

/* A single offer takes the full width rather than looking like a cut-off slider. */
.gl-offer-slider__track > .gl-offer-card:only-child { flex-basis: 100%; }

/* ------------------------------------------------------------ ready to ship */

.gl-ready {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--gl-accent) 10%, #fff);
}

.gl-ready__head { display: flex; align-items: flex-start; gap: 10px; }

.gl-ready__icon { color: var(--gl-accent); font-size: 20px; line-height: 1.2; }

.gl-ready__title { font-size: 13.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }

.gl-ready__text { margin-top: 1px; color: #555; font-size: 12.5px; }

.gl-ready__promise {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px dashed color-mix(in srgb, var(--gl-accent) 60%, transparent);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.gl-ready__promise i { color: var(--gl-accent); font-size: 16px; }

.gl-ready__countdown { color: #b4441e; font-variant-numeric: tabular-nums; }

.gl-ready__date { color: var(--gl-ok); }

/* ---------------------------------------------------- single-choice options */

.attributes .gl-single-choice { display: none !important; }
