/* ==========================================================================
   KRAFTFLOOR – TRANG CHI TIẾT SẢN PHẨM (Single Product)
   ========================================================================== */

/* Reset WooCommerce defaults trên trang single */
.single-product div.product {
    display: block !important;
    gap: 0 !important;
}
.single-product .woocommerce-breadcrumb { display: none; }
.single-product .hero-section { display: none !important; }

/* ==========================================================================
   1. BREADCRUMB
   ========================================================================== */
.kf-sp-breadcrumb {
    background: #f8f8f8;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.kf-sp-breadcrumb nav {
    font-size: 13px;
    color: #888;
}
.kf-sp-breadcrumb nav a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}
.kf-sp-breadcrumb nav a:hover { color: var(--kf-gold); }
.kf-sp-breadcrumb .sep { margin: 0 6px; color: #ccc; }
.kf-sp-breadcrumb .current { color: var(--kf-black); font-weight: 600; }

/* ==========================================================================
   2. MAIN LAYOUT (Gallery + Info)
   ========================================================================== */
.kf-sp-main {
    padding: 50px 0 60px;
    background: #fff;
}
.kf-sp-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

/* ==========================================================================
   3. GALLERY
   ========================================================================== */
.kf-sp-gallery {
    position: sticky;
    top: 150px;
    max-height: calc(100vh - 170px);
    overflow-y: auto;
    scrollbar-width: none;
}
.kf-sp-gallery::-webkit-scrollbar {
    display: none;
}
.kf-sp-main-image {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 16px;
    aspect-ratio: 1/1;
}
.kf-sp-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: transform 0.4s ease;
}
.kf-sp-main-image img:hover { transform: scale(1.03); }
.kf-sp-main-image .kf-sp-zoom-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.2s;
}
.kf-sp-main-image .kf-sp-zoom-btn:hover { background: var(--kf-gold); color: #fff; }

/* Thumbnail strip */
.kf-sp-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.kf-sp-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}
.kf-sp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.kf-sp-thumb:hover,
.kf-sp-thumb.active {
    border-color: var(--kf-gold);
    box-shadow: 0 4px 12px rgba(197,160,89,0.3);
}

/* ==========================================================================
   4. PRODUCT INFO PANEL
   ========================================================================== */
.kf-sp-info {}
.kf-sp-category-badge {
    display: inline-block;
    background: var(--kf-gold);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}
.kf-sp-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--kf-black);
    line-height: 1.25;
    margin: 0 0 15px;
}
.kf-sp-divider {
    width: 60px;
    height: 3px;
    background: var(--kf-gold);
    margin-bottom: 20px;
    border-radius: 2px;
}
.kf-sp-short-desc {
    color: #555;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 28px;
}

/* Icon tính năng */
.kf-sp-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
}
.kf-sp-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}
.kf-sp-feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 2px solid #eee;
    transition: all 0.3s;
}
.kf-sp-feature-item:hover .kf-sp-feature-icon {
    border-color: var(--kf-gold);
    box-shadow: 0 6px 20px rgba(197,160,89,0.25);
}
.kf-sp-feature-label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    line-height: 1.3;
}

/* Buttons */
.kf-sp-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}
.kf-btn-quote {
    flex: 1;
    background: var(--kf-black);
    color: #fff;
    border: 2px solid var(--kf-black);
    padding: 14px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}
.kf-btn-quote:hover {
    background: var(--kf-gold);
    border-color: var(--kf-gold);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(197,160,89,0.35);
}
.kf-btn-catalog {
    flex: 1;
    background: transparent;
    color: var(--kf-black);
    border: 2px solid var(--kf-black);
    padding: 14px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    text-decoration: none;
}
.kf-btn-catalog:hover {
    background: var(--kf-black);
    color: var(--kf-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Bảng thông số nhanh */
.kf-sp-specs-table {
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
}
.kf-sp-specs-table table {
    width: 100%;
    border-collapse: collapse;
}
.kf-sp-specs-table tr:nth-child(even) td { background: #fafafa; }
.kf-sp-specs-table tr:last-child td { border-bottom: none; }
.kf-sp-specs-table td {
    padding: 11px 18px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.kf-sp-specs-table td:first-child {
    font-weight: 700;
    color: #555;
    width: 40%;
    background: inherit;
}
.kf-sp-specs-table td:last-child { color: var(--kf-black); }

/* ==========================================================================
   5. CONTENT TABS
   ========================================================================== */
.kf-sp-tabs-section {
    background: #f8f8f8;
    border-top: 1px solid #eee;
}
.kf-sp-tabs-nav {
    border-bottom: 2px solid #e0e0e0;
    background: #fff;
}
.kf-sp-tabs-nav-inner {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
}
.kf-sp-tabs-nav-inner::-webkit-scrollbar { display: none; }
.kf-sp-tab-btn {
    padding: 18px 28px;
    font-size: 14px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    background: transparent;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.kf-sp-tab-btn:hover { color: var(--kf-black); }
.kf-sp-tab-btn.active {
    color: var(--kf-black);
    border-bottom-color: var(--kf-gold);
}
.kf-sp-tab-content {
    padding: 50px 0;
}
.kf-sp-tab-pane { display: none; }
.kf-sp-tab-pane.active { display: block; }
.kf-sp-tab-pane h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--kf-black);
    margin-bottom: 20px;
}
.kf-sp-tab-pane p { color: #555; line-height: 1.9; margin-bottom: 15px; }
.kf-sp-tab-pane ul { list-style: none; padding: 0; margin-bottom: 20px; }
.kf-sp-tab-pane ul li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 10px;
    color: #555;
    line-height: 1.7;
}
.kf-sp-tab-pane ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--kf-gold);
    font-weight: 700;
}

/* Bảng thông số trong tab */
.kf-tab-specs-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.kf-tab-specs-table thead tr { background: var(--kf-black); }
.kf-tab-specs-table thead th {
    padding: 14px 20px;
    color: var(--kf-gold);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}
.kf-tab-specs-table tbody tr { background: #fff; }
.kf-tab-specs-table tbody tr:nth-child(even) { background: #f9f9f9; }
.kf-tab-specs-table tbody td {
    padding: 13px 20px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}
.kf-tab-specs-table tbody td:first-child {
    font-weight: 600;
    color: #666;
    width: 35%;
}

/* ==========================================================================
   6. MẪU SẢN PHẨM (SAMPLE GALLERY)
   ========================================================================== */
.kf-samples-section {
    padding: 60px 0;
    background: #fff;
    border-top: 1px solid #eee;
}
.kf-samples-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--kf-black);
    text-align: center;
    margin-bottom: 8px;
}
.kf-samples-subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 40px;
    font-size: 15px;
}
.kf-samples-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.kf-sample-card {
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}
.kf-sample-card:hover {
    transform: translateY(-4px);
    border-color: var(--kf-gold);
    box-shadow: 0 12px 30px rgba(197,160,89,0.2);
}
.kf-sample-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}
.kf-sample-card-name {
    background: var(--kf-black);
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* ==========================================================================
   7. BANNER TƯ VẤN
   ========================================================================== */
.kf-sp-consult-banner {
    background: var(--kf-black);
    padding: 60px 0;
}
.kf-sp-consult-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}
.kf-sp-consult-text h2 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}
.kf-sp-consult-text p { color: #aaa; font-size: 15px; }
.kf-btn-consult {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--kf-gold);
    color: #fff;
    padding: 16px 35px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s;
}
.kf-btn-consult:hover {
    background: #fff;
    color: var(--kf-black);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255,255,255,0.2);
}

/* ==========================================================================
   8. SẢN PHẨM LIÊN QUAN
   ========================================================================== */
.kf-related-section {
    padding: 70px 0;
    background: #fafafa;
}
.kf-related-title {
    text-align: center;
    font-size: 30px;
    font-weight: 800;
    color: var(--kf-black);
    margin-bottom: 10px;
}
.kf-related-line {
    width: 60px;
    height: 3px;
    background: var(--kf-gold);
    margin: 0 auto 40px;
    border-radius: 2px;
}
.kf-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* ==========================================================================
   9. MODAL BÁO GIÁ
   ========================================================================== */
.kf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.kf-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}
.kf-modal-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    transform: translateY(30px) scale(0.97);
    transition: all 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.kf-modal-overlay.open .kf-modal-box {
    transform: translateY(0) scale(1);
}
.kf-modal-header {
    background: var(--kf-black);
    padding: 25px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.kf-modal-header h3 {
    color: var(--kf-gold);
    font-size: 20px;
    font-weight: 800;
    margin: 0;
}
.kf-modal-close {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}
.kf-modal-close:hover { color: #fff; }
.kf-modal-body {
    padding: 30px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    flex: 1 1 auto;
    min-height: 0;
}
.kf-modal-body p { color: #666; font-size: 14px; margin-bottom: 20px; }
.kf-quote-form .kf-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}
.kf-quote-form .kf-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}
.kf-quote-form label {
    font-size: 13px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kf-quote-form input,
.kf-quote-form textarea,
.kf-quote-form select {
    padding: 12px 16px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: var(--kf-black);
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}
.kf-quote-form input:focus,
.kf-quote-form textarea:focus {
    border-color: var(--kf-gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(197,160,89,0.15);
}
.kf-quote-form textarea { resize: vertical; min-height: 90px; }
.kf-btn-submit-quote {
    width: 100%;
    background: var(--kf-gold);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
}
.kf-btn-submit-quote:hover {
    background: var(--kf-black);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.kf-quote-success {
    text-align: center;
    padding: 20px 0;
    display: none;
}
.kf-quote-success .success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(197, 160, 89, 0.1); /* Màu Gold nhạt */
}
.kf-success-svg {
    width: 32px;
    height: 32px;
    stroke: var(--kf-gold);
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: kf-draw-check 0.8s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
@keyframes kf-draw-check {
    to { stroke-dashoffset: 0; }
}
.kf-quote-success h4 { font-size: 20px; color: var(--kf-black); margin-bottom: 10px; }
.kf-quote-success p { color: #666; }

body.kf-modal-open {
    overflow: hidden;
    touch-action: none;
}

/* ==========================================================================
   10. LIGHTBOX (Zoom ảnh)
   ========================================================================== */
.kf-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.kf-lightbox.open { opacity: 1; visibility: visible; }
.kf-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}
.kf-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    background: transparent;
    border: none;
}

/* ==========================================================================
   11. LIÊN HỆ NHANH (Quick Contact)
   ========================================================================== */
.kf-sp-quickcontact {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding: 16px 20px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #eee;
}
.kf-qc-label {
    font-size: 13px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.kf-qc-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.kf-qc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s;
    white-space: nowrap;
    border: 2px solid transparent;
}
/* Zalo */
.kf-qc-zalo {
    background: #e8f1ff;
    color: #0068FF;
    border-color: #c5dbff;
}
.kf-qc-zalo:hover {
    background: #0068FF;
    color: #fff;
    border-color: #0068FF;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,104,255,0.3);
}
/* Messenger */
.kf-qc-messenger {
    background: #e8f4ff;
    color: #0084FF;
    border-color: #c2e0ff;
}
.kf-qc-messenger:hover {
    background: #0084FF;
    color: #fff;
    border-color: #0084FF;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,132,255,0.3);
}
/* Phone */
.kf-qc-phone {
    background: #e8f7ed;
    color: #1a8f3c;
    border-color: #b5e4c3;
}
.kf-qc-phone:hover {
    background: #1a8f3c;
    color: #fff;
    border-color: #1a8f3c;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(26,143,60,0.3);
}
.kf-qc-btn svg { flex-shrink: 0; }

/* ==========================================================================
   12. RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    .kf-sp-layout { grid-template-columns: 1fr; gap: 40px; }
    .kf-sp-gallery { position: static; }
    .kf-sp-title { font-size: 26px; }
    .kf-samples-grid { grid-template-columns: repeat(3, 1fr); }
    .kf-related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .kf-sp-features { grid-template-columns: repeat(2, 1fr); }
    .kf-sp-buttons { flex-direction: column; }
    .kf-sp-consult-inner { flex-direction: column; text-align: center; }
    .kf-samples-grid { grid-template-columns: repeat(2, 1fr); }
    .kf-related-grid { grid-template-columns: repeat(2, 1fr); }
    .kf-quote-form .kf-form-row { grid-template-columns: 1fr; }
    .kf-sp-tab-btn { padding: 14px 18px; font-size: 13px; }
    .kf-sp-quickcontact { flex-direction: column; align-items: flex-start; gap: 10px; }
    .kf-qc-btns { width: 100%; }
    .kf-qc-btn { flex: 1; justify-content: center; }

    .kf-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .kf-modal-box {
        max-height: min(92dvh, 100%);
        border-radius: 16px 16px 0 0;
    }

    .kf-modal-header {
        padding: 18px 20px;
    }

    .kf-modal-body {
        padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
    }
}
@media (max-width: 480px) {
    .kf-sp-features { grid-template-columns: repeat(2, 1fr); }
    .kf-related-grid { grid-template-columns: 1fr; }
    .kf-sp-title { font-size: 22px; }
    .kf-modal-box { border-radius: 12px; }
}
