/* WPBCS Product Chart - AhanBox Child Theme */

/* اگر لایوت ووکامرس شما flex باشد، با wrap اجازه می‌دهیم نمودار به سطر بعدی برود */
body.ahanbox-has-wpbcs-chart.single-product div.product{
  flex-wrap: wrap;
}

.wpbcs-chart-fullrow{
  width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
  flex-basis: 100%;
  clear: both;
}

.wpbcs-chart-card{
  background:#fff;
  border:1px solid #eee;
  border-radius:14px;
  overflow:hidden;
  box-shadow:0 8px 24px rgba(0,0,0,.06);
  direction:rtl;
  margin:24px 0;
  width: 100%;
}

.wpbcs-chart-top{
  display:flex;
  gap:18px;
  padding:18px;
  /* برای اینکه نمودار سمت چپ و پنل مشخصات سمت راست مثل تصویر باشد */
  direction:ltr;
  flex-direction:row;
}

.wpbcs-chart-left{ flex: 1 1 65%; min-width: 0; direction:rtl; }
.wpbcs-chart-right{ flex: 0 0 35%; border-left:1px solid #eee; direction:rtl; }

.wpbcs-chart-title{
  text-align:center;
  font-weight:700;
  color:#1f2937;
  margin-bottom:10px;
}

.wpbcs-chart-wrap{
  position:relative;
  width:100%;
  aspect-ratio: 760 / 260;
  max-height: 320px;
}

.wpbcs-chart-svg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  direction:ltr; /* برای اعداد */
}


/* جلوگیری از عمودی شدن متن‌های SVG در اثر CSS های سراسری سایت */
.wpbcs-chart-svg text{
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  unicode-bidi: plaintext;
}


/* Force chart stroke visibility (prevent global SVG rules from hiding it) */
.wpbcs-chart-svg path{ stroke:#111827 !important; fill:none !important; }
.wpbcs-chart-svg circle{ fill:#111827 !important; }

/* Hide WooCommerce product meta (category/brand block) */
.woocommerce div.product .product_meta{ display:none !important; }

.wpbcs-chart-tooltip{
  position:absolute;
  z-index:10;
  background:#fff;
  border:1px solid #eee;
  border-radius:10px;
  padding:8px 10px;
  box-shadow:0 10px 30px rgba(0,0,0,.12);
  pointer-events:none;
  transform:translate(-50%,-120%);
  min-width:110px;
  text-align:center;
}
button.wpbcs-tab:hover {
    color: #ce0000;
}
.wpbcs-chart-tooltip:after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-7px;
  width:12px;
  height:12px;
  background:#fff;
  border-right:1px solid #eee;
  border-bottom:1px solid #eee;
  transform:translateX(-50%) rotate(45deg);
}

.wpbcs-chart-tooltip-price{ font-weight:700; color:#111827; }
.wpbcs-chart-tooltip-date{ font-size:12px; color:#6b7280; margin-top:2px; }

.wpbcs-chart-tabs{
  display:flex;
  gap:8px;
  justify-content:center;
  flex-wrap:wrap;
  margin-top:10px;
}

/* Mobile dropdown (styled native select) */
.wpbcs-range-mobile{
  display:none;
  position:relative;
  margin-top:12px;
  background:#f3f4f6;
  border-radius:14px;
  height:56px;
  overflow:hidden;
}

.wpbcs-range-mobile-ui{
  height:100%;
  display:flex;
  align-items:center;
  padding:0 16px;
  direction:ltr;
}

.wpbcs-range-chevron{
  font-size:20px;
  color:#9ca3af;
  line-height:1;
  margin-right:10px;
}

.wpbcs-range-selected{
  font-weight:700;
  color:#b91c1c;
  font-size:14px;
}

.wpbcs-range-divider{
  width:1px;
  height:60%;
  background:#e5e7eb;
  margin:0 14px;
}

.wpbcs-range-label{
  margin-left:auto;
  color:#6b7280;
  font-size:16px;
  font-weight:600;
  direction:rtl;
}

.wpbcs-range-select{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer;
}

.wpbcs-tab{
  border:0;
  background:#f3f4f6;
  color:#374151;
  padding:8px;
  border-radius:10px;
  cursor:pointer;
  font-size:13px;
}

.wpbcs-tab.is-active{
  background:#fbe4e4;
  color:#b91c1c;
}

.wpbcs-facts-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
      gap: 14px 50px;
}

.wpbcs-fact-label{
  color:#9ca3af;
  font-size:12px;
  margin-bottom:4px;
}

.wpbcs-fact-value{
  color:#334155;
  font-weight:600;
  font-size:14px;
}

.wpbcs-chart-bottom{
  display:flex;
  gap:16px;
  align-items:center;
  padding:14px 18px;
  background:#f3f4f6;
  border-top:1px solid #eee;
  /* برای اینکه ترتیب ستون‌ها از چپ به راست مثل تصویر باشد */
  direction:ltr;
}

.wpbcs-bottom-left{ flex:1 1 10%; direction:rtl; }
.wpbcs-bottom-mid{ flex:1 1 15%; direction:rtl; }
.wpbcs-bottom-right{ flex:1 1 20%; direction:rtl; }
/* 4th column: product category image (right-most) */
.wpbcs-bottom-cat {
    flex: 0 0 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
}

.wpbcs-bottom-cat-img {
    width: 100%;
    max-width: 120px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.wpbcs-bottom-small{ color:#6b7280; font-size:12px; margin-bottom:6px; }
.wpbcs-bottom-big{
  font-size:28px;
  font-weight:800;
  color:#111827;
}
.wpbcs-bottom-big span{ font-size:12px; font-weight:600; color:#6b7280; margin-right:6px; }

.wpbcs-kv{ color:#374151; font-size:13px; line-height:1.9; }
.wpbcs-kv span{ color:#6b7280; }

.wpbcs-diff-up{ color:#16a34a; }
.wpbcs-diff-down{ color:#dc2626; }
.wpbcs-diff-flat{ color:#6b7280; }

@media (max-width: 900px){
  .wpbcs-chart-top{ flex-direction: column-reverse;
        display: flex; }
  .wpbcs-chart-right{ 
    border-left: 0;
    border-bottom: 1px solid #eee;
    padding-left: 0;
    padding-bottom: 14px;}

  .wpbcs-chart-bottom{ flex-direction:column; align-items:stretch; }
  /* put the category image first on mobile */
  .wpbcs-bottom-cat {
      order: -1;
  }

  .wpbcs-bottom-cat-img {
      max-width: 160px;
      margin: 0 auto;
  }
  /* put the category image first on mobile */
.wpbcs-bottom-cat{ order: -1; }
.wpbcs-bottom-cat-img{ max-width: 160px; margin: 0 auto; }
/* put the category image first on mobile */
.wpbcs-bottom-cat{ order: -1; }
.wpbcs-bottom-cat-img{ max-width: 160px; margin: 0 auto; }
  /* on mobile: use dropdown instead of tabs */
  .wpbcs-chart-tabs{ display:none; }
  .wpbcs-range-mobile{ display:block; }
}

/* =========================================================
   Product layout: Stats (60%) right + Expert (25%) left
   ========================================================= */
.ahanbox-product-panels{
  direction: rtl;
  display:flex;
  gap:24px;
  align-items:flex-start;
  width:100%;
  margin:24px 0;
}

.ahanbox-product-panels .ahanbox-col-stats{
  flex:0 0 70%;
  max-width:70%;
}



/* داخل ستون، کارت نمودار نباید margin اضافی داشته باشد */
.ahanbox-product-panels .wpbcs-chart-card{ margin:0; }
.ahanbox-product-panels .wpbcs-chart-fullrow{ margin:0; }

/* باکس کارشناس */
.ahanbox-product-panels .sew-widget{
  width:100%;
  margin:0;
}

/* Safety: اگر جایی هنوز رندر شد، پنهان شود */
.woocommerce div.product .woocommerce-product-gallery{ display:none !important; }
.woocommerce div.product p.price,
.woocommerce div.product span.price{ display:none !important; }
.woocommerce div.product form.cart{ display:none !important; }
.woocommerce div.product div.summary{ width:100% !important; float:none !important; }

@media (max-width: 900px){
  
  .ahanbox-product-panels .ahanbox-col-stats,
  .ahanbox-product-panels .ahanbox-col-expert{
    flex:0 0 100%;
    max-width:100%;
  }
  .ahanbox-col-expert {
    display: flex;
    width: 100%;
    justify-content: space-around;
}

/* Expert placement: desktop in sidebar, mobile after description */
.ahanbox-expert-mobile{ display:none; }

@media (max-width: 900px){
  .ahanbox-expert-desktop{ display:none !important; }
  .ahanbox-expert-mobile{ display: flex;
    margin: 24px 0;
    justify-content: space-around; }
  .ahanbox-expert-mobile .sew-widget{ margin:0; }
}
.ahanbox-col-expert {
    margin-top: 0px!important;
    width: 100%;
}
}

/* Override full-row behavior inside our two-column layout */
.ahanbox-product-panels .wpbcs-chart-fullrow{
  width:100%;
  max-width:100%;
  flex:0 0 auto;
  flex-basis:auto;
  clear:none;
}

/* =========================
   Weekly price history (SEO box) - full width
   ========================= */
.ahanbox-weekly-history-box {
    width: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 18px;
    margin: 18px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
    direction: rtl;
}

.ahanbox-weekly-history-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.ahanbox-weekly-history-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #1f2937;
}

.ahanbox-weekly-history-sub {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.8;
}

.ahanbox-weekly-history-empty {
    color: #6b7280;
    font-size: 13px;
    padding: 10px 2px 2px;
}

.ahanbox-weekly-history-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ahanbox-weekly-history-row {
    display: grid;
    grid-template-columns: 120px 1fr 210px;
    /* day | date | price */
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
   
}
/* State: missing price (soft red theme) */


.ahanbox-weekly-history-row.is-missing .ahanbox-weekly-history-price {
    color: #33467e;
    font-weight: 700;
}


.ahanbox-weekly-history-row.is-changed .ahanbox-weekly-history-price {
    color: #1d4ed8;
    font-weight: 800;
}
.ahanbox-weekly-history-row:hover {
    border-color: #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.ahanbox-weekly-history-row.is-head {
    border: none;
    background: transparent;
    padding: 0 6px 4px;
}

.ahanbox-weekly-history-row.is-head .ahanbox-weekly-history-day,
.ahanbox-weekly-history-row.is-head .ahanbox-weekly-history-date,
.ahanbox-weekly-history-row.is-head .ahanbox-weekly-history-price {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.ahanbox-weekly-history-day {
    font-weight: 800;
    color: #111827;
}
/* Today badge */
.ahanbox-weekly-history-badge {
display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 800;
    margin-right: 6px;
    background: #eef2ff;
    color: #00b27b;
}

/* Row highlight for today */
.ahanbox-weekly-history-row.is-today {
    border-color: #c7d2fe;

}
.ahanbox-weekly-history-date {
    color: #64748b;
    font-size: 14px;
}

.ahanbox-weekly-history-price {
text-align: left;
    font-weight: 600;
    color: #374158;
    direction: ltr;
}

.ahanbox-weekly-history-price.is-missing {
    color: #9ca3af;
    font-weight: 700;
    direction: rtl;
}

@media (max-width: 900px) {
    .ahanbox-weekly-history-row {
        grid-template-columns: 110px 1fr;
        grid-template-areas:
            "day date"
            "price price";
        row-gap: 8px;
    }

    .ahanbox-weekly-history-day {
        grid-area: day;
    }

    .ahanbox-weekly-history-date {
        grid-area: date;
        text-align: left;
    }

    .ahanbox-weekly-history-price {
        grid-area: price;
    }

    .ahanbox-weekly-history-row.is-head {
        display: none;
    }
}
/* =========================
   Product Title (custom) + icon
   ========================= */
.ahanbox-product-title-wrap{
  width:100%;
  margin: 18px 0 12px;
}
.ahanbox-product-title-row{
  display:flex;
  align-items:center;
  gap:5px;
  direction:rtl;
      margin-right: 45px;
}
.ahanbox-col-expert {
    margin-top: -110px;
    width: 100%;
}
.ahanbox-product-title-icon{
  display:inline-flex;
  width:22px;
  height:22px;
  transform: translateY(2px);
}
.ahanbox-product-title{
margin: 0;
    color: #BF0413;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.25;
}
.breadcrumb-trail a {
    color: #BBBDBF;
}
.breadcrumb-trail {
    font-size: 15px;
    color: #929498;
}
/* =========================
   Description + Reviews (no tabs)
   ========================= */
.woocommerce div.product .woocommerce-tabs{ display:none !important; }

.ahanbox-product-description,
.ahanbox-product-reviews{
  width:100%;
  background:#fff;
  border:1px solid #eee;
  border-radius:14px;
  padding:24px;
  margin: 18px 0;
  box-shadow:0 8px 24px rgba(0,0,0,.06);
}

.ahanbox-product-description h2,
.ahanbox-product-description h3{
  margin-top:0;
}

@media (max-width: 900px){
  .ahanbox-product-title{ font-size:18px; }
  .ahanbox-product-title-wrap {
    width: 100%;
    margin: 0px!important;
}
.ahanbox-product-title-row {
    margin-right: 0px!important;
}
.breadcrumb-trail {
    font-size: 10px;
    color: #929498;
}
}

/* =========================
   AhanBox Reviews UI (Product)
   ========================= */
.ahanbox-reviews{ direction:rtl; }

.ahanbox-review-form-head{
  display:flex;
  align-items:center;
  justify-content:flex-start; /* RTL: start = right */
  gap:14px;
  margin-bottom:18px;
}
.ahanbox-review-form-icon{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.ahanbox-review-form-icon svg{
  width:56px;
  height:56px;
}
.ahanbox-review-form .comment-reply-title{
  margin:0;
  font-size:22px;
  font-weight:800;
  color:#1f2937;
}

.ahanbox-comment-form{
  margin-top:6px;
}

/* Status notice (after submit / pending moderation) */
.ahanbox-review-notice{
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
}
.ahanbox-review-notice.is-success{
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.ahanbox-review-notice.is-pending{
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.ahanbox-review-row{
  display:flex;
  gap:18px;
}
.ahanbox-comment-form input[type="text"],
.ahanbox-comment-form input[type="tel"],
.ahanbox-comment-form input[type="email"],
.ahanbox-comment-form input[type="url"],
.ahanbox-comment-form textarea{
  width:100%;
  background:#f3f4f6;
  border:0;
  border-radius:14px;
  padding:14px 16px;
  font-size:14px;
  outline:none;
  color:#111827;
}
.ahanbox-comment-form textarea{
  min-height:220px;
  resize:vertical;
}

.ahanbox-hidden{ display:none !important; }

.ahanbox-comment-form .form-submit{
  margin-top:14px;
}
.ahanbox-review-submit{
  background:#BF0413;
  color:#fff;
  border:0;
  border-radius:14px;
  padding:14px 22px;
  font-weight:800;
  font-size:16px;
  min-width:200px;
  cursor:pointer;
}
.ahanbox-review-submit:hover{ filter:brightness(.95); }

/* try to keep captcha row aligned nicely if a captcha plugin adds fields */
.ahanbox-comment-form p{
  margin:0 0 14px;
}
.ahanbox-comment-form .comment-form-comment{ margin-bottom:14px; }

/* Divider */
.ahanbox-reviews-divider{
  height:1px;
  background:#e5e7eb;
  margin:18px 0;
}

/* Heading "دیدگاه کاربران" + count */
.ahanbox-reviews-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:14px 0 10px;
}
.ahanbox-reviews-heading-title{
  font-size:20px;
  font-weight:900;
  color:#1f2937;
}
.ahanbox-reviews-heading-count{
  font-size:18px;
  font-weight:900;
  color:#BF0413;
}

/* Comment list items */
.ahanbox-reviews-list{ margin-top:6px; }
.ahanbox-review-item{
  padding:18px 0;
  border-bottom:1px solid #eef0f2;
}
.ahanbox-review-item:last-child{ border-bottom:0; }

.ahanbox-review-text{
  font-size:14px;
  line-height:2.1;
  color:#374151;
}

.ahanbox-review-meta{
  display:flex;
  align-items:center;
  gap:10px;
  color:#6b7280;
  font-size:13px;
  white-space:nowrap;
  justify-content:flex-start;
  margin-top:14px;
}
.ahanbox-review-author{
  color:#374151;
  font-weight:800;
}
.ahanbox-review-avatar{
  display:inline-flex;
  align-items:center;
}
.ahanbox-review-avatar svg{
  width:22px;
  height:22px;
}

.ahanbox-review-reply{
  margin-top:10px;
  text-align:left;
}

.ahanbox-review-reply a{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:#9ca3af;
  text-decoration:none;
  font-weight:700;
}
.ahanbox-review-reply a:hover{ color:#6b7280; }
.ahanbox-reply-ic svg{
  width:20px;
  height:20px;
}

/* Replies indentation + guide line */
.ahanbox-review-item.depth-2,
.ahanbox-review-item.depth-3{
  border-bottom:0;
  padding-bottom:0;
}
.ahanbox-review-item.depth-2{
  margin-right:28px;
  padding-right:18px;
  border-right:2px solid #e5e7eb;
}
.ahanbox-review-item.depth-3{
  margin-right:52px;
  padding-right:18px;
  border-right:2px solid #e5e7eb;
}

/* Mobile */
@media (max-width: 900px){
  .ahanbox-review-row{ flex-direction:column; gap:12px; }
  .ahanbox-review-form-icon svg{ width:50px; height:50px; }
  .ahanbox-review-form .comment-reply-title{ font-size:18px; }
  .ahanbox-reviews-heading-title{ font-size:16px; }
  .ahanbox-reviews-heading-count{ font-size:16px; }
  .ahanbox-review-submit{ width:100%; min-width:0; }
}
