/* ProductPage.css
   Styles for the product page UI.
   Extracted from ProductPage.html to separate structure (HTML) from presentation (CSS).
*/

@import "tailwindcss";
@import "basecoat-css";
@import "./theme.css";

/* =========================
   Color palette and theme variables
   Note: use :root (not ::root) so CSS variables apply correctly.
   ========================= */
:root {
  --border-color: #464749;
  --background-color: #ffffff;
  --text-color: #111827;
  --text-color-muted: #6b7280;
  --card-background: #f9fafb;
  --yellow-background: #fefce8;
  --yellow-border: #fef08a;
  --yellow-text: #854d0e;
  --blue-background: rgb(0, 150, 150);
  --blue-border: #bfdbfe;
  --blue-text: #1e40af;
  --max-width: 1170px;

  /* Standard "Gumroad-like" radius. */
  --box-border-radius: 6px;

  /* Link color. */
  --link-color: #000000;
}

/* =========================
   Sticky top banner
   ========================= */
.sticky-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: white;
  color: black;
  z-index: 1000;
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s ease;
  border-bottom: 1.2px solid var(--border-color);
}

.sticky-banner.visible {
  transform: translateY(0);
  opacity: 1;
}

.sticky-banner-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
}

/* The text inside the price tag. */
.sticky-price-value {
  fill: white;
  font-size: 2.3rem;
  font-weight: 400;
  font-family: "Inter", sans-serif;
  /* Text anchor: middle */
  text-anchor: middle;
}

/* The 'flag.' */
.sticky-price-background {
  fill: var(--blue-background);
  stroke: #000;
  stroke-width: 2;
}

/* Flex should be horizontal. the ratings should be on the right and the title on the left. */
.sticky-product-info {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.sticky-title {
  font-size: 1.3rem;
  font-weight: 400;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticky-ratings {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  padding: 0rem 1rem;
}

.stars {
  color: #fbbf24;
}

.rating-text {
  opacity: 0.9;
}

@media (max-width: 768px) {
  .sticky-banner {
    padding: 0.75rem 1rem;
  }

  .sticky-banner-content {
    gap: 1rem;
  }

  .sticky-title {
    font-size: 1rem;
  }
}

/* Responsive styles for screens narrower than 1000px */
@media (max-width: 1000px) {
  .sticky-banner {
    top: auto;
    bottom: 0;
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    transform: translateY(100%);
  }

  .sticky-banner.visible {
    transform: translateY(0);
  }

  .sticky-title,
  .sticky-ratings {
    display: none;
  }
}

/* Tiny screen styles (<=480px) */
@media (max-width: 480px) {
  .media-content:nth-child(n + 2) {
    display: none;
  }

  .media-indicators,
  .media-nav {
    display: none;
  }

  .sticky-banner {
    padding: 12px 16px;
  }

  .sticky-banner .convertkit-button .payhip-buy-button {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* =========================
   Base reset and typography
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

/* Reset padding for most elements but preserve button styling */
body,
div,
section,
article,
aside,
header,
footer,
nav,
main,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li,
dl,
dt,
dd,
form,
fieldset,
legend,
table,
caption,
thead,
tbody,
tfoot,
tr,
th,
td {
  padding: 0;
}
body {
  font-family: "Inter", sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
}
@media (min-width: 1024px) {
  main {
    padding-top: 8rem;
  }
}

/* =========================
   Layout containers
   - page-content-wrapper draws vertical page borders
   - product-layout defines the 1/2 column layout
   ========================= */
.page-content-wrapper {
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  /* This ensures the top of the page-content-wrapper is rounded. */
  border-bottom-right-radius: 6px;
  border-bottom-left-radius: 6px;
  border-top-right-radius: 6px;
  border-top-left-radius: 6px;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .product-layout {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 0; /* Remove gap for border */
    /* border-top: 1px solid var(--border-color); */
  }
}

/* =========================
   Header Video Player
   ========================= */
.video-player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  overflow: hidden;
  /* border-top: 1px solid var(--border-color); */
  border-top-right-radius: 6px;
  border-top-left-radius: 6px;
}

.video-player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Media navigation arrows */
.media-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.9);
  color: #000;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .media-nav-arrow,
  .media-indicators {
    display: none;
  }
}

.media-nav-arrow:hover {
  background-color: white;
  transform: translateY(-50%) scale(1.05);
}

.media-nav-left {
  left: 1rem;
}

.media-nav-right {
  right: 1rem;
}

/* Media indicator dots */
.media-indicators {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

@media (max-width: 768px) {
  .media-indicators {
    display: none;
  }
}

.media-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.media-indicator.active {
  background-color: white;
}

.media-indicator:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

/* Media content (for image display) */
.media-content {
  width: 100%;
  height: 100%;
  display: none;
}

.media-content.active {
  display: block;
}

.media-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================
   Product details column (left)
   ========================= */
.product-details {
  padding-bottom: 1rem;
}

.product-details-line {
  border-top: 1px solid var(--border-color);
  padding: 0;
}

@media (min-width: 1024px) {
  .product-details {
    border-right: 1px solid var(--border-color);
  }
}
.product-title-section {
  margin: 2rem;
}
.product-title {
  font-size: 2.5rem;
  line-height: 1.2;
  font-weight: 400;
}

#product-description {
  margin: 2rem;
}

/* Contains the "Infima Games" and "19 ratings" text. The entire line. */
.seller-and-ratings-section {
  display: flex;
  justify-content: left;
  align-items: center;
}

.review-section-content {
  padding-left: 1rem;
  font-size: 1rem;
}

.seller-info-section {
  display: inline-block;
  border-right: 1px solid var(--border-color);
  padding: 1rem;
}
.seller-info {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.seller-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}
.seller-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color);
  text-decoration: underline;
}

/* Rich text styling (Markdown output area)
   - Headings sized/weighted to create hierarchy
   - Spacing for paragraphs and lists for readability
*/
.rich-text {
  color: var(--text-color);
}

.rich-text strong {
  font-weight: 700;
}
.rich-text a {
  color: var(--link-color);
  text-decoration: underline;
}
.rich-text h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 1.25rem 0 1rem;
}
.rich-text h2 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 1rem 0 1rem;
}
.rich-text h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0.75rem 0 1rem;
}
.rich-text p {
  margin: 0.5rem 0 1rem;
}
.rich-text ul,
.rich-text ol {
  margin: 0.5rem 0 1rem 3rem;
}
.rich-text ul {
  list-style: disc;
}
.rich-text ol {
  list-style: decimal;
}
.rich-text li {
  margin: 1rem 0;
}

/* Ensures the images are responsive. */
.rich-text img {
  max-width: 100%;
  height: auto;
  border-radius: var(--box-border-radius);
}

/* =========================
   Content section separators
   ========================= */
.content-section {
  margin-top: 1.5rem;
  margin-left: 1rem;
  margin-right: 1rem;
  /* border-top: 1px solid var(--border-color); */
}
/* Remove top border from the first content section under the title */
.product-title-section + .content-section {
  margin-top: 0;
  padding-top: 1.5rem;
  border-top: none;
}

/* Review images styling */
.review-images {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.review-image {
  width: 100%;
  height: auto;
  border-radius: var(--box-border-radius);
}

/* =========================
   Sidebar (right)
   ========================= */
.sidebar {
  font-size: 0.875rem;
}
@media (min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: 2rem;
    padding: 1rem;
    /* padding: 2rem 2rem 2rem 4rem; */
  }
}
.sidebar > * + * {
  margin-top: 1rem;
}

/* Info banners (availability/PPP notices) */
.info-banner {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--box-border-radius);
  border: 1px solid;
}
.info-banner.yellow {
  background-color: var(--yellow-background);
  border-color: var(--yellow-border);
  color: var(--yellow-text);
}
.info-banner.blue {
  background-color: var(--blue-background);
  border-color: var(--blue-border);
  color: var(--blue-text);
}
.info-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

/* Variant cards (pricing options) */
.variant-card {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 1.5rem;
  border-radius: var(--box-border-radius);
  border: 1px solid var(--border-color);
  background-color: rgb(0, 0, 0, 0.1);
  cursor: pointer;
  transition: border-color 0.2s ease;
  /* Box Shadow, no blur, black, 1 opacity, only right and bottom */
  box-shadow: 4px 4px 0px 0px black;
}
.variant-card.selected {
  /* border-color: #ffffff; */
}
.variant-card:hover {
  /* border-color: #666; */
}
.variant-price {
  color: var(--text-color);
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.3rem 1rem;
  border-radius: 50px;
  font-weight: 400;
  font-size: 1rem;
  white-space: nowrap;
  min-width: fit-content;
  box-shadow: none;
}
.variant-details {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  color: var(--text-color);
}
.variant-description {
  font-size: 1rem;
  color: var(--text-color);
  line-height: 1.5;
}

/* Detail boxes and lists (stats/features) */
.detail-box {
  /* margin: 1rem; */
  border-radius: var(--box-border-radius);
  border: 1px solid var(--border-color);
  background-color: white;
}
.detail-list .detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  font-weight: 700;
  color: var(--text-color);
}
.detail-list .detail-item + .detail-item {
  border-top: 1px solid var(--border-color);
}
.detail-list .detail-item span:last-child {
  font-weight: 400;
}
/* .detail-item span:first-child {
  color: var(--text-color-muted);
} */

/* Wishlist and share buttons */
.wishlist-button-group {
  display: flex;
}
.wishlist-button {
  flex-grow: 1;
  padding: calc(var(--spacing) * 3) calc(var(--spacing) * 4);
  border: 1px solid var(--border-color);
  background-color: #fff;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--spacing) * 2);
}
.wishlist-button:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
.wishlist-button:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-left-width: 0;
}

/* Primary action button */
.primary-action-button {
  width: 100%;
  padding: calc(var(--spacing) * 4) calc(var(--spacing) * 4);
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: 2px solid #000;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.primary-action-button:hover {
  background-color: #008080;
}

/* Guarantee link under actions */
.guarantee-link {
  display: block;
  text-align: center;
  color: var(--link-color);
  text-decoration: underline;
  font-size: 1rem;
  font-weight: 400;
}

.buy-now-button,
.sticky-buy-now-button {
  display: flex;
  justify-content: center;
  align-items: center;
  /* Max Width */
  max-width: 100%;
}

.buy-now-button .convertkit-button,
.sticky-buy-now-button .convertkit-button,
.buy-now-button .payhip-buy-button,
.sticky-buy-now-button .payhip-buy-button {
  border: 1.1px solid var(--border-color);
  width: 100%;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  color: white;
  background-color: #008080;
  transition-timing-function: ease-out;
  transition-duration: 0.14;
  transition-property: transform;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 2rem;
  text-decoration: none;
}

.buy-now-button .convertkit-button:hover,
.sticky-buy-now-button .convertkit-button:hover,
.buy-now-button .payhip-buy-button:hover,
.sticky-buy-now-button .payhip-buy-button:hover {
  transform: translate(-0.25rem, -0.25rem);
  box-shadow: 0.25rem 0.25rem 0rem rgb(var(--color));
  background-color: var(--blue-background);
}

.sticky-buy-now-button .convertkit-button,
.sticky-buy-now-button .payhip-buy-button {
  padding: 0.8rem 1.7rem;
}

/* Star rating */
.checked {
  color: orange;
}
