/* ======== Modal Base ========= */
/* Modal */
#epqv-modal{
position:fixed;
inset:0;
display:none;
z-index:99999;
}

#epqv-modal.active{
  display:flex;
  align-items:center;     /* وسط عمودی */
  justify-content:center; /* وسط افقی */
  padding:20px;
}

/* Overlay */
.epqv-overlay{
position:absolute;
inset:0;
background:rgba(15,23,42,.55);
backdrop-filter:blur(4px);
}

/* Box */
.epqv-box{
position:relative;
background:#fff;
width:min(500px,92%);
max-height:90vh;
overflow-y:auto;

border-radius:20px;
padding:20px 20px 0px; /* اولی از بالا / دومی از چپ و راست / سومی از پایین */

box-shadow:0 40px 80px rgba(0,0,0,.25);
}

/* وقتی در حال لود هست، به باکس فاصله بده */
#epqv-modal.loading .epqv-box {
    padding: 60px 20px !important; 
    text-align: center;
}

/* Close Button */
/* Base */
.epqv-close{
position:absolute;
top:0px;
right:0px;
margin-right:6px;
margin-top:6px;
z-index:10000;

width:36px;
height:36px;

display:flex;
align-items:center;
justify-content:center;

border:none;
border-radius:50%;

background:#f1f5f9;
color:#111827;

font-size:18px;
cursor:pointer;

transition:background .2s ease, color .2s ease;
}

/* Hover */
.epqv-close:hover{
background:#000;
color:#fff;
}

/* Animation */
@keyframes epqvFade{
from{
opacity:0;
transform:translateY(20px) scale(.96);
}
to{
opacity:1;
transform:translateY(0) scale(1);
}
}

/* ========================================
   InSide Modal Css
   =====================================
   ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
*/

/* ========================================
   Product Image
======================================== */
#epqv-modal .cpab-product-image{
    position: relative;
    display: block;
    overflow: hidden;
    margin: 14px 14px 0;
    border-radius: 5px;
    background: #f8f8f8;
}

#epqv-modal .cpab-product-image img{
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform .45s ease, opacity .3s ease;
}

#epqv-modal .cpab-product-card:hover .cpab-product-image img{
    transform: scale(1.04);
}

/* ========================================
   Hero + Gallery
======================================== */
#epqv-modal .custom-product-gallery{
  width:100%;
}

/* باکس تصویر اصلی */
#epqv-modal .hero-image-wrapper.zoom-container{
  width:100%;
  aspect-ratio:1 / 1;
  overflow:hidden;
  position:relative;
  border-radius:15px;
  background:#fff;
  border:1px solid #eee;
  margin-bottom:15px;
  cursor:zoom-in;
}

/* خودِ تصویر اصلی */
#epqv-modal #mainProductImage{
  width:100%;
  height:100%;
  object-fit:contain;
  transition:transform 0.2s ease-out, opacity 0.3s ease;
  transform-origin:center center;
  pointer-events:none;
}

/* استایل تامبنیل‌ها */
#epqv-modal .thumb-gallery{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding-bottom:5px;
}

#epqv-modal .thumb{
  width:60px;
  height:60px;
  border-radius:8px;
  cursor:pointer;
  border:2px solid transparent;
  object-fit:cover;
  transition:0.3s;
}

/* نصفه کردن عکس چهارمی از گالری در موبایل */
@media (max-width:500px){
  #epqv-modal .thumb{
    width:60px;
    height:60px;
  }
}

#epqv-modal .thumb.active{
  border-color:#007cba;
}

/* فیکس ارتفاع در موبایل */
@media (max-width:768px){
  #epqv-modal .hero-image-wrapper.zoom-container{
    aspect-ratio:auto;
    height:min(360px, 80vw);
  }
}

/* استایل زوم مدرن */
#epqv-modal .hero-image-wrapper.zoom-container{
  position:relative;
  overflow:hidden;
  cursor:zoom-in;
  display:flex;
  align-items:center;
  justify-content:center;
}

#epqv-modal .hero-image-wrapper.zoom-container img{
  transition:transform 0.1s ease-out, opacity 0.3s ease;
  transform-origin:center center;
  width:100%;
  height:100%;
  object-fit:contain;
}

/* حالت زوم شده */
#epqv-modal .hero-image-wrapper.zoom-container.active img{
  transform:scale(2.5);
}

/* دکمه ذره‌بین */
#epqv-modal .zoom-expand-btn{
  position:absolute;
  bottom:15px;
  right:15px;
  background:rgba(255, 255, 255, 0.9);
  width:40px;
  height:40px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 4px 10px rgba(0,0,0,0.1);
  z-index:10;
  transition:0.3s;
  color:#333;
}

#epqv-modal .zoom-expand-btn:hover{
  background:var(--wc-primary, #007cba);
  color:#fff;
  transform:scale(1.1);
}

/* ===== Lightbox (Smooth Animation) ===== */
#epqv-modal .custom-lightbox{
  position:fixed;
  inset:0;
  z-index:99999;
  background-color:rgba(0,0,0,0.9);
  backdrop-filter:blur(5px);

  display:flex;
  align-items:center;
  justify-content:center;

  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .35s ease, visibility .35s ease;
}

#epqv-modal .custom-lightbox.active{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

#epqv-modal .lightbox-content{
  max-width:90%;
  max-height:90%;
  border-radius:8px;
  box-shadow:0 0 20px rgba(0,0,0,0.5);

  transform:scale(.92);
  opacity:0;
  transition:transform .35s ease, opacity .35s ease;
  will-change:transform, opacity;
}

#epqv-modal .custom-lightbox.active .lightbox-content{
  transform:scale(1);
  opacity:1;
}

#epqv-modal .close-lightbox{
  position:absolute;
  top:20px;
  right:35px;
  color:#fff;
  font-size:40px;
  font-weight:bold;
  cursor:pointer;
  transition:transform .2s ease, opacity .2s ease;
}

#epqv-modal .close-lightbox:hover{
  transform:scale(1.08);
}

/* غیرفعال کردن زوم Hover در موبایل */
@media (hover:none) and (pointer:coarse){
  #epqv-modal .hero-image-wrapper.zoom-container{
    cursor:default;
  }

  #epqv-modal #mainProductImage{
    transform:none !important;
  }

  #epqv-modal .hero-image-wrapper.zoom-container:hover #mainProductImage{
    transform:none !important;
  }
}

/* ========================================
   Product Categories
======================================== */
#epqv-modal .wc-cats{
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--scui-muted);
    font-weight: 500;
    letter-spacing: .2px;
}

#epqv-modal .wc-cats a,
#epqv-modal .wc-cats a:visited{
    color: var(--scui-muted) !important;
    text-decoration: none;
    transition: color .2s ease, opacity .2s ease;
}

#epqv-modal .wc-cats a:hover{
    color: var(--scui-muted-2) !important;
}

/* ========================================
   Product Title
======================================== */
#epqv-modal .wc-custom-product-title {
    font-size: 22px;
    font-weight: 700;
}

#epqv-modal .wc-custom-product-title-link {
    color: #000;
    text-decoration: none;
}

#epqv-modal .wc-custom-product-title-link:hover {
    color: #e63946;
}

#epqv-modal .wc-custom-product-title {
    text-align: center;
    /* این خط باعث میشه عنوان قشنگ‌تر وسط بیاد */
    margin: 0px 0; 
}

/* ========================================
   Rating
======================================== */
#epqv-modal .wc-rating-box-custom{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:14px;
  margin-top: 5px;
}

/* stars container */
#epqv-modal .wc-rating-box-custom .stars{
  display:flex;
  flex-direction:row-reverse;
  gap:2px;
  line-height:1;
  padding-top:1px;
}

/* base star (خاکستری) */
#epqv-modal .wc-rating-box-custom .star{
  font-size:18px;
  line-height:1;
  color:#d1d5db !important;
  display:inline-block;
}

/* full star (زرد) */
#epqv-modal .wc-rating-box-custom .star.full{
  color:#f7a100 !important;
}

/* half star */
#epqv-modal .wc-rating-box-custom .star.half{
  color:#f7a100 !important;
  opacity:0.6;
}

/* text */
#epqv-modal .wc-rating-box-custom .review-count{
  color:#6b7280;
  text-decoration:none;
  font-size:13px;
  line-height:18px;
  padding-top:5px;
}

@media (max-width:900px){
#epqv-modal .wc-rating-box-custom .review-count{
    padding-top:0;
  }
}

#epqv-modal .wc-rating-box-custom .review-count:hover{
  color:#111;
}

/* ========================================
   Price
======================================== */
#epqv-modal .wc-price-box{
  display:flex;
  flex-direction:column;
  gap:0px; /* فاصله بین قیمت اصلی و تخفیف */
  margin-top: 10px;
  font-weight:700;
  line-height:1.1;
  padding: 0px;
}

/* مبلغ داخل قیمت */
#epqv-modal .wc-price-box .woocommerce-Price-amount{
  font-size:20px;
  margin: 0px;
}

/* قیمت اصلی (خط خورده) */
#epqv-modal .wc-price-box del{
  display:block;
  font-size:18px;
  color:var(--wc-gray);
  text-decoration:line-through;
  margin: 0px;
}

/* قیمت تخفیف خورده */
#epqv-modal .wc-price-box ins{
  display:block;
  font-size:32px;
  font-weight:700;
  color:var(--wc-accent);
  text-decoration:none;
  margin: 0px;
}

/* ========================================
   Stock Status
======================================== */
#epqv-modal .wc-stock{
  margin-top: 15px;
  padding:0;
  line-height:1.2;
}

#epqv-modal .wc-in-stock{
  color:#16a34a;
  font-weight:600;
  display:inline-block;
  margin:0px 0;
  padding: 0px;
}

#epqv-modal .wc-out-stock{
  color:#dc2626;
  font-weight:600;
  display:inline-block;
  margin:0px 0;
  padding: 0px;
}

/* Stock = فاصله دادن در موبایل از سمت راست */
@media (max-width:900px){
  #epqv-modal .wc-in-stock{
    margin-right:0px;
  }
}

/* ==============================
   Out Of Stock Badge
============================== */
#epqv-modal .cpab-product-image{
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 14px;
}

#epqv-modal .cpab-product-image.is-out-of-stock img{
    filter: grayscale(22%);
    opacity: .9;
}

#epqv-modal .ast-shop-product-out-of-stock{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: rgba(17, 24, 39, 0.78);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 14px;
    border-radius: 999px;
    line-height: 1;
    z-index: 3;
}

/* ========================================
   Add To Cart
======================================== */
/* باکس نگهدارنده دکمه */
#epqv-modal .wc-product-cart {
  background: #fff;
  border: 0;
  padding: 0;
  margin: 10px 0 0 !important;
  box-shadow: none;
  display: flex;
  justify-content: center;
  align-items: center;

}

/* خود دکمه - استفاده از .button برای پوشش تمام حالت‌ها */
#epqv-modal .wc-product-cart .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;

  background: #e5e7eb;
  border: 1px solid #d1d5db;
  color: #111827 !important;
  
  box-shadow: 0 4px 10px rgba(0,0,0,.06);
    
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all .25s ease;
}

/* اصلاح استایل در موبایل */
@media (max-width: 900px) {
  #epqv-modal .wc-product-cart .button {
    margin-top: 2px;
    width: 100%; /* در موبایل کمی عریض‌تر باشد بهتر است */
  }
}

/* حالت Hover */
#epqv-modal .wc-product-cart .button:hover{
  background: #dcdfe4;
  border-color: #c9ced6;
  color: #111827 !important;
  box-shadow: 0 6px 14px rgba(0,0,0,.08);
}

/* حالت Active */
#epqv-modal .wc-product-cart .button:active{
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

/* وقتی ناموجود شد */
#epqv-modal .wc-product-cart .stock.out-of-stock,
#epqv-modal .pm-cart .stock.out-of-stock{
  margin:0 !important;
  padding:12px 16px;
  min-height:48px;

  display:flex;
  align-items:center;
  justify-content:center;

  text-align:center;
  line-height:1.7;
  font-size:15px;
  font-weight:700;

  color:#991b1b;
  background:#F2F2F2;
  border:0px solid #fecaca;
  border-radius:10px;
}

/* ===== Quantity ===== */
#epqv-modal .quantity{
  display:flex;
  align-items:center;
  border:1px solid #e2e2e2;
  border-radius:10px;
  overflow:hidden;
  background:#f3f3f3;
  margin:6px auto 0;
  margin-bottom: 2px;
  justify-content:center;
}

/* input */
#epqv-modal .quantity .qty{
  width:42px;
  min-width:42px;
  max-width:42px;
  height:34px;
  border:none;
  text-align:center;
  font-size:14px;
  font-weight:500;
  background:#fff;
  color:#222;
  padding:0;
  margin:0;
}

/* حذف فلش‌ها */
#epqv-modal .quantity .qty::-webkit-outer-spin-button,
#epqv-modal .quantity .qty::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}

#epqv-modal .quantity .qty{
  -moz-appearance:textfield;
}

/* buttons */
#epqv-modal .quantity .plus,
#epqv-modal .quantity .minus{
  width:34px;
  height:34px;
  flex:1 1 34px;
  text-align:center;
  line-height:1;
  vertical-align:middle;
  border:none;
  background:#efefef;
  color:#444;
  font-size:16px;
  font-weight:600;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  margin:0;
  min-width:0;
  transition:background .2s ease,color .2s ease,transform .08s ease;
}

/* hover */
#epqv-modal .quantity .plus:hover,
#epqv-modal .quantity .minus:hover{
  background:#111;
  color:#fff;
}

/* active */
#epqv-modal .quantity .plus:active,
#epqv-modal .quantity .minus:active{
  transform:scale(.95);
}

/* reset */
#epqv-modal .quantity .plus,
#epqv-modal .quantity .minus{
  appearance:none;
  -webkit-appearance:none;
  border-radius:0;
  -webkit-tap-highlight-color:transparent;
}

#epqv-modal .quantity .plus:focus,
#epqv-modal .quantity .minus:focus{
  outline:none;
  box-shadow:none;
}

/* ========================================
   Excerpt
======================================== */
#epqv-modal .cpab-product-card .woocommerce-product-details__short-description,
#epqv-modal .cpab-product-card .cpab-product-excerpt{
    margin: 0 0 12px;
    color: var(--scui-muted-2);
    font-size: 14px;
    line-height: 1.9;
}

/* ========================================
   Link
======================================== */
#epqv-modal .wc_product_link_class{
  width: 100%;
  text-align: center;
  display: table;
  margin: 0px auto 0;
  margin-top: 12px;
  padding: 8px 18px;
  background: #f5f5f5;
  color: #333;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  border: 1px solid #e5e5e5;
  transition: all .2s ease;
}

#epqv-modal .wc_product_link_class:hover{
  background: #eee;
  color: #111;
}

/* ========================================
   Product Share
======================================== */
#epqv-modal .epqv-modal-content {
    display: flex;
    flex-direction: column; /* یا row بسته به چیدمان کلی */
    justify-content: center; /* وسط چین کردن عمودی */
    align-items: center;     /* وسط چین کردن افقی */
    width: 100%; /* اطمینان از اینکه عرض کامل را اشغال می کند */
}

/* این استایل برای خود بلاک اشتراک گذاری است */
#epqv-modal .wc-product-share {
    display: flex;
    gap: 10px;
    align-items: center; /* این برای وسط چین کردن آیکون ها نسبت به هم است */
    margin-top: 0px;
    margin-bottom: 20px;
    /* اضافه کردن این خط برای وسط چین کردن خود بلاک اشتراک گذاری در والد */
    justify-content: center; /* این خط را اضافه کنید */
    flex-wrap: wrap; /* اگر محتوا زیاد بود، به خط بعد برود */
}

/* استایل های آیکون ها */
#epqv-modal .wc-product-share .share-icon {
    display:flex;
    align-items:center;
    justify-content:center;
    width:36px;
    height:36px;
    border:1px solid #e2e2e2;
    border-radius:8px;
    background:#fff;
    color:#444;
    cursor:pointer;
    padding:0;
    text-decoration:none;
    margin-top: 0px;
}

#epqv-modal .wc-product-share .share-icon:hover{
    background:#f3f3f3;
}

#epqv-modal .wc-product-share svg{
    width:18px;
    height:18px;
    pointer-events:none;
}

/* عنوان اشتراک گذاری */
#epqv-modal .share-title{
    font-size:14px;
    color:#666;
    margin-right:6px;
    font-weight: bold;
}

/* موبایل */
@media (max-width: 768px) {
    
    #epqv-modal .wc-product-share {
        gap:5px
    }
    
    #epqv-modal .wc-product-share .share-icon {
        width:30px;
        height:30px;
    }
}

/* ========================================
   Soft Center Align Patch
======================================== */
#epqv-modal .cpab-product-card{
    text-align: center;
}

#epqv-modal .wc-cats,
#epqv-modal .cpab-product-title,
#epqv-modal .wc-rating-box-custom,
#epqv-modal .cpab-product-card .woocommerce-product-details__short-description,

#epqv-modal .cpab-product-card .cpab-product-excerpt,
#epqv-modal .wc-price-box,
#epqv-modal .wc-stock{
    text-align: center;
}

#epqv-modal .wc-rating-box-custom,
#epqv-modal .wc-price-box{
    justify-content: center;
}

#epqv-modal .wc-stock .wc-in-stock,
#epqv-modal .wc-stock .wc-out-stock{
    margin-inline: auto;
}