/*
* Book preview
*/

#ssgs-bookpreview canvas {
  padding-bottom: 10px;
  width: 100%;
  height: 100%;
}


.book-preview-btn {
  cursor: pointer;
}

/* @media only screen and (min-width: 40em) { */
.ssgs-modal-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999999;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  backface-visibility: hidden;
  transition: opacity 0.6s cubic-bezier(0.55, 0, 0.1, 1), visibility 0.6s cubic-bezier(0.55, 0, 0.1, 1);
}

.ssgs-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* } */

.ssgs-last-page {
  background-color: rgba(252, 252, 229, 0.973);
  border-color: rgb(180, 180, 73);
  color: rgb(63, 63, 57);
  display: block;
  padding: 10px;
}

.ssgs-not-last-page {
  display: none;
}

/**
   * ssgs-modal
   */
.ssgs-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto;
  background-color: transparent;
  width: 600px;
  max-width: 75rem;
  opacity: 0;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  margin: 20px 0;
  visibility: hidden;
  z-index: 99999999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  backface-visibility: hidden;
  transform: scale(1.2);
  transition: all 0.6s cubic-bezier(0.55, 0, 0.1, 1);
}

.ssgs-modal .close-ssgs-modal {
  color: #FFF;
  cursor: pointer;
  right: 15px;
  opacity: 0;
  backface-visibility: hidden;
}

.ssgs-modal-footer {
  height: 50px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  position: sticky;
  bottom: 0;
  background-color: white;
  z-index: 9999999;
  align-items: center;
}

.ssgs-modal-footer-text {
  height: 50px;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background-color: white;
  z-index: 9999999;
  align-items: center;
  padding: 0 10px;
}

.ssgs-modal-header {
  height: 50px;
  position: sticky;
  top: 0;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 5px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ssgs-modal-nav {
  display: flex;
  justify-content: space-between;
  width: fit-content;
}

.ssgs-modal-nav nav {
  display: flex;
  align-items: center;
  margin-right: 40px;
}

.ssgs-modal-nav nav .ssgs-button {
  border: 1px solid #f6f8fe !important;
  margin-right: 2px;
}

.ssgs-modal .ssgs-modal-content {
  opacity: 0;
  backface-visibility: hidden;
  transition: opacity 0.6s cubic-bezier(0.55, 0, 0.1, 1);
  transition-delay: 0.3s;
  height: 100vh;
}

.ssgs-modal.active {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
}

.ssgs-modal.active .ssgs-modal-content {
  opacity: 1;
}

.ssgs-modal.active .close-ssgs-modal {
  opacity: 1;
}

.ssgs-modal-body {
  padding: 10px 20px;
}

.ssgs-modal-body-text {
  padding: 10px 20px;
  height: 100vh;
}

/**
   * Mobile styling
   */
@media only screen and (max-width: 39.9375em) {
  h1 {
    font-size: 1.5rem;
  }

  .ssgs-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    transform: scale(1.1);
    padding: 0 !important;
    margin: 0;
  }

  .close-ssgs-modal {
    right: 20px !important;
  }

  .ssgs-modal-footer {
    position: fixed;
    bottom: 0;
  }
}

.overflow-hidden {
  overflow: hidden;
}

.ssgs-collapse-content {
  max-height: 0;
  overflow: hidden;
  width: fit-content;
  bottom: 55px;
  background: white;
  right: 10px;
  position: absolute;
  transition: max-height 0.3s ease-in-out;
  /* Transition for smooth expand/ssgs-collapse */
}

.ssgs-collapse-button {
  cursor: pointer;
}

.ssgs-collapse-button-text {
  cursor: pointer;
  margin-right: 40px;
}

.ssgs-collapse-content-text {
  max-height: 0;
  overflow: hidden;
  width: fit-content;
  top: 55px;
  background: white;
  right: 10px;
  position: absolute;
  transition: max-height 0.3s ease-in-out;
  /* Transition for smooth expand/ssgs-collapse */
}

/* --------------------------------------------------
   * Product Video Overlay (moved from inline styles)
   * -------------------------------------------------- */
#mpod-ssgs-video-overlay {
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 2vw;
}

#mpod-ssgs-video-overlay .inner {
  position: relative;
  width: 96vw;
  max-width: 160vh;
  /* allow taller utilization on wide screens */
  aspect-ratio: 16 / 9;
  max-height: 96vh;
}

#mpod-ssgs-video-overlay .inner iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#mpod-ssgs-video-overlay .mpod-ssgs-close {
  position: absolute;
  right: 8px;
  top: 8px;
  background: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.mpod-ssgs-video-thumb {
  display: inline-block;
  margin-right: 6px;
  cursor: pointer;
}

.mpod-ssgs-video-thumb img {
  display: block;
  max-width: 100%;
  height: auto;
}

@supports not (aspect-ratio: 16/9) {
  #mpod-ssgs-video-overlay .inner {
    width: 96vw;
    max-width: 160vh;
  }

  #mpod-ssgs-video-overlay .inner:before {
    content: '';
    display: block;
    padding-top: 56.25%;
    /* fallback 16:9 */
  }

  #mpod-ssgs-video-overlay .inner iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 768px) {
  #mpod-ssgs-video-overlay .inner {
    width: 100vw;
    max-height: 100vh;
  }
}

/* Play badge over video thumbnail (gallery or thumb strip) */
.mpod-ssgs-video-thumb,
.mpod-ssgs-is-video-thumb {
  position: relative;
  cursor: pointer;
}

.mpod-ssgs-is-video-thumb img,
.mpod-ssgs-video-thumb img,
.nasa-item-main-image-wrap .mpod-ssgs-is-video-thumb img {
  cursor: pointer;
}

.mpod-ssgs-video-thumb .mpod-ssgs-play-badge,
.mpod-ssgs-is-video-thumb .mpod-ssgs-play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  z-index: 100;
}

.mpod-ssgs-video-thumb .mpod-ssgs-play-badge:before,
.mpod-ssgs-is-video-thumb .mpod-ssgs-play-badge:before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
}

/* Ensure gallery video slide can host badge overlay */
.woocommerce-product-gallery__image.mpod-ssgs-video {
  position: relative;
}

.woocommerce-product-gallery__image.mpod-ssgs-video .mpod-ssgs-play-badge {
  pointer-events: none;
}

/* --------------------------------------------------
   * Gift Wrap Section Styling
   * -------------------------------------------------- */
.mpod-gift-wrap-section {
  margin-top: 20px;
  padding: 20px;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.mpod-gift-wrap-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.2em;
  color: #333;
}

.mpod-gift-wrap-content {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.mpod-gift-wrap-image img {
  max-width: 100px;
  height: auto;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.mpod-gift-wrap-details {
  flex: 1;
  min-width: 200px;
}

.mpod-gift-wrap-action {
  margin-left: auto;
}

.mpod-add-gift-wrap,
.mpod-remove-gift-wrap {
  padding: 12px 24px;
  font-size: 1em;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mpod-add-gift-wrap:disabled,
.mpod-remove-gift-wrap:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.mpod-gift-wrap-message {
  margin-top: 10px;
  padding: 10px;
  border-radius: 3px;
  background: #fff;
}

.mpod-gift-wrap-message p {
  margin: 0;
}

/* Mobile responsive */
@media only screen and (max-width: 768px) {
  .mpod-gift-wrap-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .mpod-gift-wrap-action {
    margin-left: 0;
    width: 100%;
  }

  .mpod-add-gift-wrap,
  .mpod-remove-gift-wrap {
    width: 100%;
  }

  .mpod-gift-wrap-image {
    width: 100%;
    text-align: center;
  }

  .mpod-gift-wrap-image img {
    max-width: 150px;
  }
}