/* =========================================
   SACRED PORTAL BANNER (FLUID & RESPONSIVE)
   ========================================= */

.portal-banner {
  position: relative;
  width: 100%;
  /* Ensures enough vertical height for the header clearance AND the content */
  min-height: clamp(450px, 65vh, 750px);
  display: flex;
  flex-direction: column;
  /* Centers content in the remaining space after top padding */
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-text-primary, #2b1d19);

  /* Creates an impenetrable safe zone for your transparent header */
  padding-top: clamp(100px, 15vh, 160px);
  padding-bottom: 2rem;
  box-sizing: border-box;
}

/* --- Ethereal Background Animation --- */
.pb-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  animation: slowZoom 25s linear infinite alternate;
}

@keyframes slowZoom {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.15);
  }
}

.pb-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(26, 18, 16, 0.4) 0%,
    rgba(26, 18, 16, 0.95) 100%
  );
  z-index: 2;
}

/* --- Content Wrapper --- */
.pb-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 90%;
  max-width: 800px;
  margin: 0 auto;
}

/* --- Integrated Breadcrumb --- */
.pb-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap; /* Prevents overflow on narrow mobile screens */
  gap: clamp(8px, 2vw, 15px);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  width: 100%;
}

.pb-link,
.pb-current {
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.4;
}

.pb-link {
  font-weight: 500;
  color: rgba(253, 251, 246, 0.65);
  text-decoration: none;
  transition: color 0.3s ease;
}

.pb-link:hover {
  color: var(--color-accent, #c78d6a);
}

.pb-separator {
  color: var(--color-accent, #c78d6a);
  font-size: clamp(0.6rem, 1vw, 0.8rem);
  display: flex;
  align-items: center;
}

.pb-current {
  font-weight: 600;
  color: var(--color-text-inverse, #fdfbf6);
}

/* --- Title & Typography --- */
.pb-title {
  font-family: var(--font-heading, "Cinzel", serif);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 400;
  color: var(--color-text-inverse, #fdfbf6);
  line-height: 1.15;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  letter-spacing: 1px;
  text-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
}

.pb-subtitle {
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: #c2b4ae;
  line-height: 1.6;
  max-width: 650px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* --- The Guiding Thread --- */
.pb-thread {
  width: 1px;
  height: clamp(50px, 10vh, 100px);
  background: linear-gradient(
    to bottom,
    var(--color-accent, #c78d6a) 0%,
    transparent 100%
  );
  opacity: 0.7;
}

/* =========================================
   MOBILE RESPONSIVE OVERRIDES (PORTAL BANNER)
   ========================================= */

/* --- Tablets & Large Phones (max-width: 768px) --- */
@media (max-width: 768px) {
  .portal-banner {
    /* Strict height limits for mobile to keep it in the viewport */
    min-height: 400px;
    height: 60vh;
    /* Exact pixel clearance for your mobile header */
    padding-top: 100px;
    padding-bottom: 1.5rem;
  }

  .pb-content {
    width: 100%;
    padding: 0 1.2rem; /* Ensures text never touches the screen edge */
  }

  .pb-breadcrumb {
    gap: 8px; /* Tighter gap for mobile */
    margin-bottom: 1.5rem;
  }

  .pb-link,
  .pb-current {
    font-size: 0.7rem;
    letter-spacing: 1px; /* Reduced tracking to fit more text */
  }

  .pb-separator {
    font-size: 0.6rem;
  }

  .pb-title {
    font-size: 2.8rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    /* Prevents massive words from breaking the layout horizontally */
    word-wrap: break-word;
  }

  .pb-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
    padding: 0 10px;
  }

  .pb-thread {
    height: 50px; /* Shorter thread for compact mobile screens */
  }
}

/* --- Small Phones (max-width: 480px) --- */
@media (max-width: 480px) {
  .portal-banner {
    min-height: 350px;
    padding-top: 90px; /* Slightly less clearance needed on tiny screens */
  }

  .pb-breadcrumb {
    gap: 5px;
    margin-bottom: 1rem;
  }

  .pb-link,
  .pb-current {
    font-size: 0.65rem;
  }

  .pb-title {
    font-size: 2.2rem; /* Locked-in smaller size for narrow screens */
    padding: 0 5px;
  }

  .pb-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .pb-thread {
    height: 40px;
  }
}

/* =========================================
   TABLET & LAPTOP RESPONSIVE OVERRIDES
   ========================================= */

/* --- Tablets (Portrait & Landscape: 769px to 1024px) --- */
@media (min-width: 769px) and (max-width: 1024px) {
  .portal-banner {
    min-height: 500px;
    height: 55vh;
    padding-top: 120px; /* Exact clearance for tablet-sized header */
    padding-bottom: 2rem;
  }

  .pb-content {
    width: 90%;
    max-width: 700px; /* Constrains line length for better reading */
  }

  .pb-breadcrumb {
    gap: 12px;
    margin-bottom: 2rem;
  }

  .pb-link,
  .pb-current {
    font-size: 0.75rem;
  }

  .pb-title {
    font-size: 3.8rem; /* Perfectly scaled for iPad screens */
    line-height: 1.15;
    margin-bottom: 1.2rem;
  }

  .pb-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    padding: 0 20px;
  }

  .pb-thread {
    height: 70px;
  }
}

/* --- Laptops & Standard Desktops (1025px to 1440px) --- */
@media (min-width: 1025px) and (max-width: 1440px) {
  .portal-banner {
    min-height: 600px;
    height: 65vh;
    padding-top: 140px; /* Standard desktop header clearance */
  }

  .pb-content {
    width: 85%;
    max-width: 800px;
  }

  .pb-breadcrumb {
    gap: 15px;
    margin-bottom: 2.5rem;
  }

  .pb-link,
  .pb-current {
    font-size: 0.8rem;
  }

  .pb-title {
    font-size: 4.5rem; /* Classic, cinematic desktop size */
    margin-bottom: 1.5rem;
  }

  .pb-subtitle {
    font-size: 1.15rem;
    margin-bottom: 3rem;
  }

  .pb-thread {
    height: 90px;
  }
}

/* --- Ultra-Wide Monitors (1441px and above) --- */
@media (min-width: 1441px) {
  .portal-banner {
    /* Locks the maximum height so it doesn't stretch infinitely on huge monitors */
    height: 700px;
    padding-top: 150px;
  }

  .pb-content {
    max-width: 900px;
  }

  .pb-title {
    font-size: 5rem; /* Capped maximum font size */
  }

  .pb-subtitle {
    font-size: 1.25rem;
  }

  .pb-thread {
    height: 100px;
  }
}

/* =========================================
   PREMIUM SINGLE PRODUCT PAGE (EARTHY THEME)
   ========================================= */

.product-page-section {
  background-color: var(--color-bg-base, #fdfbf6);
  padding: 4rem 0 8rem 0;
}

.pp-container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

/* --- LEFT: Sticky Gallery --- */
.pp-gallery-column {
  position: relative;
  height: 100%;
}

.pp-gallery-sticky {
  position: sticky;
  top: 120px; /* Clearance for your site header */
}

/* --- Main Image Wrapper --- */
.pp-main-image-wrapper {
  position: relative;
  width: 100%;

  /* 1. ADD THIS: Limits how large the image can get */
  max-width: 450px;

  /* 2. ADD THIS: Centers the smaller image in its column */
  margin: 0 auto 1.5rem auto;

  aspect-ratio: 4 / 5;
  border-radius: var(--radius-sm, 2px);
  overflow: hidden;
  border: 1px solid var(--color-border-subtle, rgba(135, 56, 35, 0.15));
  background: var(--color-bg-surface, #ffffff);
}

.pp-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.pp-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--color-text-primary, #2b1d19);
  color: var(--color-text-inverse, #fdfbf6);
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  z-index: 2;
}

/* --- Thumbnails --- */
.pp-thumbnails {
  display: flex;
  gap: 1rem;

  /* 3. ADD THIS: Centers the thumbnails under the smaller main image */
  justify-content: center;
}

.pp-thumb {
  width: 80px;
  height: 80px;
  border: 1px solid var(--color-border-subtle, rgba(135, 56, 35, 0.15));
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 2px;
  overflow: hidden;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.pp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pp-thumb:hover,
.pp-thumb.active {
  opacity: 1;
  border-color: var(--color-primary, #873823);
}

/* --- RIGHT: Scrolling Details --- */
.pp-details-column {
  padding-top: 1rem;
}

.pp-breadcrumb {
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-secondary, #7a6962);
  margin-bottom: 2rem;
}

.pp-breadcrumb a {
  color: var(--color-text-secondary, #7a6962);
  text-decoration: none;
  transition: color 0.3s ease;
}

.pp-breadcrumb a:hover {
  color: var(--color-primary, #873823);
}
.pp-breadcrumb span {
  margin: 0 8px;
  color: var(--color-accent, #c78d6a);
}
.pp-breadcrumb .current {
  color: var(--color-text-primary, #2b1d19);
  font-weight: 600;
}

.pp-title {
  font-family: var(--font-heading, "Cinzel", serif);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  color: var(--color-text-primary, #2b1d19);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.pp-reviews {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.pp-reviews .stars {
  color: var(--color-accent, #c78d6a);
  font-size: 1.1rem;
}
.pp-reviews .review-count {
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 0.9rem;
  color: var(--color-text-secondary, #7a6962);
}

.pp-pricing {
  margin-bottom: 2.5rem;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.pp-pricing .price-current {
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-text-primary, #2b1d19);
}
.pp-pricing .price-mrp {
  font-size: 1.2rem;
  color: var(--color-text-secondary, #7a6962);
  text-decoration: line-through;
}
.pp-pricing .price-tax {
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 0.85rem;
  color: var(--color-text-secondary, #7a6962);
}

/* Sacred Attributes */
.pp-attributes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-border-subtle, rgba(135, 56, 35, 0.15));
  border-bottom: 1px solid var(--color-border-subtle, rgba(135, 56, 35, 0.15));
}

.attr-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.attr-label {
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent, #c78d6a);
}
.attr-value {
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-primary, #2b1d19);
}

.pp-short-desc {
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 1.05rem;
  color: var(--color-text-secondary, #7a6962);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

/* Variants (Custom Radio Buttons) */
.pp-variants {
  margin-bottom: 2.5rem;
}
.variant-title {
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  color: var(--color-text-primary, #2b1d19);
}
.variant-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.variant-btn input {
  display: none;
}
.variant-label {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--color-border-strong, rgba(135, 56, 35, 0.4));
  border-radius: 2px;
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-primary, #2b1d19);
  cursor: pointer;
  transition: all 0.3s ease;
}

.variant-btn input:checked + .variant-label {
  background: var(--color-text-primary, #2b1d19);
  color: var(--color-text-inverse, #fdfbf6);
  border-color: var(--color-text-primary, #2b1d19);
}

/* Actions: Qty + Cart */
.pp-actions {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.pp-qty {
  display: flex;
  border: 1px solid var(--color-border-strong, rgba(135, 56, 35, 0.4));
  border-radius: 2px;
  height: 55px;
  width: 160px;
  flex-shrink: 0;
}

.qty-btn {
  background: transparent;
  border: none;
  width: 45px;
  font-size: 1.2rem;
  color: var(--color-text-primary, #2b1d19);
  cursor: pointer;
}

.qty-input {
  flex: 1;
  min-width: 0;
  border: none;
  border-left: 1px solid var(--color-border-subtle, rgba(135, 56, 35, 0.15));
  border-right: 1px solid var(--color-border-subtle, rgba(135, 56, 35, 0.15));
  text-align: center;
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 1rem;
  font-weight: 600;
  background: transparent;
}

.pp-add-btn {
  flex-grow: 1;
  background: var(--color-primary, #873823);
  color: var(--color-text-inverse, #fdfbf6);
  border: none;
  border-radius: 2px;
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.pp-add-btn:hover {
  background: var(--color-text-primary, #2b1d19);
}

/* Trust Badges */
.pp-trust {
  display: flex;
  gap: 2rem;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border-subtle, rgba(135, 56, 35, 0.15));
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-primary, #2b1d19);
}

.trust-item .icon {
  width: 18px;
  height: 18px;
  color: var(--color-accent, #c78d6a);
}

/* Accordions */
.pp-acc-item {
  border-bottom: 1px solid var(--color-border-subtle, rgba(135, 56, 35, 0.15));
}

.pp-acc-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  background: transparent;
  border: none;
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-text-primary, #2b1d19);
  cursor: pointer;
}

.acc-icon {
  font-size: 1.5rem;
  font-weight: 300;
  transition: transform 0.3s ease;
}

.pp-acc-content {
  display: none;
  padding-bottom: 1.5rem;
  font-family: var(--font-body, "Jost", sans-serif);
  font-size: 1rem;
  color: var(--color-text-secondary, #7a6962);
  line-height: 1.6;
}

.pp-acc-item.active .acc-icon {
  transform: rotate(45deg);
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */

@media (max-width: 1024px) {
  .pp-container {
    gap: 3rem;
  }
  .pp-title {
    font-size: 2.5rem;
  }
  .pp-attributes {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .product-page-section {
    padding: 2rem 0 5rem 0;
  }

  .pp-container {
    grid-template-columns: 1fr; /* Stacks image on top of details */
    gap: 2rem;
  }

  /* 1. Turn the gallery container into a side-by-side layout */
  .pp-gallery-sticky {
    display: flex;
    flex-direction: row-reverse; /* Puts thumbnails on the left, main image on the right */
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
  }

  .pp-actions {
    flex-direction: row;
  }
  .pp-qty {
    width: 45%;
    justify-content: space-between;
  }
  .qty-input {
    width: 100%;
  }
  .pp-add-btn {
    height: 55px;
  }

  .pp-trust {
    flex-direction: row;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  /* 2. The Main Image Wrapper */
  .pp-main-image-wrapper {
    margin: 0; /* Remove the auto centering */
    width: 100%;
    /* Leaves room for the thumbnails (60px) + gap (12px) */
    max-width: calc(100% - 72px);
  }

  /* 3. Stack the thumbnails vertically on the side */
  .pp-thumbnails {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    width: 60px; /* Fixed width for the thumbnail column */
    flex-shrink: 0;
  }

  /* 4. Make the individual thumbnails smaller to fit the mobile side-column */
  .pp-thumb {
    width: 100%;
    height: 75px;
  }
}
