/* ==========================================================================
   BẢO TÍN JSC - SERVICE DETAIL (GIAO DIỆN DỊCH VỤ KỸ THUẬT CÔNG NGHIỆP)
   Phong cách: Gọn gàng, thực tế, tối giản, ít padding/margin, không viền bo màu mè
   ========================================================================== */

:root {
    --bt-primary: #1d4ed8;
    --bt-primary-hover: #1e40af;
    --bt-accent: #d97706;
    --bt-dark: #1e293b;
    --bt-body: #334155;
    --bt-muted: #64748b;
    --bt-border: #e2e8f0;
    --bt-border-light: #f1f5f9;
}

/* Wrapper toàn trang: Nền trắng sạch, không nền xám card */
.service-detail-wrapper {
    background-color: #ffffff;
    padding: 0 0 30px;
    color: var(--bt-body);
    font-size: 14.5px;
    line-height: 1.65;
}

.service-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 15px 0;
}

/* Breadcrumb: Tối giản, không khung, không viền, không bo góc */
.service-breadcrumb {
    background: transparent;
    padding: 6px 0 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--bt-border-light);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
}

.service-breadcrumb a {
    color: var(--bt-muted);
    text-decoration: none;
}

.service-breadcrumb a:hover {
    color: var(--bt-primary);
    text-decoration: underline;
}

.service-breadcrumb .separator {
    color: #cbd5e1;
    font-size: 11px;
}

.service-breadcrumb .current {
    color: var(--bt-dark);
    font-weight: 600;
}

/* Banner riêng dịch vụ (Tỷ lệ 19:6 full trang web) */
.service-top-banner {
    width: 100%;
    aspect-ratio: 19 / 6;
    overflow: hidden;
    border-bottom: 1px solid var(--bt-border);
    background: #f8fafc;
    margin: 0;
}

.service-top-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Bố cục 2 cột: Cột trái 250px, Cột phải tự do */
.service-grid-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

/* ==========================================================================
   SIDEBAR (CỘT TRÁI): Tối giản, phẳng, sticky khi cuộn, không thanh scroll, ẩn trên mobile
   ========================================================================== */
.service-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: -webkit-sticky;
    position: sticky;
    top: 65px;
    align-self: start;
}

.sidebar-box {
    background: #ffffff;
    border: 1px solid var(--bt-border);
    border-radius: 0;
}

.sidebar-box-header {
    background: var(--bt-primary);
    color: #ffffff;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-box-header.accent {
    background: #f59e0b;
    color: #ffffff;
}

.sidebar-box-header h3 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
}

/* Danh mục Sidebar */
.sidebar-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-cat-list li {
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-cat-list li:last-child {
    border-bottom: none;
}

.sidebar-cat-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    color: var(--bt-dark);
    text-decoration: none;
    font-size: 13px;
}

.sidebar-cat-list li a:hover,
.sidebar-cat-list li.active a {
    background: #f8fafc;
    color: var(--bt-primary);
    font-weight: 600;
    padding-left: 15px;
}

.sidebar-cat-list li a i {
    font-size: 10px;
    color: #94a3b8;
}

/* Hotline & Hỗ trợ */
.sidebar-contact-body {
    padding: 12px;
}

.sidebar-hotline-num {
    font-size: 18px;
    font-weight: 800;
    color: #dc2626;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    text-align: center;
}

.sidebar-hotline-num:hover {
    color: #b91c1c;
}

.sidebar-action-btn {
    display: block;
    text-align: center;
    padding: 8px 10px;
    background: #0088ff;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 2px;
    margin-bottom: 10px;
}

.sidebar-action-btn:hover {
    background: #0066cc;
    color: #ffffff;
}

.sidebar-commit-list {
    list-style: none;
    margin: 0;
    padding: 8px 0 0;
    border-top: 1px dashed var(--bt-border);
    font-size: 12.5px;
    line-height: 1.5;
}

.sidebar-commit-list li {
    margin-bottom: 5px;
    color: var(--bt-muted);
}

.sidebar-commit-list li i {
    color: #16a34a;
    margin-right: 5px;
}

/* Thông tin liên hệ */
.sidebar-info-body {
    padding: 10px 12px;
    font-size: 12.5px;
    line-height: 1.5;
}

.sidebar-info-body p {
    margin: 0 0 8px;
}

.sidebar-info-body p:last-child {
    margin: 0;
}

/* ==========================================================================
   CỘT PHẢI: NỘI DUNG CHÍNH (Phẳng, không đóng khung card, không bo viền)
   ========================================================================== */
.service-main-content {
    background: #ffffff;
    padding: 0;
}

/* Tiêu đề H1: Rõ ràng, dứt khoát, không màu mè */
.service-header {
    margin-bottom: 14px;
    border-bottom: 2px solid var(--bt-primary);
    padding-bottom: 6px;
}

.service-title-h1 {
    font-size: 23px;
    font-weight: 800;
    color: #1e3a8a;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.3;
}

/* ==========================================================================
   SHOWCASE GALLERY (Ảnh lớn bên trái + Dải ảnh nhỏ bên phải - Sát mép, ít padding)
   ========================================================================== */
.service-showcase-gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 10px;
    margin-bottom: 16px;
    border: 1px solid var(--bt-border);
    padding: 6px;
}

/* Khung ảnh chính lớn */
.service-main-image-wrap {
    position: relative;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
    max-height: 440px;
    cursor: pointer;
    overflow: hidden;
}

.service-main-image-wrap img {
    width: 100%;
    height: 100%;
    max-height: 440px;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

/* Cột thumbnails bên phải */
.service-thumbs-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 440px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.service-thumbs-col::-webkit-scrollbar {
    display: none;
}

.service-thumb-item {
    width: 100%;
    height: 72px;
    border: 1px solid var(--bt-border);
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    background: #ffffff;
    flex-shrink: 0;
    transition: border-color 0.15s ease;
}

.service-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-thumb-item:hover {
    border-color: #93c5fd;
}

.service-thumb-item.active {
    border: 2px solid var(--bt-primary);
}

/* ==========================================================================
   THANH LIÊN HỆ & BÁO GIÁ NHANH (CTA GỌN GÀNG, PHẲNG)
   ========================================================================== */
.service-quick-contact-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 3px solid var(--bt-accent);
    padding: 8px 14px;
    margin-bottom: 16px;
    font-size: 13.5px;
}

.service-quick-contact-bar strong {
    color: #0f172a;
}

.service-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-contact-flat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 2px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    transition: background-color 0.15s ease;
}

.btn-contact-flat.quote {
    background: var(--bt-accent);
    color: #ffffff;
}

.btn-contact-flat.quote:hover {
    background: #b45309;
    color: #ffffff;
}

.btn-contact-flat.zalo {
    background: #0088ff;
    color: #ffffff;
}

.btn-contact-flat.zalo:hover {
    background: #0066cc;
    color: #ffffff;
}

.btn-contact-flat.phone {
    background: #dc2626;
    color: #ffffff;
}

.btn-contact-flat.phone:hover {
    background: #b91c1c;
    color: #ffffff;
}

/* ==========================================================================
   MỤC LỤC BÀI VIẾT (TOC): Đơn giản, phẳng, ít padding
   ========================================================================== */
.service-toc-box {
    background: #fcfcfc;
    border: 1px solid var(--bt-border);
    padding: 8px 14px;
    margin-bottom: 16px;
    display: inline-block;
    min-width: 260px;
    max-width: 100%;
}

.service-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--bt-dark);
}

.service-toc-toggle {
    background: none;
    border: none;
    color: var(--bt-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}

.service-toc-list {
    margin: 8px 0 0;
    padding-left: 20px;
    list-style: decimal;
    font-size: 13px;
    line-height: 1.6;
}

.service-toc-list a {
    color: var(--bt-dark);
    text-decoration: none;
}

.service-toc-list a:hover {
    color: var(--bt-primary);
    text-decoration: underline;
}

/* Mô tả ngắn: Chữ thẳng, không card bao bọc */
.service-lead-summary {
    font-size: 14.5px;
    line-height: 1.65;
    color: #1e293b;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--bt-border);
    font-weight: 500;
}

/* ==========================================================================
   NỘI DUNG CHI TIẾT (MÔ TẢ BÀI VIẾT): Typography chuẩn công nghiệp
   ========================================================================== */
.service-body-content {
    font-size: 14.5px;
    line-height: 1.7;
    color: #1e293b;
}

.service-body-content h2 {
    font-size: 17.5px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 20px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--bt-border);
}

.service-body-content h3 {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--bt-dark);
    margin: 16px 0 6px;
}

.service-body-content p {
    margin-bottom: 12px;
}

.service-body-content ul,
.service-body-content ol {
    margin-bottom: 14px;
    padding-left: 20px;
}

.service-body-content li {
    margin-bottom: 4px;
}

.service-body-content figure {
    margin: 14px 0;
    text-align: center;
}

.service-body-content img {
    max-width: 100% !important;
    height: auto !important;
    border: 1px solid var(--bt-border);
    border-radius: 0;
    margin: 8px auto;
    display: block;
}

.service-body-content figcaption {
    font-size: 12.5px;
    color: var(--bt-muted);
    font-style: italic;
    margin-top: 4px;
}

/* Bảng thông số: Viền vuông, không bo góc */
.service-body-content table {
    width: 100% !important;
    margin: 14px 0;
    border-collapse: collapse;
    font-size: 13.5px;
    border: 1px solid #cbd5e1;
}

.service-body-content table th {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    text-align: left;
}

.service-body-content table td {
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    vertical-align: middle;
}

.service-body-content table tr:nth-child(even) td {
    background: #f8fafc;
}

/* Video nhúng 16:9 */
.service-video-embed {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--bt-border);
    margin: 14px 0;
    position: relative;
    overflow: hidden;
    background: #000000;
}

.service-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block;
}

/* Trường hợp iframe tự chèn trực tiếp trong bài viết */
.service-body-content iframe:not(.service-video-embed iframe) {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--bt-border);
    margin: 14px 0;
    display: block;
}

/* Form liên hệ chân trang */
.service-footer-consult {
    margin-top: 24px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid var(--bt-border);
}

.service-footer-consult h4 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--bt-dark);
}

.service-footer-consult p {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--bt-muted);
}

.service-footer-form {
    display: flex;
    gap: 6px;
    max-width: 440px;
}

.service-footer-input {
    flex: 1;
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    padding: 0 10px;
    font-size: 13px;
    outline: none;
}

.service-footer-input:focus {
    border-color: var(--bt-primary);
}

.service-footer-btn {
    height: 36px;
    padding: 0 16px;
    background: var(--bt-primary);
    color: #ffffff;
    border: none;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.service-footer-btn:hover {
    background: var(--bt-primary-hover);
}

/* ==========================================================================
   DỊCH VỤ LIÊN QUAN (Grid 4 cột phẳng, không bo góc)
   ========================================================================== */
.service-related-section {
    margin-top: 24px;
    border-top: 1px solid var(--bt-border);
    padding-top: 16px;
}

.service-related-heading {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a8a;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.service-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.service-card-item {
    border: 1px solid var(--bt-border);
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.service-card-item:hover {
    border-color: var(--bt-primary);
}

.service-card-img-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f8fafc;
    display: block;
}

.service-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    margin: 0;
}

.service-card-body {
    padding: 8px 10px;
}

.service-card-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.service-card-title a {
    color: var(--bt-dark);
    text-decoration: none;
}

.service-card-title a:hover {
    color: var(--bt-primary);
}

/* ==========================================================================
   LIGHTBOX PHÓNG TO
   ========================================================================== */
.service-lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.service-lightbox-modal.active {
    display: flex;
}

.lightbox-content-box {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content-box img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-close-btn {
    position: absolute;
    top: -35px;
    right: 0;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
}

.lightbox-nav-btn.prev { left: -45px; }
.lightbox-nav-btn.next { right: -45px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 991px) {
    .service-grid-layout {
        grid-template-columns: 230px minmax(0, 1fr);
        gap: 14px;
    }
    .service-related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    /* Trên mobile: Ẩn hoàn toàn sidebar theo yêu cầu */
    .service-sidebar {
        display: none !important;
    }

    .service-grid-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .service-showcase-gallery {
        grid-template-columns: 1fr;
    }
    .service-main-image-wrap {
        min-height: 250px;
        max-height: 300px;
    }
    .service-thumbs-col {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
    }
    .service-thumb-item {
        width: 65px;
        height: 55px;
    }
    .service-quick-contact-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 10px;
    }
    .service-quick-contact-bar > div:first-child {
        font-size: 13px;
        line-height: 1.5;
    }
    .service-quick-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .service-quick-actions .btn-contact-flat {
        width: 100%;
        height: 38px;
        box-sizing: border-box;
    }
    .service-quick-actions .btn-contact-flat.phone {
        grid-column: span 2;
        font-size: 14.5px;
        font-weight: 700;
        letter-spacing: 0.3px;
    }
    .service-quick-actions .btn-contact-flat.zalo,
    .service-quick-actions .btn-contact-flat.quote {
        font-size: 13px;
    }
    .service-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .lightbox-nav-btn.prev { left: 5px; }
    .lightbox-nav-btn.next { right: 5px; }
}
