/*
 * MediRoyal — Single Product: trust strip, related products, sticky buy bar,
 * reveal animation, cart notice, bugfix/compat overrides.
 * Loaded conditionally on is_product() pages.
 */

/* Trust strip — 4-tile white card grid (matches reference's compact trust-strip) */
.log-single-product-page .log-promise-strip {
  max-width: 1320px;
  margin: 22px auto 0;
  padding: 0 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media(max-width:768px) {
  .log-single-product-page .log-promise-strip {
    grid-template-columns: 1fr 1fr;
    padding: 0 16px;
    gap: 10px;
  }
}

.log-single-product-page .log-ps-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  transition: box-shadow .2s;
}

.log-single-product-page .log-ps-item:hover {
  box-shadow: var(--shadow-sm);
}

.log-single-product-page .log-ps-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: var(--blush-100);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: transform .2s;
}

.log-single-product-page .log-ps-item:hover .log-ps-icon {
  transform: scale(1.1);
}

/* log_shop_promise_*_icon accepts inline SVG as well as emoji — the emoji
   sizes itself via font-size above, but an SVG needs explicit CSS
   dimensions. Color is left to the pasted SVG's own fill/stroke (a CSS
   fill property here would win over the SVG's own presentation attributes
   and break icons that intentionally use fill="none" + stroke). */
.log-single-product-page .log-ps-icon svg {
  width: 17px;
  height: 17px;
}

.log-single-product-page .log-ps-text h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-900);
  margin: 0 0 1px;
}

.log-single-product-page .log-ps-text p {
  font-size: 10.5px;
  color: var(--gray-600);
  margin: 0;
}

@media(max-width:480px) {
  .log-single-product-page .log-promise-strip {
    grid-template-columns: 1fr;
  }
}

/* Related products */
.log-single-product-page .log-sp-related {
  max-width: 1320px;
  margin: 0 auto;
  padding: 34px 48px 60px;
}

@media(max-width:768px) {
  .log-single-product-page .log-sp-related {
    padding: 26px 16px 46px;
  }
}

.log-single-product-page .log-sp-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.log-single-product-page .log-sp-sec-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sage-700);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.log-single-product-page .log-sp-sec-label::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--sage-600);
}

.log-single-product-page .log-sp-sec-title {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink-900);
}

.log-single-product-page .log-sp-sec-title em {
  font-style: italic;
  color: var(--plum-700);
}

.log-single-product-page .log-sp-view-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--plum-700);
  border-bottom: 1px dashed rgba(212, 175, 55, .35);
}

.log-single-product-page .log-sp-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media(max-width:1024px) {
  .log-single-product-page .log-sp-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.log-single-product-page .log-sp-rel-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all .25s var(--ease);
  display: block;
}

.log-single-product-page .log-sp-rel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.log-single-product-page .log-sp-rel-img {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  overflow: hidden;
}

/* Fills the box edge-to-edge, same as shop page's .log-prod-img-wrap img. */
.log-single-product-page .log-sp-rel-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.log-single-product-page .log-sp-rel-body {
  padding: 13px 15px;
}

.log-single-product-page .log-sp-rel-meta {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sage-700);
  margin-bottom: 4px;
}

.log-single-product-page .log-sp-rel-name {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
  color: var(--ink-900);
}

.log-single-product-page .log-sp-rel-price {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  color: var(--plum-700);
  margin-bottom: 10px;
}

.log-single-product-page .log-sp-rel-btn {
  display: block;
  text-align: center;
  width: 100%;
  padding: 9px;
  border-radius: var(--r-pill);
  background: var(--ink-900);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  transition: background .22s;
}

.log-single-product-page .log-sp-rel-btn:hover {
  background: var(--plum-700);
}

@media(max-width:600px) {
  .log-single-product-page .log-sp-related-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    scrollbar-width: none;
    grid-template-columns: none;
  }

  .log-single-product-page .log-sp-related-grid::-webkit-scrollbar {
    display: none;
  }

  .log-single-product-page .log-sp-rel-card {
    scroll-snap-align: start;
    min-width: 65vw;
    flex-shrink: 0;
  }
}

/* Sticky buy bar */
.log-single-product-page .log-sp-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 400;
  background: linear-gradient(90deg, var(--plum-950), var(--plum-900));
  border-top: 3px solid var(--sage-500);
  padding: 14px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  transform: translateY(110%);
  transition: transform .38s var(--ease);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .3);
}

.log-single-product-page .log-sp-sticky.visible {
  transform: translateY(0);
}

.log-single-product-page .log-sp-sb-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.log-single-product-page .log-sp-sb-name {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.log-single-product-page .log-sp-sb-price {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
  color: var(--sage-400);
  margin-top: 1px;
  display: block;
}

.log-single-product-page .log-sp-sb-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.log-single-product-page .log-sp-sb-add {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--plum-600), var(--plum-700));
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  transition: all .25s var(--ease);
  box-shadow: 0 8px 20px rgba(212, 175, 55, .35);
}

.log-single-product-page .log-sp-sb-add:hover {
  transform: translateY(-2px);
}

.log-single-product-page .log-sp-sb-buy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .35);
  font-weight: 800;
  font-size: 13px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all .25s var(--ease);
}

.log-single-product-page .log-sp-sb-buy:hover {
  background: rgba(255, 255, 255, .08);
  border-color: var(--sage-400);
  transform: translateY(-2px);
}

@media(max-width:600px) {
  .log-single-product-page .log-sp-sticky {
    padding: 1.5rem 14px;
    gap: 10px;
  }

  .log-single-product-page .log-sp-sb-name {
    font-size: 13.5px;
    max-width: 34vw;
  }

  .log-single-product-page .log-sp-sb-price {
    font-size: 16px;
  }

  .log-single-product-page .log-sp-sb-add,
  .log-single-product-page .log-sp-sb-buy {
    padding: 11px 14px;
    font-size: 12px;
  }
}

/* Reveal animation */
.log-single-product-page .log-sp-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}

.log-single-product-page .log-sp-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Add-to-cart toast — fixed below the sticky header (not bottom-anchored) so
   it never overlaps the sticky buy bar or back-to-top button, regardless of
   their heights at any viewport. */
.log-single-product-page .log-sp-toast {
  position: fixed;
  top: calc(var(--site-header-h, 84px) + 16px);
  left: 50%;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink-900);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-10px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}

.log-single-product-page .log-sp-toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.log-single-product-page .log-sp-toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage-400);
  flex-shrink: 0;
}

@media(max-width:480px) {
  .log-single-product-page .log-sp-toast {
    font-size: 12px;
    padding: 10px 16px;
    white-space: normal;
    text-align: center;
    max-width: calc(100vw - 32px);
  }
}

/* Hide default WC elements that MR replaces */
.log-single-product-page .woocommerce-breadcrumb,
.log-single-product-page .woocommerce-notices-wrapper,
.log-single-product-page .log-sticky-bar,
.log-single-product-page .product-title.product-above {
  display: none;
}

/* Kadence .site wrapper has white bg — force cream to match page background */
body.log-single-product-page .site {
  background: var(--paper-50);
}