/*--------------------------------------------------------------
  M-Fishing Theme – Single Product Page
  Tokens: cream-bg #FDFCF8 | rich-black #121212 | muted-gold #D4AF37
          soft-gray #F2F0EB | lux-green #1B4D3E | lux-green-light #2A6E5A
  Fonts:  "Cinzel", serif (headings) | "Manrope", sans-serif (body)
--------------------------------------------------------------*/

/* ---- Gallery layout ---- */
.mf-product-gallery {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
}

.mf-gallery-thumbnails {
  display: flex;
  flex-direction: column;
  gap: 10px;
  order: -1;
}

.mf-gallery-thumbnails button {
  width: 80px;
  height: 80px;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #F2F0EB;
  padding: 0;
  transition: border-color 0.2s ease;
}

.mf-gallery-thumbnails button.active,
.mf-gallery-thumbnails button:hover {
  border-color: #D4AF37;
}

.mf-gallery-thumbnails button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mf-gallery-main {
  border-radius: 12px;
  overflow: hidden;
  background: #F2F0EB;
  aspect-ratio: 1 / 1;
}

.mf-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}

/* Sticky sidebar gallery */
.mf-product-gallery-wrap {
  position: sticky;
  top: 100px;
  align-self: start;
}

/* ---- Product info section ---- */
.mf-product-summary {
  font-family: "Manrope", sans-serif;
}

.mf-product-summary .mf-product-title {
  font-family: "Cinzel", serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #121212;
  margin: 0 0 12px;
  line-height: 1.3;
}

.mf-product-summary .mf-product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #121212;
  margin-bottom: 20px;
}

.mf-product-summary .mf-product-excerpt {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #555;
  margin-bottom: 24px;
}

/* Sale price styling on single product */
.single-product del {
  opacity: 0.5;
}

.single-product ins {
  text-decoration: none;
}

.mf-product-meta {
  font-size: 0.85rem;
  color: #888;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #F2F0EB;
}

.mf-product-meta span {
  display: block;
  margin-bottom: 6px;
}

.mf-product-meta a {
  color: #1B4D3E;
  text-decoration: none;
  transition: color 0.2s ease;
}

.mf-product-meta a:hover {
  color: #D4AF37;
}

/* ---- Variation selector buttons ---- */
.mf-variation-selector {
  margin-bottom: 24px;
}

.mf-variation-selector .mf-variation-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #121212;
  margin-bottom: 10px;
}

.mf-variation-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mf-variation-options button {
  font-family: "Manrope", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  border: 2px solid #e0ddd6;
  border-radius: 8px;
  background: #FDFCF8;
  color: #121212;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mf-variation-options button:hover {
  border-color: #1B4D3E;
}

.mf-variation-options button.selected {
  background: #1B4D3E;
  border-color: #1B4D3E;
  color: #FDFCF8;
}

.mf-variation-options button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Color swatches variant */
.mf-variation-options.mf-color-swatches button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  position: relative;
}

.mf-variation-options.mf-color-swatches button.selected::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid #1B4D3E;
  border-radius: 50%;
}

/* ---- Quantity input ---- */
.mf-quantity {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e0ddd6;
  border-radius: 8px;
  overflow: hidden;
  background: #FDFCF8;
}

.mf-quantity button {
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: #121212;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.mf-quantity button:hover {
  background: #F2F0EB;
}

.mf-quantity input {
  width: 48px;
  height: 42px;
  text-align: center;
  border: none;
  border-left: 1px solid #e0ddd6;
  border-right: 1px solid #e0ddd6;
  font-family: "Manrope", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #121212;
  background: transparent;
  -moz-appearance: textfield;
}

.mf-quantity input::-webkit-outer-spin-button,
.mf-quantity input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ---- Product tabs ---- */
.mf-product-tabs {
  margin-top: 3rem;
  border-top: 1px solid #F2F0EB;
}

.mf-product-tabs .mf-tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #F2F0EB;
  list-style: none;
  padding: 0;
  margin: 0;
}

.mf-product-tabs .mf-tabs-nav li {
  margin: 0;
}

.mf-product-tabs .mf-tabs-nav li a,
.mf-product-tabs .mf-tabs-nav li button {
  display: block;
  padding: 16px 28px;
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #888;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.mf-product-tabs .mf-tabs-nav li a::after,
.mf-product-tabs .mf-tabs-nav li button::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s ease;
}

.mf-product-tabs .mf-tabs-nav li.active a,
.mf-product-tabs .mf-tabs-nav li.active button,
.mf-product-tabs .mf-tabs-nav li a:hover,
.mf-product-tabs .mf-tabs-nav li button:hover {
  color: #121212;
}

.mf-product-tabs .mf-tabs-nav li.active a::after,
.mf-product-tabs .mf-tabs-nav li.active button::after {
  background: #D4AF37;
}

.mf-product-tabs .mf-tab-panel {
  padding: 28px 0;
  font-size: 0.95rem;
  line-height: 1.75;
  color: #333;
}

.mf-product-tabs .mf-tab-panel[hidden] {
  display: none;
}

/* WooCommerce tab override */
.woocommerce div.product .woocommerce-tabs ul.tabs {
  padding: 0;
  margin: 0;
  border-bottom: 2px solid #F2F0EB;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
  border: none;
  background: none;
  border-radius: 0;
  margin: 0;
  padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  padding: 16px 28px;
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #888;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
  border-bottom: 2px solid #D4AF37;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
  color: #121212;
}

/* ---- Reviews ---- */
.mf-reviews .mf-review-item {
  padding: 24px 0;
  border-bottom: 1px solid #F2F0EB;
}

.mf-reviews .mf-review-item:last-child {
  border-bottom: none;
}

.mf-review-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.mf-review-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #F2F0EB;
}

.mf-review-author {
  font-weight: 700;
  font-size: 0.9rem;
  color: #121212;
}

.mf-review-date {
  font-size: 0.8rem;
  color: #999;
}

.mf-review-content {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #555;
}

/* ---- Related products ---- */
.mf-related-products {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid #F2F0EB;
}

.mf-related-products .mf-section-title {
  font-family: "Cinzel", serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #121212;
  margin-bottom: 28px;
  text-align: center;
}

/* ---- Lightbox ---- */
.mf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mf-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.mf-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mf-lightbox-content {
  position: relative;
  z-index: 1;
  width: 85vw;
  height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}

.mf-lightbox-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
}

/* Close button */
.mf-lb-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.mf-lb-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

/* Navigation arrows */
.mf-lb-prev,
.mf-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.mf-lb-prev { left: 20px; }
.mf-lb-next { right: 20px; }

.mf-lb-prev:hover,
.mf-lb-next:hover {
  background: rgba(212, 175, 55, 0.8);
  transform: translateY(-50%) scale(1.08);
}

/* Toolbar (zoom controls) */
.mf-lb-toolbar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mf-lb-toolbar button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.mf-lb-toolbar button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.mf-lb-zoom-level {
  color: rgba(255, 255, 255, 0.7);
  font-family: "Manrope", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
  user-select: none;
}

/* Counter */
.mf-lb-counter {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.6);
  font-family: "Manrope", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  user-select: none;
}

/* ---- Prevent tab content overflow ---- */
.tab-content img {
  max-width: 100%;
  height: auto;
}

.tab-content table {
  max-width: 100%;
}

.tab-content iframe,
.tab-content video,
.tab-content embed,
.tab-content object {
  max-width: 100%;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .mf-lightbox-content {
    width: 95vw;
    height: 80vh;
  }

  .mf-lb-prev,
  .mf-lb-next {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .mf-lb-prev { left: 8px; }
  .mf-lb-next { right: 8px; }

  .mf-lb-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }

  .mf-lb-toolbar {
    bottom: 16px;
    padding: 4px 6px;
  }

  .mf-lb-toolbar button {
    width: 36px;
    height: 36px;
  }

  .mf-product-gallery {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mf-gallery-thumbnails {
    flex-direction: row;
    order: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mf-gallery-thumbnails button {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
  }

  .mf-product-gallery-wrap {
    position: static;
  }

  .mf-product-summary .mf-product-title {
    font-size: 1.35rem;
  }

  .mf-product-tabs .mf-tabs-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mf-product-tabs .mf-tabs-nav li a,
  .mf-product-tabs .mf-tabs-nav li button {
    padding: 14px 18px;
    white-space: nowrap;
    font-size: 0.8rem;
  }
}
