/* ================================================================
   صفحه محصول — فانتزی‌های ویانا
   تِم: طلایی + سفید | نسخه ۲
================================================================ */

/* ── توکن‌های رنگی برند ── */
:root {
  --g:        oklch(72% 0.13 78);      /* طلای اصلی */
  --g-hover:  oklch(64% 0.13 78);      /* طلای تیره‌تر */
  --g-soft:   oklch(96% 0.04 78);      /* پس‌زمینه طلایی روشن */
  --g-border: oklch(87% 0.07 78);      /* بوردر طلایی */
  --g-glow:   oklch(72% 0.13 78 / .3); /* سایه طلایی */

  --surface:  oklch(98% 0.005 78);
  --raised:   oklch(100% 0 0);
  --border:   oklch(91% 0.006 78);
  --text:     oklch(15% 0.01 78);
  --muted:    oklch(52% 0.01 78);
  --danger:   oklch(52% 0.18 20);
  --success:  oklch(52% 0.14 145);

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;

  --sh-sm: 0 1px 4px oklch(15% 0.01 78 / .07);
  --sh:    0 4px 18px oklch(15% 0.01 78 / .10);
  --sh-lg: 0 10px 36px oklch(15% 0.01 78 / .14);
  --sh-gold: 0 6px 22px var(--g-glow);
}

/* ── کرسر سفارشی ── */
* { cursor: none !important; }

#viana-cursor {
  pointer-events: none;
  position: fixed;
  z-index: 9999;
  top: 0; left: 0;
  width: 12px; height: 12px;
  background: var(--g);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width .25s, height .25s, background .25s, opacity .2s;
  mix-blend-mode: multiply;
}

#viana-cursor.hovering {
  width: 36px; height: 36px;
  background: var(--g-soft);
  border: 1.5px solid var(--g);
  mix-blend-mode: normal;
}

#viana-cursor.clicking {
  width: 10px; height: 10px;
  background: var(--g-hover);
}

/* ── پس‌زمینه صفحه ── */
.single-product .site-main {
  background: var(--surface);
}

/* ── کانتینر اصلی ── */
.woocommerce div.product {
  background: var(--raised);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  padding: clamp(20px, 4vw, 52px);
  margin-block: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(28px, 5vw, 64px);
  align-items: start;
}

/* ── گالری — sticky ── */
.woocommerce div.product div.images {
  grid-row: 1;
  position: sticky;
  top: 90px;
}

.woocommerce-product-gallery {
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}

.woocommerce-product-gallery__image a img {
  border-radius: var(--r);
  transition: transform .35s ease;
}

.woocommerce-product-gallery__image a:hover img {
  transform: scale(1.04);
}

/* تامبنیل‌ها */
.flex-control-thumbs {
  display: flex !important;
  gap: 8px;
  margin-top: 12px !important;
  padding: 0 !important;
  flex-wrap: wrap;
}

.flex-control-thumbs li {
  width: calc(20% - 7px) !important;
  float: none !important;
}

.flex-control-thumbs li img {
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  transition: border-color .2s, opacity .2s;
  opacity: .6;
}

.flex-control-thumbs li img.flex-active,
.flex-control-thumbs li img:hover {
  border-color: var(--g);
  opacity: 1;
}

/* بج تخفیف */
.woocommerce span.onsale {
  background: linear-gradient(135deg, oklch(52% 0.22 15), oklch(48% 0.20 25));
  border-radius: 20px 20px 20px 4px;
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 12px;
  min-height: unset; min-width: unset;
  width: auto; height: auto;
  line-height: 1.5;
  top: 12px;
  inset-inline-start: 12px;
  box-shadow: var(--sh-sm);
}

/* ── ستون اطلاعات ── */
.woocommerce div.product div.summary {
  grid-row: 1;
}

/* breadcrumb */
.woocommerce-breadcrumb {
  grid-column: 1 / -1;
  font-size: .8rem;
  color: var(--muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px !important;
}

.woocommerce-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}

.woocommerce-breadcrumb a:hover { color: var(--g); }

/* عنوان */
.woocommerce div.product .product_title {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px !important;
}

/* ستاره‌ها */
.woocommerce div.product .star-rating {
  color: var(--g);
}

/* ── قیمت ── */
.woocommerce div.product p.price,
.woocommerce div.product span.price {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--g-soft);
  border: 1px solid var(--g-border);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  margin-bottom: 20px !important;
}

.woocommerce div.product p.price .woocommerce-Price-amount,
.woocommerce div.product span.price .woocommerce-Price-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--g-hover);
  font-feature-settings: "tnum";
}

.woocommerce div.product p.price del .woocommerce-Price-amount {
  font-size: .95rem;
  color: var(--muted);
  font-weight: 400;
}

/* ── توضیح کوتاه ── */
.woocommerce-product-details__short-description {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.9;
  border-right: 3px solid var(--g-border);
  padding-right: 14px;
  margin-bottom: 24px !important;
}

/* ── جدول تنوع‌ها ── */
.woocommerce div.product form.cart .variations {
  width: 100%;
  border: none;
  margin-bottom: 8px;
}

.woocommerce div.product form.cart .variations tr {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.woocommerce div.product form.cart .variations td,
.woocommerce div.product form.cart .variations th {
  padding: 0;
  border: none;
}

.woocommerce div.product form.cart .variations .label label {
  font-weight: 700;
  font-size: .85rem;
  color: var(--text);
  letter-spacing: .04em;
}

/* سواچ سایز */
.variable-item:not(.color-variable-item) {
  min-width: 44px !important;
  height: 38px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--r-sm) !important;
  font-size: .82rem !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  background: var(--raised) !important;
  transition: all .15s ease !important;
  box-shadow: none !important;
  padding: 0 12px !important;
}

.variable-item:not(.color-variable-item):hover {
  border-color: var(--g) !important;
  color: var(--g-hover) !important;
  background: var(--g-soft) !important;
}

.variable-item:not(.color-variable-item).selected {
  border-color: var(--g) !important;
  background: linear-gradient(135deg, var(--g), var(--g-hover)) !important;
  color: white !important;
  box-shadow: var(--sh-gold) !important;
}

/* سواچ رنگ */
.color-variable-item,
.image-variable-item {
  width: 46px !important;
  height: 46px !important;
  border-radius: var(--r-sm) !important;
  border: 2px solid transparent !important;
  box-shadow: var(--sh-sm) !important;
  transition: all .18s ease !important;
  overflow: hidden !important;
}

.color-variable-item:hover,
.image-variable-item:hover {
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: var(--sh) !important;
}

.color-variable-item.selected,
.image-variable-item.selected {
  outline: 2.5px solid var(--g) !important;
  outline-offset: 3px !important;
  box-shadow: var(--sh-gold) !important;
}

/* reset link */
.woocommerce div.product form.cart table.variations td.reset_variations a {
  font-size: .76rem;
  color: var(--muted);
  border-bottom: 1px dashed var(--border);
  text-decoration: none;
  transition: color .15s;
}

.woocommerce div.product form.cart table.variations td.reset_variations a:hover {
  color: var(--danger);
}

/* ── ناحیه افزودن به سبد ── */
.woocommerce div.product form.cart {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px !important;
}

/* input تعداد */
.woocommerce div.product form.cart .quantity {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  width: fit-content;
  background: var(--raised);
}

.woocommerce div.product form.cart .quantity .qty {
  border: none !important;
  width: 54px !important;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  padding: 10px 0;
  background: transparent;
  -moz-appearance: textfield;
}

.woocommerce div.product form.cart .quantity .qty::-webkit-inner-spin-button,
.woocommerce div.product form.cart .quantity .qty::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* دکمه افزودن به سبد */
.woocommerce div.product form.cart .single_add_to_cart_button {
  background: linear-gradient(135deg, var(--g) 0%, var(--g-hover) 100%) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--r-sm) !important;
  padding: 14px 36px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: .03em !important;
  transition: transform .15s, box-shadow .15s, filter .15s !important;
  box-shadow: var(--sh-gold) !important;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.woocommerce div.product form.cart .single_add_to_cart_button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, oklch(100% 0 0 / .12) 0%, transparent 60%);
  pointer-events: none;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover {
  filter: brightness(1.06) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 28px var(--g-glow) !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button:active {
  transform: translateY(0) !important;
}

/* ── دکمه‌های اکشن (علاقه‌مندی + اشتراک) ── */
.viana-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.viana-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-size: .82rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--raised);
  color: var(--muted);
  transition: all .18s ease;
  text-decoration: none;
  flex: 1;
  justify-content: center;
}

.viana-action-btn svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  transition: transform .2s, color .2s;
}

.viana-action-btn:hover {
  border-color: var(--g);
  color: var(--g-hover);
  background: var(--g-soft);
}

.viana-action-btn:hover svg {
  transform: scale(1.15);
}

/* حالت لایک‌شده */
.viana-action-btn.wishlisted {
  border-color: var(--danger);
  color: var(--danger);
  background: oklch(96% 0.04 20);
}

.viana-action-btn.wishlisted svg {
  fill: var(--danger);
  color: var(--danger);
}

/* ── بج‌های اعتماد — طلایی ── */
.viana-trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.viana-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--g-border);
  background: var(--g-soft);
  text-align: center;
  transition: box-shadow .18s, transform .18s;
}

.viana-trust-item:hover {
  box-shadow: var(--sh-gold);
  transform: translateY(-2px);
}

.viana-trust-item .vt-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--g), var(--g-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-gold);
}

.viana-trust-item .vt-icon svg {
  width: 20px; height: 20px;
  color: white;
  stroke: white;
  fill: none;
}

.viana-trust-item span {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

/* ── meta محصول ── */
.woocommerce div.product .product_meta {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: .78rem;
  color: var(--muted);
}

.woocommerce div.product .product_meta a {
  color: var(--g-hover);
  font-weight: 600;
  text-decoration: none;
}

/* ── تب‌ها ── */
.woocommerce div.product .woocommerce-tabs {
  grid-column: 1 / -1;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding-top: 36px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
  padding: 0 !important;
  margin-bottom: 0 !important;
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border) !important;
  background: none;
  flex-wrap: wrap;
}

.woocommerce div.product .woocommerce-tabs ul.tabs::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
  display: none !important;
}

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

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted) !important;
  padding: 12px 22px !important;
  display: block;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  text-decoration: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
  color: var(--g-hover) !important;
  border-bottom-color: var(--g) !important;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
  color: var(--g) !important;
}

.woocommerce div.product .woocommerce-tabs .panel {
  padding: 32px 4px !important;
  background: none;
  border: none;
  box-shadow: none;
}

/* محتوای تب */
.woocommerce-Tabs-panel p {
  font-size: .9rem;
  line-height: 1.95;
  color: oklch(35% 0.01 78);
}

.woocommerce-Tabs-panel h2,
.woocommerce-Tabs-panel h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin-block: 28px 10px;
}

/* جدول مشخصات */
.woocommerce-product-attributes {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: var(--r) !important;
  overflow: hidden !important;
  border: 1px solid var(--border) !important;
}

.woocommerce-product-attributes tr:nth-child(odd) td,
.woocommerce-product-attributes tr:nth-child(odd) th {
  background: var(--g-soft);
}

.woocommerce-product-attributes tr:nth-child(even) td,
.woocommerce-product-attributes tr:nth-child(even) th {
  background: var(--raised);
}

.woocommerce-product-attributes th,
.woocommerce-product-attributes td {
  padding: 12px 20px !important;
  font-size: .88rem !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
}

.woocommerce-product-attributes th {
  font-weight: 700 !important;
  color: var(--text) !important;
  width: 35% !important;
}

.woocommerce-product-attributes td {
  color: var(--muted) !important;
}

/* ── FAQ اکورديون ── */
.viana-faq {
  grid-column: 1 / -1;
  margin-top: 48px;
}

.viana-faq__title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.viana-faq__title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--g-border), transparent);
}

.viana-faq__item {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}

.viana-faq__item:hover {
  border-color: var(--g-border);
}

.viana-faq__item.open {
  border-color: var(--g);
  box-shadow: var(--sh-gold);
}

.viana-faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  background: var(--raised);
  gap: 12px;
  transition: background .15s;
}

.viana-faq__item.open .viana-faq__q {
  background: var(--g-soft);
  color: var(--g-hover);
}

.viana-faq__icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
  color: var(--muted);
}

.viana-faq__item.open .viana-faq__icon {
  background: var(--g);
  border-color: var(--g);
  color: white;
  transform: rotate(45deg);
}

.viana-faq__icon svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  fill: none;
}

.viana-faq__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.4,0,.2,1), padding .3s;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.85;
  padding: 0 20px;
  background: var(--raised);
  border-top: 0 solid var(--border);
  transition: max-height .35s cubic-bezier(.4,0,.2,1),
              padding .3s,
              border-top-width .3s;
}

.viana-faq__item.open .viana-faq__a {
  max-height: 400px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ── سکشن محصولات مشابه / مرتبط ── */
.viana-related-section {
  grid-column: 1 / -1;
  margin-top: 56px;
}

.viana-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.viana-section-head h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.viana-section-head h2::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 22px;
  background: linear-gradient(180deg, var(--g), var(--g-hover));
  border-radius: 3px;
}

.viana-section-head a {
  font-size: .8rem;
  color: var(--g-hover);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed var(--g-border);
  padding-bottom: 1px;
  transition: color .15s;
}

.viana-section-head a:hover { color: var(--g); }

/* Grid محصولات */
.viana-products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.viana-prod-card {
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--raised);
  overflow: hidden;
  transition: box-shadow .22s, transform .22s, border-color .22s;
  position: relative;
}

.viana-prod-card:hover {
  box-shadow: var(--sh-lg);
  transform: translateY(-4px);
  border-color: var(--g-border);
}

.viana-prod-card__img {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--surface);
  position: relative;
}

.viana-prod-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.viana-prod-card:hover .viana-prod-card__img img {
  transform: scale(1.06);
}

.viana-prod-card__discount {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  background: var(--danger);
  color: white;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  line-height: 1.5;
}

.viana-prod-card__wish {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: white;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-sm);
  opacity: 0;
  transform: scale(.8);
  transition: opacity .2s, transform .2s;
}

.viana-prod-card:hover .viana-prod-card__wish {
  opacity: 1;
  transform: scale(1);
}

.viana-prod-card__wish svg {
  width: 15px; height: 15px;
  color: var(--muted);
  stroke: currentColor;
  fill: none;
  transition: color .15s;
}

.viana-prod-card__wish:hover svg {
  color: var(--danger);
  fill: var(--danger);
}

.viana-prod-card__body {
  padding: 14px;
}

.viana-prod-card__name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.viana-prod-card__price {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.viana-prod-card__price-new {
  font-size: .92rem;
  font-weight: 800;
  color: var(--g-hover);
  font-feature-settings: "tnum";
}

.viana-prod-card__price-old {
  font-size: .75rem;
  color: var(--muted);
  text-decoration: line-through;
  font-feature-settings: "tnum";
}

.viana-prod-card__btn {
  display: block;
  text-align: center;
  margin: 10px 14px 14px;
  padding: 9px;
  background: var(--g-soft);
  border: 1.5px solid var(--g-border);
  border-radius: var(--r-sm);
  font-size: .8rem;
  font-weight: 700;
  color: var(--g-hover);
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
}

.viana-prod-card:hover .viana-prod-card__btn {
  background: linear-gradient(135deg, var(--g), var(--g-hover));
  color: white;
  border-color: transparent;
  box-shadow: var(--sh-gold);
}

/* ── پوشش WooCommerce built-in related ── */
.woocommerce div.product .related.products,
.woocommerce div.product .upsells.products {
  display: none !important; /* ما نسخه خودمون رو نشون می‌دیم */
}

/* ── ریسپانسیو ── */
@media (max-width: 900px) {
  .woocommerce div.product {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    border-radius: var(--r);
  }

  .woocommerce div.product div.images {
    position: static;
  }

  .viana-trust {
    grid-template-columns: repeat(2, 1fr);
  }

  .viana-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .viana-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .viana-trust {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
