/* ============================================================
   SMP VIEW BOOK — Style v2.0
   ============================================================ */

/* ── CONTAINER TỔNG ── */
.smp-book-container {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    background: #fff;
    padding: 28px;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── CỘT TRÁI: ẢNH ── */
.smp-book-left {
    flex: 0 0 38%;
    max-width: 38%;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Khung ảnh chính */
.smp-main-image-holder {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f8f8;
    border: 1px solid #ececec;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    position: relative;
    margin-bottom: 12px;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
}

#smp-main-product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform .35s ease, opacity .2s;
}

.smp-main-image-holder:hover #smp-main-product-img {
    transform: scale(1.03);
}

/* Lightbox hint */
.smp-main-image-holder::after {
    content: '🔍';
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-size: 18px;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
.smp-main-image-holder:hover::after { opacity: .7; }

/* Gallery thumbnails */
.smp-image-gallery-wrapper {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 2px;
}

.smp-gallery-thumb-item {
    width: 64px;
    height: 64px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .2s, transform .2s, box-shadow .2s;
    background: #fafafa;
    flex-shrink: 0;
}
.smp-gallery-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s;
}
.smp-gallery-thumb-item:hover {
    border-color: #2271b1;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(34,113,177,.2);
}
.smp-gallery-thumb-item:hover img { transform: scale(1.08); }
.smp-gallery-thumb-item.smp-active-thumb {
    border-color: #d63638;
    box-shadow: 0 0 0 3px rgba(214,54,56,.15);
}

/* ── CỘT PHẢI: THÔNG TIN ── */
.smp-book-right {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.smp-book-right h1 {
    margin: 0 0 10px 0;
    font-size: 24px;
    line-height: 1.35;
    color: #1a1a1a;
    font-weight: 800;
}

/* Rating */
.smp-rating-ui {
    color: #ffb400;
    font-size: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.smp-rating-ui span { color: #888; font-size: 12px; font-weight: normal; }

/* Intro box */
.smp-intro-box {
    background: linear-gradient(135deg,#f0f7ff 0%,#f8f0ff 100%);
    border-left: 4px solid #2271b1;
    padding: 14px 16px;
    margin: 12px 0;
    font-style: italic;
    color: #444;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.7;
}

/* Combo box */
.smp-linked-books-box {
    margin: 0 0 14px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg,#fffbf0,#fff8e6);
    border-left: 4px solid #f0ad4e;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
}

/* Price */
.smp-price-highlight {
    font-size: 22px;
    color: #d63638;
    font-weight: 800;
    margin: 14px 0 12px;
    display: block;
    letter-spacing: -.3px;
}

/* Custom fields grid */
.smp-custom-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    border-top: 1px solid #f0f0f0;
    padding-top: 14px;
    margin-top: 14px;
    margin-bottom: 18px;
}
.smp-field-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #444;
    background: #fafafa;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
}
.smp-field-item .dashicons { color: #2271b1; font-size: 15px; flex-shrink: 0; }

/* ── ACTIONS ── */
.smp-actions {
    display: block !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
    gap: unset !important;
    margin-top: 20px;
}

/* MUA NGAY */
.smp-actions .smp-btn-buy {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
    font-size: 17px !important;
    padding: 15px 20px !important;
    border-radius: 10px !important;
    letter-spacing: .5px;
    box-shadow: 0 4px 16px rgba(214,54,56,.35);
    transition: transform .15s, box-shadow .15s !important;
    margin-bottom: 0 !important;
    position: relative;
    overflow: hidden;
}
.smp-actions .smp-btn-buy::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,.12), transparent);
    pointer-events: none;
}
.smp-actions .smp-btn-buy:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(214,54,56,.45) !important;
}

/* Bonus box */
.smp-bonus-box {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1.5px dashed #d63638;
    background: linear-gradient(135deg,#fff5f5,#fff);
    border-radius: 8px;
}

/* Hàng nút phụ */
.smp-row-secondary {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}
.smp-row-secondary .smp-btn {
    flex: 1 !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    font-size: 13px !important;
    padding: 12px 10px !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    transition: transform .15s, box-shadow .15s !important;
}
.smp-row-secondary .smp-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* Nút cơ bản */
.smp-btn { text-decoration: none !important; font-weight: 700; transition: 0.2s; }
.smp-btn-buy     { background: #d63638; color: #fff !important; }
.smp-btn-preview { background: #673ab7; color: #fff !important; cursor: pointer; }
.smp-btn-consult { background: #2271b1; color: #fff !important; }

/* ── MODAL TƯ VẤN ── */
.smp-consult-modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 999998;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.smp-consult-modal-bg.open { display: flex; }
.smp-consult-modal {
    background: #fff;
    border-radius: 14px;
    padding: 28px 30px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0,0,0,.28);
    position: relative;
    animation: smpModalIn .25s ease;
}
@keyframes smpModalIn {
    from { opacity:0; transform:translateY(20px) scale(.97); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}
.smp-consult-modal h3 {
    margin: 0 0 6px;
    color: #2271b1;
    font-size: 20px;
}
.smp-consult-modal .sub {
    color: #666;
    font-size: 13px;
    margin: 0 0 20px;
    line-height: 1.5;
}
.smp-consult-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    transition: color .2s;
}
.smp-consult-close:hover { color: #d63638; }

/* ── NỘI DUNG GIỚI THIỆU ── */
.smp-main-content-section {
    margin-top: 36px;
    padding: 26px 28px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eee;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.smp-main-content-section h3 {
    border-bottom: 2px solid #2271b1;
    display: inline-block;
    padding-bottom: 5px;
    margin: 0 0 18px 0;
    text-transform: uppercase;
    font-size: 17px;
    color: #1a1a1a;
}
.smp-content-body { line-height: 1.85; color: #333; font-size: 15px; }

/* ── TÁC GIẢ ── */
.smp-author-section {
    margin-top: 36px;
    padding: 24px 26px;
    background: linear-gradient(135deg,#f8fbff,#fff);
    border-radius: 14px;
    border: 1px dashed #c8d8ea;
}

/* ── VIDEO ── */
.smp-video-section { margin-top: 36px; }
.smp-video-section h4 {
    margin: 0 0 16px 0;
    border-bottom: 2px solid #2271b1;
    display: inline-block;
    padding-bottom: 5px;
    font-size: 17px;
    text-transform: uppercase;
}
.smp-video-layout {
    display: flex;
    gap: 20px;
    background: #f5f7fa;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid #e8eaf0;
}
.smp-video-playlist { flex: 0 0 28%; max-height: 420px; overflow-y: auto; padding-right: 6px; }
.smp-video-nav-item {
    padding: 10px 12px;
    background: #fff;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    font-size: 13px;
    transition: .25s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.smp-video-nav-item:hover  { background: #e8f0fb !important; border-color: #2271b1 !important; }
.smp-video-nav-item.active { background: #e1eeff !important; border-color: #2271b1 !important; }

/* ── FEEDBACK ── */
.smp-feedback-section {
    margin-top: 36px;
    padding: 26px 28px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.smp-feedback-section h3 {
    border-bottom: 2px solid #ffba00;
    display: inline-block;
    padding-bottom: 5px;
    margin: 0 0 18px 0;
    font-size: 17px;
    text-transform: uppercase;
}
.comment-item {
    background: #fcfcfc;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    margin-bottom: 10px;
    transition: border-color .2s;
}
.comment-item:hover { border-color: #d0d0d0; }

#smp-comment-form-wrapper .submit {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    transition: .25s;
    font-size: 14px;
}
#smp-comment-form-wrapper .submit:hover { background: #d63638; }

/* ── LIGHTBOX ── */
.smp-lightbox-bg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 9999999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.smp-lightbox-bg.open { display: flex; }
.smp-lightbox-bg img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 0 60px rgba(0,0,0,.8);
    cursor: default;
    animation: smpLbIn .2s ease;
}
@keyframes smpLbIn { from{opacity:0;transform:scale(.94)} to{opacity:1;transform:scale(1)} }
.smp-lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    opacity: .8;
    background: none;
    border: none;
    z-index: 10000000;
}
.smp-lightbox-close:hover { opacity: 1; color: #d63638; }

/* ── STAR RATING INPUT ── */
.smp-stars input { display: none; }
.smp-stars label { font-size: 28px; color: #ddd; cursor: pointer; transition: color .2s; }
.smp-stars input:checked ~ label,
.smp-stars label:hover,
.smp-stars label:hover ~ label { color: #ffba00; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .smp-book-container  { flex-direction: column !important; padding: 16px; gap: 20px; }
    .smp-book-left       { flex: 0 0 100% !important; max-width: 100% !important; }
    .smp-main-image-holder { aspect-ratio: 4/3; }
    .smp-custom-fields   { grid-template-columns: 1fr; }
    .smp-video-layout    { flex-direction: column-reverse; }
    .smp-video-playlist  { flex: 1; max-height: 220px; }
    .smp-main-content-section,
    .smp-feedback-section,
    .smp-author-section  { padding: 16px; }
}
@media (max-width: 480px) {
    .smp-row-secondary   { flex-direction: column !important; }
    .smp-book-right h1   { font-size: 20px; }
    .smp-price-highlight { font-size: 19px; }
}
