/* ============================================
   Product Page Template - 1688 Style
   ============================================ */

/* Disable WordPress emoji image conversion inside plugin wrapper */
.pp-no-emoji img.emoji {
  display: none !important;
}
.pp-no-emoji {
  font-family: var(--pp-font);
}

/* --- SVG Icons --- */
.pp-icon {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-inline-end: 2px;
  flex-shrink: 0;
}
.pp-gallery__zoom-icon .pp-icon,
.pp-gallery__zoom-icon svg {
  width: 16px;
  height: 16px;
}
.pp-btn--cart .pp-icon,
.pp-btn--cart svg.pp-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

/* --- Container --- */
.pp-product-wrapper {
  width: 100%;
  max-width: var(--pp-container);
  margin: 16px auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  font-family: var(--pp-font);
  color: var(--pp-main-text);
  box-sizing: border-box;
  padding: 0 20px;
}
.pp-product-wrapper *,
.pp-product-wrapper *::before,
.pp-product-wrapper *::after {
  box-sizing: border-box;
}

/* ======================
   GALLERY SECTION
   ====================== */
.pp-gallery {
  width: var(--pp-gallery-w);
  max-width: 45%;
  flex-shrink: 0;
}

.pp-gallery__main {
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--pp-bg-gray);
  border-radius: var(--pp-radius);
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pp-gallery__main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.pp-gallery__main:hover img {
  transform: scale(1.03);
}

.pp-gallery__zoom-icon {
  position: absolute;
  bottom: 12px;
  inset-inline-end: 12px;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.2s;
}

.pp-gallery__main:hover .pp-gallery__zoom-icon {
  opacity: 1;
}

.pp-gallery__thumbs {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pp-gallery__thumbs::-webkit-scrollbar {
  height: 4px;
}

.pp-gallery__thumbs::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 2px;
}

.pp-gallery__thumb {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: var(--pp-radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  background: var(--pp-bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pp-gallery__thumb:hover,
.pp-gallery__thumb.active {
  border-color: var(--pp-brand);
}

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

/* ======================
   ORDER / INFO SECTION
   ====================== */
.pp-order {
  flex: 1;
  min-width: 0;
  max-width: var(--pp-order-w);
}

.pp-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--pp-main-text);
  margin-bottom: 16px;
}

.pp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.pp-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  color: #fff;
  background: var(--pp-brand);
}

.pp-tag--blue {
  background: #0072FD;
}

.pp-tag--green {
  background: #00B334;
}

/* ======================
   PROMO BANNER
   ====================== */
.pp-promo-banner {
  background: linear-gradient(135deg, rgba(110,80,255,0.08) 0%, rgba(255,255,255,0) 46%), #FFFFFF;
  border: 1px solid rgba(110,80,255,0.1);
  border-radius: var(--pp-radius);
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pp-promo-banner__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: var(--pp-brand-light);
}

.pp-promo-banner__text {
  font-size: 14px;
  color: var(--pp-main-text);
  line-height: 1.5;
}

.pp-promo-banner__link {
  color: var(--pp-brand);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}

.pp-promo-banner__link:hover {
  opacity: 0.8;
  text-decoration: underline;
}
/* ======================
   PRICE BOX
   ====================== */
.pp-price-box {
  background: linear-gradient(180deg, #FFF5EB 0%, #FFF9F4 40%, #FFFFFF 100%);
  border-radius: var(--pp-radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  position: relative;
}

.pp-price-box__row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.pp-price-label {
  font-size: 12px;
  color: var(--pp-secondary-text);
}

.pp-price-currency {
  font-size: 16px;
  font-weight: 700;
  color: var(--pp-brand);
  font-family: var(--pp-font-price);
}

.pp-price-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--pp-brand);
  font-family: var(--pp-font-price);
  line-height: 1;
}

.pp-price-original {
  font-size: 14px;
  color: var(--pp-tip-text);
  text-decoration: line-through;
  margin-inline-start: 8px;
}

.pp-price-unit {
  font-size: 14px;
  color: var(--pp-brand);
  font-weight: 400;
}

.pp-price-discount-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 2px;
  background: var(--pp-brand);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  margin-inline-start: 8px;
}

/* ======================
   SHIPPING SECTION
   ====================== */
.pp-shipping {
  padding: 14px 0;
  border-top: 0.5px solid var(--pp-border-light);
  border-bottom: 0.5px solid var(--pp-border-light);
}

.pp-shipping__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 20px;
}

.pp-shipping__row:last-child {
  margin-bottom: 0;
}

.pp-shipping__label {
  color: var(--pp-tip-text);
  min-width: 60px;
  font-size: 14px;
  flex-shrink: 0;
}

.pp-shipping__value {
  color: var(--pp-main-text);
  font-size: 14px;
}

.pp-shipping__highlight {
  color: var(--pp-brand);
  font-weight: 500;
}

.pp-shipping__cards {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.pp-shipping__card {
  background: var(--pp-bg-gray);
  border-radius: var(--pp-radius);
  padding: 10px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pp-shipping__card-from,
.pp-shipping__card-to {
  font-size: 14px;
  font-weight: 500;
  color: var(--pp-main-text);
}

.pp-shipping__card-method {
  font-size: 12px;
  color: var(--pp-secondary-text);
}

/* ======================
   SKU / VARIATION SECTION
   ====================== */
.pp-sku {
  padding: 16px 0;
  border-bottom: 0.5px solid var(--pp-border-light);
}

.pp-sku__group {
  margin-bottom: 16px;
}

.pp-sku__group:last-child {
  margin-bottom: 0;
}

.pp-sku__label {
  font-size: 14px;
  color: var(--pp-tip-text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pp-sku__label-required {
  color: #FF0000;
}

.pp-sku__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pp-sku__opt {
  padding: 6px 16px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--pp-radius-sm);
  font-size: 14px;
  color: var(--pp-main-text);
  cursor: pointer;
  background: var(--pp-bg-white);
  transition: all 0.2s;
  line-height: 22px;
  user-select: none;
}

.pp-sku__opt:hover {
  border-color: var(--pp-brand);
  color: var(--pp-brand);
}

.pp-sku__opt.active {
  border-color: var(--pp-brand);
  color: var(--pp-brand);
  background: var(--pp-brand-light);
  font-weight: 500;
}

.pp-sku__opt.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
  pointer-events: none;
}

/* ======================
   QUANTITY SELECTOR
   ====================== */
.pp-qty {
  padding: 16px 0;
  border-bottom: 0.5px solid var(--pp-border-light);
  display: flex;
  align-items: center;
  gap: 16px;
}

.pp-qty__label {
  font-size: 14px;
  color: var(--pp-tip-text);
}

.pp-qty__control {
  display: flex;
  align-items: center;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--pp-radius-sm);
  overflow: hidden;
}

.pp-qty__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pp-bg-white);
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--pp-main-text);
  transition: background 0.15s;
  user-select: none;
}

.pp-qty__btn:hover {
  background: var(--pp-bg-gray);
}

.pp-qty__btn:active {
  background: #eee;
}

.pp-qty__input {
  width: 56px;
  height: 36px;
  text-align: center;
  border: none;
  border-left: 1px solid rgba(0,0,0,0.12);
  border-right: 1px solid rgba(0,0,0,0.12);
  font-size: 14px;
  font-family: var(--pp-font);
  color: var(--pp-main-text);
  outline: none;
  -moz-appearance: textfield;
}

.pp-qty__input::-webkit-outer-spin-button,
.pp-qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pp-qty__stock {
  font-size: 12px;
  color: var(--pp-tip-text);
  margin-inline-start: 4px;
}

/* ======================
   ACTION BUTTONS
   ====================== */
.pp-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.pp-btn {
  flex: 1;
  height: 48px;
  border: none;
  border-radius: var(--pp-radius);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--pp-font);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pp-btn--buy {
  background: var(--pp-brand);
  color: #fff;
}

.pp-btn--buy:hover {
  background: var(--pp-brand-hover);
  box-shadow: 0 4px 12px rgba(255,91,0,0.3);
}

.pp-btn--buy:active {
  transform: scale(0.98);
}

.pp-btn--cart {
  background: var(--pp-brand-light);
  color: var(--pp-brand);
  border: 1px solid var(--pp-brand);
}

.pp-btn--cart:hover {
  background: #FFECD6;
}

.pp-btn--cart:active {
  transform: scale(0.98);
}

/* ======================
   SERVICE GUARANTEES
   ====================== */
.pp-services {
  padding: 14px 0;
  border-bottom: 0.5px solid var(--pp-border-light);
}

.pp-services__row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pp-services__label {
  font-size: 14px;
  color: var(--pp-tip-text);
  min-width: 60px;
  flex-shrink: 0;
}

.pp-services__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--pp-main-text);
  padding: 4px 0;
}

.pp-services__divider {
  width: 1px;
  height: 12px;
  background: #ddd;
  margin: 0 4px;
}

/* ======================
   PRODUCT DESCRIPTION TABS
   ====================== */
.pp-tabs-wrapper {
  width: 100%;
  max-width: var(--pp-container);
  margin: 24px auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.pp-tabs {
  display: flex;
  border-bottom: 2px solid var(--pp-brand);
}

.pp-tab {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--pp-secondary-text);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--pp-font);
  border-radius: 8px 8px 0 0;
}

.pp-tab.active {
  color: var(--pp-brand);
  background: var(--pp-brand-light);
  border-bottom-color: var(--pp-brand);
}

.pp-tab:hover {
  color: var(--pp-brand);
  background: var(--pp-brand-light);
}

.pp-tab-content {
  display: none;
  padding: 20px 0;
  font-size: 14px;
  line-height: 1.8;
}

.pp-tab-content.active {
  display: block;
}

/* Specs table */
.pp-specs-table {
  width: 100%;
  border-collapse: collapse;
}

.pp-specs-table th,
.pp-specs-table td {
  padding: 10px 16px;
  text-align: start;
  font-size: 14px;
  border: 1px solid var(--pp-border);
}

.pp-specs-table th {
  background: var(--pp-bg-gray);
  font-weight: 500;
  color: var(--pp-tip-text);
  width: 140px;
}

.pp-specs-table td {
  color: var(--pp-main-text);
}

/* Description */
.pp-description { font-size: 15px; line-height: 1.9; }
.pp-description img { max-width: 100%; height: auto; border-radius: var(--pp-radius); }
.pp-description table { width: 100%; border-collapse: collapse; }
.pp-description td, .pp-description th { padding: 8px 12px; border: 1px solid var(--pp-border); }

.pp-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--pp-tip-text);
  font-size: 15px;
}

/* Reviews */
.pp-reviews-summary {
  background: var(--pp-brand-light);
  border-radius: var(--pp-radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.pp-reviews-score { display: flex; align-items: center; gap: 12px; }
.pp-reviews-number { font-size: 36px; font-weight: 700; color: var(--pp-brand); font-family: var(--pp-font-price); }
.pp-reviews-stars { display: flex; gap: 2px; }
.pp-reviews-count { font-size: 14px; color: var(--pp-secondary-text); }

.pp-star { font-size: 18px; }
.pp-star--full { color: #FFB800; }
.pp-star--half { color: #FFB800; position: relative; }
.pp-star--empty { color: #ddd; }

.pp-review-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--pp-border-light);
}
.pp-review-item:last-child { border-bottom: none; }

.pp-review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.pp-review-author { font-weight: 600; font-size: 14px; color: var(--pp-main-text); }
.pp-review-date { font-size: 12px; color: var(--pp-tip-text); margin-right: auto; }
.pp-review-text { font-size: 14px; line-height: 1.7; color: var(--pp-main-text); }

/* ======================
   RESPONSIVE
   Breakpoints:
     1400px  -> wide screen
     1200px  -> normal desktop / large laptop
     1024px  -> laptop / iPad landscape
      768px  -> tablet portrait
      480px  -> phone
   ====================== */
@media (max-width: 1400px) {
  .pp-product-wrapper {
    gap: 20px;
  }
}

@media (max-width: 1200px) {
  .pp-product-wrapper { gap: 16px; }
  .pp-price-value { font-size: 32px; }
}

@media (max-width: 1024px) {
  .pp-product-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  .pp-gallery,
  .pp-order {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }
  .pp-gallery {
    max-width: 520px;
    margin: 0 auto;
  }
  .pp-gallery__main {
    height: auto;
    aspect-ratio: 1/1;
  }
  .pp-tabs-wrapper {
    padding: 0 16px;
  }
}

@media (max-width: 768px) {
  .pp-product-wrapper {
    padding: 0 12px;
    margin: 10px auto;
  }
  .pp-gallery {
    max-width: 100%;
  }
  .pp-gallery__thumb {
    width: 60px;
    height: 60px;
  }
  .pp-price-value {
    font-size: 28px;
  }
  .pp-actions {
    flex-direction: column;
    gap: 10px;
  }
  .pp-btn {
    height: 44px;
  }
  .pp-btn--wishlist {
    width: 44px;
    min-width: 44px;
  }
  .pp-shipping__cards {
    flex-direction: column;
  }
  .pp-specs-table th {
    width: 100px;
  }
  .pp-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .pp-tab {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .pp-product-wrapper {
    padding: 0 10px;
    margin: 8px auto;
  }
  .pp-gallery__thumb {
    width: 50px;
    height: 50px;
  }
  .pp-price-value {
    font-size: 24px;
  }
  .pp-gallery__main {
    border-radius: var(--pp-radius);
  }
  .pp-btn {
    height: 42px;
    font-size: 14px;
  }
  .pp-btn--wishlist {
    width: 42px;
    min-width: 42px;
  }
  .pp-specs-table {
    font-size: 13px;
  }
  .pp-specs-table th {
    width: 90px;
  }
  .pp-reviews-summary {
    padding: 12px;
  }
}

/* ======================
   IMAGE LIGHTBOX
   ====================== */
.pp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.pp-lightbox.open {
  display: flex;
}

.pp-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--pp-radius);
}

/* ======================
   LIGHTBOX ICONS
   - Unique classes: .pp-lightbox__icon, .pp-lightbox__icon-prev/next/close
   - Icon style variants: --chevron / --arrow / --triangle / --caret
   - Only the selected style is shown via parent modifier class
   ====================== */

/* Icon SVG base */
.pp-lightbox__icon {
  width: 50%;
  height: 50%;
  display: none;
  flex-shrink: 0;
}

/* Show only the selected icon style based on parent modifier */
.pp-lightbox--icon-chevron .pp-lightbox__icon--chevron,
.pp-lightbox--icon-arrow .pp-lightbox__icon--arrow,
.pp-lightbox--icon-triangle .pp-lightbox__icon--triangle,
.pp-lightbox--icon-caret .pp-lightbox__icon--caret {
  display: block;
}

/* Close button */
.pp-lightbox__close {
  position: absolute;
  top: 20px;
  inset-inline-end: 20px;
  width: var(--pp-lb-nav-size, 44px);
  height: var(--pp-lb-nav-size, 44px);
  background: var(--pp-lb-nav-bg, rgba(0,0,0,0.5));
  border-radius: 50%;
  border: none;
  color: var(--pp-lb-nav-color, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.2s, transform 0.15s;
  opacity: 0.85;
  z-index: 2;
  padding: 0;
}

.pp-lightbox__close:hover {
  opacity: 1;
  transform: scale(1.08);
}

.pp-lightbox__close:active {
  transform: scale(0.95);
}

.pp-lightbox__icon-close {
  width: 45%;
  height: 45%;
}

/* Navigation buttons */
.pp-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--pp-lb-nav-size, 44px);
  height: var(--pp-lb-nav-size, 44px);
  background: var(--pp-lb-nav-bg, rgba(0,0,0,0.5));
  border-radius: 50%;
  border: none;
  color: var(--pp-lb-nav-color, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.2s, transform 0.15s;
  opacity: 0.85;
  z-index: 2;
  padding: 0;
}

.pp-lightbox__nav:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.08);
}

.pp-lightbox__nav:active {
  transform: translateY(-50%) scale(0.95);
}

.pp-lightbox__prev {
  inset-inline-start: 20px;
}

.pp-lightbox__next {
  inset-inline-end: 20px;
}

/* ======================
   RTL / LTR DIRECTION HANDLING
   - In LTR: prev points left (<), next points right (>)
   - In RTL: arrows visually flip so prev points right, next points left
   - Uses :dir() pseudo-class with fallback to [dir="rtl"] ancestor
   ====================== */

/* RTL: flip arrow icons horizontally */
[dir="rtl"] .pp-lightbox__icon-prev {
  transform: scaleX(-1);
}
[dir="rtl"] .pp-lightbox__icon-next {
  transform: scaleX(-1);
}

/* Modern browsers: use :dir() for better specificity */
.pp-lightbox:dir(rtl) .pp-lightbox__icon-prev {
  transform: scaleX(-1);
}
.pp-lightbox:dir(rtl) .pp-lightbox__icon-next {
  transform: scaleX(-1);
}

/* Close icon stays the same in both directions (X is symmetric) */

/* Keyboard focus accessibility */
.pp-lightbox__nav:focus-visible,
.pp-lightbox__close:focus-visible {
  outline: 2px solid var(--pp-lb-nav-color, #fff);
  outline-offset: 3px;
  opacity: 1;
}

/* Loading skeleton */
.pp-skeleton {
  background: linear-gradient(90deg, var(--pp-bg-gray) 25%, #f0f0f0 50%, var(--pp-bg-gray) 75%);
  background-size: 200% 100%;
  animation: pp-shimmer 1.5s infinite;
  border-radius: var(--pp-radius-sm);
}

@keyframes pp-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast notifications */
.pp-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999999;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--pp-radius);
  font-size: 14px;
  font-family: var(--pp-font);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.pp-toast.show {
  opacity: 1;
}