/* =========================================================
   PRODUCT.CSS — Arabic/Sakura Product Detail Page
   ========================================================= */

/* ---- Breadcrumb ---- */
.breadcrumb {
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 40px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row-reverse;
  direction: rtl;
  position: relative;
  z-index: 10;
}

.breadcrumb a {
  font-family: 'Cairo', 'Quicksand', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--sakura-1);
}

.breadcrumb span:last-child {
  font-family: 'Cairo', 'Quicksand', sans-serif;
  font-size: 0.82rem;
  color: var(--text-main);
  font-weight: 500;
}

.breadcrumb__sep {
  color: var(--text-light);
  font-size: 0.8rem;
}

/* ---- Product Detail Layout ---- */
.product-detail {
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 40px 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
  direction: rtl;
  position: relative;
  z-index: 10;
}

/* Sakura watermark on product page */
.product-detail::before {
  content: '美';
  position: absolute;
  top: 40px;
  left: 60px;
  font-size: 200px;
  font-family: 'Amiri', serif;
  color: rgba(232, 117, 142, 0.04);
  pointer-events: none;
  z-index: 0;
}

/* ---- Gallery ---- */
.product-gallery {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gallery-main {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, var(--washi-1), var(--sakura-light));
  box-shadow: var(--shadow-card);
  aspect-ratio: 4/5;
}

.gallery-main__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: block;
}

.gallery-main:hover .gallery-main__img {
  transform: scale(1.03);
}

.img-fade-in {
  animation: img-fade 0.35s ease;
}

@keyframes img-fade {
  from { opacity: 0.5; transform: scale(0.98); }
  to   { opacity: 1;   transform: scale(1); }
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--sakura-light), var(--washi-1));
}

.gallery-badges {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  flex-direction: row-reverse;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}

.gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.gallery-thumb {
  width: 72px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: none;
  padding: 0;
  flex-shrink: 0;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

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

.gallery-thumb:hover {
  border-color: var(--sakura-2);
  transform: scale(1.05);
}

.gallery-thumb--active {
  border-color: var(--sakura-1);
  box-shadow: 0 0 0 2px var(--sakura-light);
}

/* ---- Product Info ---- */
.product-info {
  direction: rtl;
  text-align: right;
  position: relative;
  z-index: 2;
}

.product-info__header {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.product-info__category {
  display: inline-block;
  font-family: 'Cairo', 'Quicksand', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sakura-1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  margin-bottom: 10px;
  transition: color var(--transition-fast);
}

.product-info__category:hover {
  color: var(--ink-2);
}

.product-info__name {
  font-family: 'Amiri', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  color: var(--ink-1);
  line-height: 1.25;
  margin-bottom: 14px;
  direction: rtl;
}

.product-info__short {
  font-family: 'Cairo', 'Quicksand', sans-serif;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  direction: rtl;
}

/* ---- Price Block ---- */
.product-info__price-block {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-direction: row-reverse;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.product-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--text-main);
}

.product-price--sale {
  color: var(--sakura-1);
}

.product-price--original {
  font-size: 1.4rem;
  color: var(--text-light);
  text-decoration: line-through;
  font-weight: 400;
}

.product-price__save {
  font-family: 'Cairo', 'Quicksand', sans-serif;
  font-size: 0.8rem;
  color: white;
  background: var(--sakura-1);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

/* ---- Tags ---- */
.product-info__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  flex-direction: row-reverse;
}

.product-tag {
  font-family: 'Cairo', 'Quicksand', sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.product-tag:hover {
  border-color: var(--sakura-1);
  color: var(--sakura-1);
  background: var(--sakura-light);
}

/* ---- Description ---- */
.product-info__description {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--washi-2);
  border-radius: var(--radius-md);
  border-right: 3px solid var(--sakura-1);
}

.product-info__description p {
  font-family: 'Cairo', 'Quicksand', sans-serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
  direction: rtl;
  text-align: right;
}

/* ---- Stock ---- */
.product-info__stock {
  margin-bottom: 24px;
}

.stock-indicator {
  font-family: 'Cairo', 'Quicksand', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stock-indicator::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.stock-indicator--in {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.stock-indicator--in::before {
  background: #16a34a;
}

.stock-indicator--low {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.stock-indicator--low::before {
  background: #d97706;
}

.stock-indicator--out {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.stock-indicator--out::before {
  background: #dc2626;
}

/* ---- Buy CTA ---- */
.product-info__cta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-direction: row-reverse;
}

.qty-selector {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--washi-2);
}

.qty-btn {
  background: none;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-main);
  transition: background var(--transition-fast), color var(--transition-fast);
  font-weight: 300;
}

.qty-btn:hover {
  background: var(--sakura-light);
  color: var(--sakura-1);
}

.qty-input {
  width: 48px;
  text-align: center;
  border: none;
  background: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
}

.cta-note {
  font-family: 'Cairo', 'Quicksand', sans-serif;
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 24px;
  direction: rtl;
  text-align: right;
}

/* ---- Trust badges ---- */
.trust-badges {
  display: flex;
  gap: 20px;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-direction: row-reverse;
  font-family: 'Cairo', 'Quicksand', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.trust-badge__icon {
  color: var(--gold);
  font-size: 0.9rem;
}

/* ---- Related Products ---- */
.related-section {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 40px 60px;
  direction: rtl;
  position: relative;
  z-index: 10;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  direction: rtl;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .product-detail {
    padding: 24px 24px 48px;
    gap: 36px;
  }
  .related-section {
    padding: 0 24px 48px;
  }
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (max-width: 900px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .product-gallery {
    position: relative;
    top: 0;
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .breadcrumb {
    padding: 16px 20px 0;
  }
  .product-detail {
    padding: 20px 20px 40px;
  }
  .related-section {
    padding: 0 20px 40px;
  }
  .product-info__cta {
    flex-direction: column;
    align-items: stretch;
  }
}

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