/* --------------------------------------------------
   PRODUCT INDEX PAGE
-------------------------------------------------- */

.products-index {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* horizontal alignment */
  justify-content: center; /* vertical alignment */
  margin-top: 15px;
  min-height: calc(100vh - var(--header-height));
}

.products-title-main {
  font-family: "Magda_Light", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0.8px;
  margin-bottom: clamp(60px, 10vh, 100px);
  text-align: left;
  user-select: none;
}

.products-category-grid {
  display: flex;
  width: 100%;
  gap: 20px;
}

.category-box {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;

  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);

  text-decoration: none;
  font-size: 2rem;

  transition: var(--transition);

  min-height: clamp(350px, 20vh, 320px);
}

.category-box:hover {
  background: var(--hover);
}

.products-index {
  width: 100%;
  align-items: flex-start;
  text-align: left;
}

.products-list {
  width: 100%;
}

.product-row {
  display: block;
  padding: 20px 0 24px 0;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s ease;
}

.product-row:hover {
  background: var(--hover);
}

.product-title {
  font-family: "Magda", sans-serif;
  font-size: clamp(1.4rem, 2vw, 1.6rem);
  margin-bottom: 10px;
}

.product-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-bottom: 8px;
}

.product-sub {
  font-family: "Magda_Light", sans-serif;
  font-size: clamp(0.9rem, 1vw, 1rem);
  color: #7a7a7a;
  display: none;
}

/* --------------------------------------------------
   LIMITED / SIGNATURE PAGE
-------------------------------------------------- */

/* ===============================
   Sub Page Layout
   =============================== */
.product-sub-page {
  padding-left: 100px; /* increase left space */
  padding-right: 100px; /* increase right space */
  flex-direction: column;
  gap: 40px;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text);
  text-align: left; /* force left alignment */
  padding-left: 40px;
  width: 100%; /* take full width */
  display: block; /* ensure block-level */
}

.breadcrumb a {
  color: var(--text);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  font-weight: bold;
}

.cover-image {
  margin-left: -100px; /* cancel out page padding */
  margin-right: -100px; /* cancel out page padding */
}

.cover-image img {
  width: 100vw; /* full viewport width */
  max-width: 100%; /* prevent overflow */
  height: auto;
  display: block;
  object-fit: cover;
}

/* ===============================
   Displaying / Sort
   =============================== */
.product-header {
  display: flex; /* put children side by side */
  justify-content: space-between; /* push one left, one right */
  align-items: center; /* vertical alignment */
  width: 100%; /* span full page width */
  margin: 20px 0; /* spacing above/below */
  padding: 0 40px; /* control left/right margin space */
  box-sizing: border-box; /* include padding in width */
}

header {
  z-index: 1000;
}

.product-header p {
  font-size: 1.4rem;
  color: #737373; /* <-- set text color */
  margin: 0;
}

.sort-btn {
  font-size: 1.4rem;
  color: #737373;
  background: none;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
}

.sort-btn:hover {
  background-color: var(--hover);
}

/* ===============================
   Grid Layout
   =============================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  align-items: stretch;
}

.product-box {
  border: 1px solid var(--border);
  padding: 0;
  text-align: center;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease; /* smooth animation */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-box:hover {
  transform: translateY(-8px); /* pops up 8px */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* subtle shadow */
}

.product-box img {
  width: 100%;
  height: auto;
  margin-bottom: 0;
}

.product-box h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.product-box .desc {
  font-size: 2.2rem; /* no space between number and unit */
  letter-spacing: 2px;
  color: var(--text);
  margin: 0;
  padding: 14px 0 6px 22px;
  border-top: none;
  text-align: left; /* only desc is left-aligned */
  line-height: 1.3;
}

.product-box .desc:hover {
  text-decoration: underline;
}

.product-box .edition {
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: #6e6e6e;
  margin: 0;
  padding: 0px 0 20px 22px;
  border-top: none;
  text-align: left; /* keep edition centered */
}

.product-box .note {
  font-size: 0.95rem;
  color: #6e6e6e;
  margin: 0;
  padding: 22px 22px 20px 22px;
  text-align: left;
  align-items: left;
  justify-content: left;
  border-top: 1px solid var(--border);

  line-height: 1.4;
  min-height: calc(1.4em * 3); /* reserve space for 3 lines */
}

.product-box .price {
  font-size: 1.4rem;
  color: var(--text);
  margin: 0;
  padding: 22px 22px 20px 22px;
  text-align: right;
  margin-top: auto;
  border-top: 1px solid var(--border); /* divider line */
}

.product-frame {
  border: 1px solid var(--border); /* frame color adapts to dark/light mode */
  padding: 0px; /* safe spacing inside */
  margin: 0px auto; /* center with space around */
  display: grid;
  max-width: 1200px;
}

.product-hero {
  display: flex;
  align-items: flex-end; /* align both sides at the bottom */
  gap: 50px; /* space between image and text */
  padding: 40px;
}

.product-gallery {
  display: flex;
  align-items: flex-start;
  gap: 20px; /* space between thumbnails and main image */
  user-select: none;
}

.thumbnails {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: -20px; /* shift thumbnails further left */
}

.product-box {
  display: flex;
  flex-direction: column;
}

.product-info-top {
  padding: 14px 22px;
}

.product-box .price {
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.thumbnails img {
  width: 80px; /* square size */
  height: 80px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
}

.thumbnails img:hover {
  border-color: var(--text); /* highlight on hover */
}

.product-image img {
  width: 500px; /* fixed width */
  height: 400px; /* fixed height */
  object-fit: contain; /* keep aspect ratio inside box */
  height: auto;
  display: block;
  margin-left: 20px; /* add safe spacing from thumbnails */
}

.product-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* keep content at the top */
  text-align: left;
  max-width: 600px;
  width: 100%;
  justify-content: space-between; /* pushes content up, button down */
  user-select: none;
}

.title-price {
  font-size: 3rem;
  color: var(--text);
  display: flex;
  justify-content: space-between; /* THIS is the key */
  font-weight: bold;
  align-items: flex-start; /* stable when title wraps */
  width: 100%;
  user-select: none;
}

.title-price .desc {
  font-family: "Magda", sans-serif;
  font-weight: normal;
  font-size: 2.5rem;
  font-size: 3rem; /* no space between number and unit */
  letter-spacing: 3px;
  color: var(--text);
  margin: 0;
  padding: 0px 0 10px 0px; /* top right bottom left */
  border-top: none;
  text-align: left;
  white-space: normal; /* allow wrapping */
  max-width: 100%;
  line-height: 1.1; /* nicer multi-line rhythm */
  user-select: none;
}

.title-price h1,
.title-price .price {
  font-family: "Magda_Light", sans-serif; /* use Magda Light */
  font-weight: normal; /* ensure it doesnâ€™t override */
  font-size: 2.5rem;
  line-height: 1;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.spec-box {
  margin-top: 48px 48px;
  width: 100%;
  padding: 5% 0% 5% 0%;
}

.spec-row {
  display: flex;
  align-items: baseline;
  width: 100%;
  margin-bottom: 10px;
}

.spec-label {
  font-family: "Magda_Light", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: #6e6e6e;
}

.spec-value {
  margin-left: auto;
  text-align: right;
  font-family: "Magda", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 1.5px;
  white-space: nowrap;
  opacity: 0.8;
}

.product-hero .edition {
  font-size: 1.2rem;
  letter-spacing: 5px;
  color: #6e6e6e;
  margin: 0;
  border-top: none;
  padding: 0% 0% 10% 0%; /* top right bottom left */
  user-select: none;
}

.product-box {
  display: flex;
  flex-direction: column;
}

.divider {
  border: none; /* remove default styling */
  border-top: 1px solid var(--border);
}

.product-box.coming-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px; /* roughly same as product cards */
}

.product-grid {
  align-items: stretch;
}

.product-info blockquote {
  font-family: "Magda_Light", sans-serif;
  font-size: 1.2rem;
  opacity: 0.8;
  color: var(--text);
  letter-spacing: -0.7px;
  margin: 20px 0; /* space above/below */
  padding: 7% 0 7% 0; /* top right bottom left */
  max-width: 200%; /* ensures it stays inside text column */
  box-sizing: border-box; /* padding doesn't overflow */
  line-height: 1.4; /* tighter line spacing for quotes */
  text-align: left;
}

.notify-btn {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%; /* same width as blockquote */
  margin: 0; /* reset margins so it aligns */
  padding: 12px;

  font-family: "Magda", sans-serif;
  font-size: 20px;
  color: var(--text);
  background: none;
  border: 1px solid var(--border);
  padding: 5% 0 5% 0; /* top right bottom left */
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-box {
  display: grid;
  grid-template-rows:
    auto /* image */
    auto /* title */
    auto /* edition */
    1fr /* note */
    auto; /* price */

  height: 100%;
}

/* ===============================
   Product Contact Us Button
   =============================== */

.contact-wrapper {
  position: relative;
}

.contact-btn {
  position: relative;
  overflow: hidden;
}

/* Label */
.contact-label {
  position: relative;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  left: 10%;
  opacity: 0;
  transition: transform 0.35s ease;
}

/* Arrow */
.arrow {
  position: absolute;
  right: -30px;
  opacity: 0;
  transform: translateX(6px);
  transition: all 0.3s ease;
}

.contact-btn:hover .arrow {
  opacity: 1;
  transform: translateX(0);
}

/* New Update */
/* Default */
.price-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  opacity: 1;
  transition: opacity 0.25s ease;
}

/* Hover preview */
.contact-btn:hover:not(.active) .price-label {
  opacity: 0;
}

.contact-btn:hover:not(.active) .contact-label {
  opacity: 1;
}

/* Clicked state (stay open) */
.contact-btn.active .price-label {
  opacity: 0;
}

.contact-btn.active .contact-label {
  opacity: 1;
}

/* END */

/* Icons */
.contact-icons {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);

  display: flex;
  gap: 27px;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Active animation */
.contact-btn.active .contact-label {
  transform: translateX(-140px);
}

.contact-btn.active .contact-icons {
  opacity: 1;
  pointer-events: auto;
}

/* Icons style */
.contact-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contact-icon img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.icon-light {
  display: none;
}

.dark .icon-light {
  display: block;
}

.dark .icon-dark {
  display: none;
}

/* ===============================
   Product Story Section
   =============================== */
.whale-story {
  display: block;
  align-items: flex-start;
  gap: 40px;
  margin-top: 60px;
  max-width: 1000px; /* same width as product-info box */
  margin-left: auto;
  margin-right: auto; /* centers the whole section */
  padding: 0; /* remove extra padding */
}

.story-text {
  flex: 2;
  margin-left: 0; /* flush with parent left edge */
}

.story-text h2 {
  font-family: "Magda", sans-serif;
  font-weight: normal; /* ensure it doesnâ€™t override */
  font-size: 2.5rem;
  font-size: 3rem; /* no space between number and unit */
  letter-spacing: 3px;
  color: var(--text);
  margin: 0;
  padding: 0px 0 10px 0px; /* top right bottom left */
  color: var(--text);
  text-align: left; /* force left alignment */
}

.story-meta {
  letter-spacing: 5px;
  color: #737373;
  margin-top: 10px;
  font-size: 16px; /* smaller text */
  padding: 0px 0 30px 0px; /* top right bottom left */
  opacity: 1; /* lighter look */
  text-align: left; /* flush left like the story title */
}

.story-meta .author {
  font-weight: 600; /* make author stand out */
}

.story-meta .date {
  margin-left: 8px;
}

.story-text p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  text-align: justify; /* force left alignment */
  padding: 20px 0 20px 0px; /* top right bottom left */
}

.story-photo {
  flex: 1;
  margin-top: 20px; /* spacing below text */
}

.story-photo img {
  width: 100%;
  aspect-ratio: 1 / 1; /* keeps it square */
  object-fit: cover; /* crops nicely if image isnâ€™t square */
}

.page-number {
  text-align: center; /* center horizontally */
  font-size: 1.2rem; /* adjust size */
  color: #6e6e6e; /* match your theme */
  margin: 40px 0; /* spacing above and below */
}

.footer-spacer {
  height: 120px; /* adjust to control space */
}

/* ===============================
   Coming Soon Box
   =============================== */
.coming-soon {
  font-size: 2.2rem;
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --------------------------------------------------
   IMAGE SLIDER
-------------------------------------------------- */

.product-image-slider {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

.product-image-slider img {
  width: 100%;
  display: none;
}

.product-image-slider img.active {
  display: block;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  color: #a7a5a5;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 40px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.product-image-slider:hover .slider-arrow {
  opacity: 0.8;
}

.slider-arrow.left {
  left: 10px;
}

.slider-arrow.right {
  right: 10px;
}

/* --------------------------------------------------
   NEW PRODUCT PAGE LAYOUT (MOBILE FORMAT)
-------------------------------------------------- */
.product-image {
  width: 100%;
  position: relative;
}

.product-image img {
  display: block;
}

.thumbnails img.is-active {
  border-color: var(--text);
}

.product-image-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20000;
}

.product-image-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.product-image-overlay-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-overlay img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* --------------------------------------------------
   MOBILE CONTROL LAYOUT
-------------------------------------------------- */
@media (max-width: 1250px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-sub-page {
    padding-left: 30px;
    padding-right: 30px;
    margin-top: 0px;
  }

  .mobile-page-title {
    display: block;
    font-family: "Magda", sans-serif;
    font-size: 2.1rem;
    letter-spacing: 2px;
    margin-top: 30px;
    margin-bottom: 5px;
  }
}

@media (max-width: 900px){
  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-sub-page {
    padding-left: 24px;
    padding-right: 24px;
    margin-top: 0px;
  }

  /* Displaying - Sort */
  .product-header {
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
    font-size: 0.2rem;
    border-top: none;
  }

  .product-frame {
    width: 100%;
    max-width: none;
  }

  .product-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }

  .product-gallery {
    width: 100%;
    display: block;
  }

  .thumbnails {
    display: none;
  }

  .product-image {
    width: 100%;
    min-height: 320px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .product-image img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    margin-left: 0;
    padding: 24px;
    cursor: zoom-in;
  }

  .product-info {
    width: 100%;
    max-width: none;
    padding: 24px;
  }

  .title-price .desc {
    font-size: 2.2rem;
    letter-spacing: 2px;
  }

  .product-hero .edition {
    font-size: 1rem;
    letter-spacing: 3px;
    padding-bottom: 32px;
  }

  .spec-box {
    padding: 24px 0;
  }

  .product-info blockquote {
    padding: 24px 0;
    font-size: 1.05rem;
  }

  .notify-btn {
    width: 100%;
  }

  .product-image-overlay {
    padding: 0;
  }

  .product-image-overlay img {
    width: 100%;
    height: auto;
    max-height: 100%;
  }

  .contact-wrapper {
    width: 100%;
  }

  .contact-btn .contact-label {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    left: 50%;
  }

  .contact-btn {
    position: relative;
    overflow: hidden;
  }

  .contact-btn .price-label,
  .contact-btn .contact-label,
  .contact-btn .contact-icons {
    transition: opacity 0.2s ease;
  }

  .contact-btn .contact-icons {
    position: absolute;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    opacity: 0;
    pointer-events: none;
    width: auto;
  }

  .contact-btn.active .price-label {
    opacity: 0;
  }

  .contact-btn.active .contact-icons {
    opacity: 1;
    pointer-events: auto;
  }

  .contact-btn.active .contact-label {
    opacity: 0;
  }

  .contact-icon {
    width: 20px;
    height: 20px;
  }

  .contact-btn:hover:not(.active) .price-label {
    opacity: 1;
  }

  .contact-btn:hover:not(.active) .contact-label {
    opacity: 0;
  }

  .contact-btn:not(.active) .price-label {
    opacity: 1;
  }

  .contact-btn:not(.active) .contact-icons {
    opacity: 0;
    pointer-events: none;
  }

  .contact-btn .contact-label {
    opacity: 0;
    pointer-events: none;
  }
}
