
/* ===============================
  عکس های صفحات داخل کتاب
================================ */
.view-inside-book-btn {
    margin-top: 18px;
    height:48px;
    padding: 8px 12px;
    background: #fafafa;
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight:500;
    transition:.25s;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 5px 3px 1px rgba(90, 100, 171, .13);
}

.view-inside-book-btn:hover {
    background: #fff;
}
.view-inside-book-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.view-inside-book-btn .btn-icon {
    width: 18px;
    height: 18px;
}    

/* مودال */
/* مودال اصلی */
.book-gallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden; /* جلوگیری از اسکرول داخل مودال */
}

/* تصویر */
.book-gallery-modal img {
    max-width: 90%;
    max-height: 70vh; /* فضای بیشتر برای نوارها */
    border-radius: 8px;
    transition: transform 0.3s ease; /* انیمیشن زوم */
    transform: scale(1); /* زوم اولیه */
}

/* نوار بالا */
.book-gallery-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px;
    display: flex;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.5); /* نیمه‌شفاف */
}

.book-gallery-close {
    font-size: 32px;
    color: #fff;
    cursor: pointer;
}

/* نوار پایین */
.book-gallery-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5); /* نیمه‌شفاف */
    gap: 20px; /* فاصله بین المان‌ها */
}

.book-gallery-nav {
    font-size: 30px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}

.book-gallery-zoom {
    font-size: 24px;
    background: none;
    border: 1px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: #fff;
    cursor: pointer;
}

.book-gallery-counter {
    font-size: 18px;
    color: #fff;
}

/* ===============================
   قسمت کارت های مشترک کتاب
================================ */

.book-product-card {
    display: grid;
    grid-template-columns: 210px 1fr 260px 220px;
    gap: 24px;
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 18px; /* فاصله ترجمه‌ها */
    box-shadow: 0 10px 34px rgba(0,0,0,0.06);
    align-items: start;
}

/*==== تصویر کتاب =====*/

.book-image-link{
    display:flex;
    align-items:center;
    justify-content:center;

    background:#fafafa;

    border:1px solid #ececec;

    border-radius:18px;

    padding:20px;

    overflow:hidden;

    cursor:pointer;

    transition:.25s;
}

.book-image-link img{

    display:block;

    width:100%;

    height:auto;

    object-fit:contain;

    transition:transform .25s;

}

.book-image-link:hover img{

    transform:scale(1.03);

}

/* روبان یشنهاد ما */

.book-image {
    position: relative;       /* خیلی مهم — روبان نسبت به این div定位 می‌شود */
    overflow: hidden;         /* برای اینکه قسمت‌های بیرون روبان بریده شود */
    border-radius: 8px;       /* اگر می‌خواهی گوشه‌های تصویر گرد باشد */
}

.book-image{
    display:flex;
    flex-direction:column;
}

.featured-ribbon {
    position: absolute;
    top: 14px;
    right: -50px;
    z-index: 10;
    background: #e91e63;        /* رنگ اصلی — مثلاً صورتی/قرمز جذاب */
    color: white;
    font-weight: 400;
    font-size: 12px;
    padding: 2px 50px;
    transform: rotate(45deg);
    transform-origin: center;
}


/* ستون اطلاعات کتاب */
.book-identity p {
    font-size: 14px;
    margin: 4px 0;
    color: #444;
}

.book-excerpt{
    margin-top:28px;
    padding-top:22px;
    border-top:1px solid #ececec;
    color:#555;
    font-size:15px;
    line-height:2;
}

/* امتیاز ستاره‌ای */
.book-rating {
    display: flex;
    gap: 4px;
    font-size: 18px;
    cursor: pointer;
}

.book-rating span {
    color: #ccc;
    transition: color .15s ease;
}

.book-rating span.active,
.book-rating span.hover {
    color: #f5a623;
}

.book-rating.rated {
    pointer-events: none;
    opacity: .9;
}

.book-rating-wrap{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:8px;
    margin-top:20px;
}

.book-rating-number {
    font-size: 13px;
    color: #555;
}
/* ستون مشخصات */
.book-specs ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    font-size: 14px;
}

.book-specs li {
    margin-bottom: 6px;
    color: #444;
}

.product-title{
    margin:0;
    font-size:2rem;
    font-weight:800;
    line-height:1.55;
    color:#181818;
}

.book-subtitle{
    margin-top:8px;
    color:#8a8a8a;
    font-size:.95rem;
    font-style:italic;
}

/* ===============================
   ستون افزودن به سبد خرید و اطلاع از موجودی
================================ */

/* ستون چهارم */
.book-col.book-buy{
    width:100%;
    min-width:0;
    padding:0;
}

/* باکس داخلی */
.book-buy .buy-box{
    margin-top:30px;

    padding:22px;
    border:1px solid #ececec;
    border-radius:18px;
    background:#fcfcfc;
}

/* بالای ستون: زودترین زمان ارسال */
.book-shipping-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding-top:18px;
    font-size: 14px;
    color: #000;
    margin-bottom: 12px;
}

.book-shipping-time img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

/* قیمت – دسکتاپ */
.book-price-box{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
    margin-bottom:18px;
}

.book-old-price{
    font-size:15px;
}

.book-new-price{
    font-size:25px;
    font-weight:700;
    color:#111;
}

.book-discount {
    background: #e53935;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}
/* ===== قیمت – دسکتاپ (فیکس قطعی) ===== */
@media (min-width: 769px) {

  .book-price-box {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas:
      "old old"
      "discount new";
    gap: 6px;
    justify-content: center;
    align-items: center;
  }

  .book-old-price {
    grid-area: old;
    text-align: center;
  }

  .book-discount {
    grid-area: discount;
    justify-self: end;
  }

  .book-new-price {
    grid-area: new;
    justify-self: start;
  }
}



/* دکمه‌های خرید و خبرم کن */
.action-box {
    width: 100%;
    display: flex;
    flex-direction: column;
}
.action-box .buy-btn {
    margin-top: auto;
}

.book-buy .buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 12px 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    transition: all .2s ease;
}

.out-of-stock-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: #e53935;
    font-weight: 500;
}

/* دکمه افزودن به سبد */
.add_to_cart_button {
    background: #e53935;
    color: #fff !important;
}

.add_to_cart_button:hover {
    background: #d32f2f;
}

/* دکمه خبرم کن */
.notify-btn {
    background: #f7c948;
    color: #fff !important;
}

.notify-btn:hover {
    background: #f1b400;

}

.book-buy .buy-btn.added img {
    display: none;
}

.book-buy .buy-btn.added .btn-loading {
    display: none;
}

.book-buy .buy-btn.added .btn-success {
    display: inline-flex;
}

.book-buy .buy-btn.added .btn-text {
    display: inline;
}
.btn-success {
    display: none;
}

/* Loading  - تایید افزودن به سبد خرید */
.btn-loading {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.buy-btn.loading {
    pointer-events: none;
    opacity: .8;
}

.buy-btn.loading img,
.buy-btn.loading .btn-text,
.buy-btn.loading .btn-icon {
    display: none;
}

.buy-btn.loading .btn-loading {
    display: block;
}
/* آیکون داخل دکمه سبد خرید */
.book-buy .buy-btn img,
.book-buy .btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    filter: brightness(0) invert(1);  /*سفید کردن آیکون دکه سبد خرید*/
}

.book-buy .btn-loading,
.book-buy .btn-success {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}


.buy-btn.added {
    background: #2e7d32 !important;
    color: #fff;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ستون خرید – Modal notify */

.notify-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.notify-box {
    background: #fff;
    width: 90%;
    max-width: 360px;
    padding: 20px;
    border-radius: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notify-box h3 {
    font-size: 16px;
    text-align: center;
}

.notify-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.notify-submit {
    background: #e53935;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
}

.notify-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 22px;
    cursor: pointer;
}
.added_to_cart.wc-forward {
    display: none !important;
}

/*---پیغام سبد خرید ایجکس در صفحه محصول ----*/
#custom-cart-notice{
    position: fixed;
    top: 20px;
    left: 20px;
    background: #2ecc71;
    color: #fff;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 999999;
    display: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

/*-----مودال سایر نویسندگان----*/
.simple-modal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.4);
    z-index:999999;
    align-items:center;
    justify-content:center;
}

.simple-modal-box{
    background:#fff;
    padding:20px;
    border-radius:8px;
    max-width:400px;
    width:90%;
    position:relative;
}

.simple-modal-close{
    position:absolute;
    top:8px;
    left:12px;
    cursor:pointer;
    font-size:18px;
}

/* ===============================
   NEW SINGLE PRODUCT CARD استایل جدید از این خط 
================================ */

.book-product-card{
    display:block;
    background:#fff;
    border-radius:20px;
    padding:32px;
    box-shadow:0 12px 35px rgba(0,0,0,.06);
}

.book-card-grid{
    display:grid;
    grid-template-columns:240px minmax(0,1fr) 300px;
    gap:28px;
    align-items:start;
}

.book-image{
    width:100%;
}

.book-identity{
    min-width:0;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
}

/* ===============================
   RESPONSIVE - MOBILE STYLES
================================ */

@media (max-width: 768px) {
    
    .book-product-card {
        display: block;
        padding: 20px 16px;
        margin-bottom: 24px;
        border-radius: 16px;
    }

    .book-card-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* ستون تصویر */
    .book-col.book-image {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .book-image-link {
        padding: 16px;
        border-radius: 16px;
    }

    .view-inside-book-btn {
        margin-top: 12px;
        font-size: 13px;
        height: 44px;
    }

    /* هویت کتاب */
    .book-col.book-identity {
        order: 2;
    }

    .product-title {
        font-size: 1.45rem;
        line-height: 1.4;
    }

    .book-subtitle {
        font-size: 0.95rem;
    }

    .book-rating-wrap {
        margin-top: 12px;
        margin-bottom: 16px;
    }

    .book-identity p {
        font-size: 13.5px;
        margin: 6px 0;
    }

    .book-excerpt {
        margin-top: 20px;
        padding-top: 18px;
        font-size: 14.5px;
        line-height: 1.8;
    }

    /* ستون خرید */
    .book-col.book-buy {
        order: 3;
    }

    .book-buy .buy-box {
        margin-top: 0;
        padding: 18px;
    }

    .book-price-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 16px;
    }

    .book-new-price {
        font-size: 26px;
    }

    .book-old-price {
        font-size: 15px;
    }

    /* دکمه جزئیات بیشتر (موبایل) */
    .mobile-details-btn {
        display: block;
        width: 100%;
        margin-top: 12px;
        padding: 12px 20px;
        background: #f8f9fa;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        font-size: 14.5px;
        color: #444;
        text-align: center;
        cursor: pointer;
    }

    /* مخفی کردن برخی المان‌ها در دسکتاپ */
    .book-product-card .book-specs {
        display: none; /* فقط داخل مودال نمایش داده بشه */
    }
}

/* ====================== TABLET ====================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .book-product-card {
        grid-template-columns: 200px 1fr 240px;
        gap: 20px;
        padding: 20px;
    }
    
    .book-card-grid {
        grid-template-columns: 220px minmax(0,1fr) 280px;
        gap: 24px;
    }
}

/* بهبود مودال گالری در موبایل */
@media (max-width: 768px) {
    .book-gallery-modal img {
        max-height: 65vh;
        max-width: 95%;
    }
    
    .book-gallery-bottom-bar {
        gap: 12px;
        padding: 12px;
    }
    
    .book-gallery-zoom {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}
