/* ==========================================================
   TNTBook Amazon-Style Product Sections v3.0
   ========================================================== */

.tntb-amz-section {
    margin: 30px auto;
    padding: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.tntb-amz-section .tntb-amz-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    background: var(--tnt-theme, #146EB4);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ===== هدر رنگی (متن سفید) ===== */
html body .tntb-amz-section .tntb-amz-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 14px 20px !important;
    margin: 0 !important;
    background: var(--tnt-theme, #146EB4) !important;
    border-bottom: none !important;
}

html body .tntb-amz-section .tntb-amz-header .tntb-amz-title {
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: inherit;
    line-height: 1.4 !important;
    background: transparent !important;
    border: none !important;
    display: block !important;
}

html body .tntb-amz-section .tntb-amz-header .tntb-amz-more {
    color: #FFFFFF !important;
    text-decoration: none !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    white-space: nowrap;
    transition: opacity 0.2s;
    background: transparent !important;
    padding: 4px 10px !important;
    border: 1px solid rgba(255,255,255,0.4) !important;
    border-radius: 4px;
    display: inline-block !important;
}

html body .tntb-amz-section .tntb-amz-header .tntb-amz-more:hover {
    background: rgba(255,255,255,0.15) !important;
    text-decoration: none !important;
}

/* ===== باکس اسلایدر (همان رنگ هدر) ===== */
.tntb-amz-slider-box {
    position: relative;
    padding: 15px 8px;
    background: var(--tnt-theme, #146EB4);
}

.tntb-amz-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 5px 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tntb-amz-slider::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
}

/* ===== کارت محصول: سفید مثل آمازون ===== */
.tntb-amz-card {
    flex: 0 0 180px;
    scroll-snap-align: start;
    background: #ffffff;
    border: 1px solid #e7e7e7;
    border-radius: 6px;
    padding: 12px;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.tntb-amz-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.tntb-amz-card-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    margin-bottom: 10px;
    overflow: hidden;
    text-decoration: none;
    background: #fff;
}

.tntb-amz-card-img img {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s;
}

.tntb-amz-card:hover .tntb-amz-card-img img {
    transform: scale(1.04);
}

.tntb-amz-card-title {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 4px 0;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: right;
    padding: 0;
}

.tntb-amz-card-title a {
    color: #0F1111;
    text-decoration: none;
    font-weight: 500;
}

.tntb-amz-card-title a:hover {
    color: #C7511F;
    text-decoration: underline;
}

.tntb-amz-card-publisher {
    font-size: 0.75rem;
    color: #565959;
    margin: 4px 0 0 0;
    padding: 0;
    text-align: right;
    line-height: 1.3;
    font-weight: 400;
}

/* ===== دکمه‌های ناوبری ===== */
.tntb-amz-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    background: rgba(255,255,255,0.95);
    border: 1px solid #d5d9d9;
    border-radius: 4px;
    font-size: 32px;
    line-height: 1;
    color: #0F1111;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
    padding: 0;
    font-weight: bold;
    user-select: none;
}

.tntb-amz-nav:hover:not([disabled]) {
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.tntb-amz-nav-prev { right: 8px; }
.tntb-amz-nav-next { left: 8px; }

.tntb-amz-nav[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== بخش خالی ===== */
.tntb-amz-empty {
    padding: 40px 20px;
    text-align: center;
    color: #ffffff;
    background: var(--tnt-theme, #146EB4);
}

.tntb-amz-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
    opacity: 0.9;
}

.tntb-amz-empty p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 992px) {
    html body .tntb-amz-section .tntb-amz-header .tntb-amz-title { font-size: 1.1rem !important; }
    .tntb-amz-card { flex: 0 0 160px; }
    .tntb-amz-card-img { height: 180px; }
    .tntb-amz-card-img img { max-height: 180px; }
}

@media (max-width: 640px) {
    .tntb-amz-section .tntb-amz-wrap { border-radius: 6px; }
    html body .tntb-amz-section .tntb-amz-header { padding: 10px 14px !important; }
    html body .tntb-amz-section .tntb-amz-header .tntb-amz-title { font-size: 1rem !important; }
    html body .tntb-amz-section .tntb-amz-header .tntb-amz-more { font-size: 0.75rem !important; padding: 3px 8px !important; }
    .tntb-amz-card { flex: 0 0 140px; padding: 8px; }
    .tntb-amz-card-img { height: 150px; margin-bottom: 8px; }
    .tntb-amz-card-img img { max-height: 150px; }
    .tntb-amz-card-title { font-size: 0.78rem; height: 36px; }
    .tntb-amz-card-publisher { font-size: 0.7rem; }
    .tntb-amz-nav { width: 32px; height: 48px; font-size: 24px; }
}

/* ===== Override: کارت‌ها همیشه سفید با متن تیره ===== */
html body .tntb-amz-section .tntb-amz-card {
    background: #ffffff !important;
    border: 1px solid #e7e7e7 !important;
}

html body .tntb-amz-section .tntb-amz-card .tntb-amz-card-img {
    background: #ffffff !important;
}

html body .tntb-amz-section .tntb-amz-card .tntb-amz-card-title,
html body .tntb-amz-section .tntb-amz-card .tntb-amz-card-title a {
    color: #0F1111 !important;
    background: transparent !important;
}

html body .tntb-amz-section .tntb-amz-card .tntb-amz-card-title a:hover {
    color: #C7511F !important;
}

html body .tntb-amz-section .tntb-amz-card .tntb-amz-card-publisher {
    color: #565959 !important;
    background: transparent !important;
}

/* ===== اصلاحات نهایی: padding و فاصله متن ===== */

/* هدر: padding کمتر (شبیه آمازون) */
html body .tntb-amz-section .tntb-amz-header {
    padding: 10px 16px !important;
}

/* عنوان کتاب: فاصله از راست */
html body .tntb-amz-section .tntb-amz-card .tntb-amz-card-title {
    padding-right: 8px !important;
    padding-left: 4px !important;
}

/* نام ناشر: فاصله از راست */
html body .tntb-amz-section .tntb-amz-card .tntb-amz-card-publisher {
    padding-right: 8px !important;
    padding-left: 4px !important;
}

/* کارت: padding بهتر */
html body .tntb-amz-section .tntb-amz-card {
    padding: 10px 8px 12px 8px !important;
}

/* ===== کاهش فاصله بین هدر و کارت‌ها ===== */
html body .tntb-amz-section .tntb-amz-slider-box {
    padding: 6px 8px 12px 8px !important;
}

html body .tntb-amz-section .tntb-amz-slider {
    padding: 2px 8px !important;
}
