/* =============================================================================
   K-Tech Single Product Custom Layout Stylesheet
   File: assets/css/single-product-custom.css
   Matches Design Images 1, 2, and 3
   ============================================================================= */

/* ---- Main Container ---- */
.ktech-single-product-layout {
    margin-top: 16px;
    /* margin-bottom: 40px; */
    box-sizing: border-box;
}

/* =============================================================================
   SECTION 1: TOP 3 COLUMNS
   ============================================================================= */
.ktech-single-top-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    /* margin-bottom: 24px; */
    background: #ffffff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* ---- Column 1: Gallery (Left ~38%) ---- */
.ktech-single-gallery-col {
    width: 38%;
    min-width: 300px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.ktech-gallery-wrapper {
    width: 100%;
    position: relative;
}

.ktech-gallery-wrapper .woocommerce-product-gallery {
    margin-bottom: 12px;
}

.ktech-gallery-wrapper .flex-control-thumbs li img.flex-active,
.ktech-gallery-wrapper .flex-control-thumbs li img:hover {
    border-color: var(--primary-color) !important;
}

/* Social Share Row */
.ktech-social-share-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.ktech-share-label {
    font-size: 13px;
    color: #444;
    font-weight: 600;
}

.ktech-share-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ktech-share-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ktech-share-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.ktech-share-btn.fb {
    background: #3b5998;
}

.ktech-share-btn.pin {
    background: #cb2027;
}

.ktech-share-btn.tw {
    background: #1da1f2;
}

/* ---- Column 2: Summary & Purchase (Middle ~39%) ---- */
.ktech-single-summary-col {
    flex: 1;
    min-width: 300px;
    box-sizing: border-box;
}

.ktech-single-product-title {
    font-size: 20px;
    font-weight: 700;
    color: #222222;
    line-height: 1.35;
    margin: 0 0 8px 0;
}

/* Rating Stars */
.ktech-single-rating-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.ktech-single-stars {
    display: inline-flex;
    align-items: center;
    color: #f59e0b;
    font-size: 14px;
    gap: 2px;
}

.ktech-single-stars .star.empty {
    color: #d1d5db;
}

.ktech-rating-count {
    color: #6b7280;
    font-size: 12.5px;
    margin-left: 4px;
}

/* Brand & SKU & Compare */
.ktech-single-brand-sku-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #555555;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.ktech-single-brand-sku-row .meta-item strong {
    color: #333333;
    font-weight: 600;
}

.ktech-single-brand-sku-row .meta-val {
    color: #1890ff;
    font-weight: 500;
}

.ktech-single-brand-sku-row .meta-divider {
    color: #d1d5db;
}

.ktech-compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #1890ff !important;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.ktech-compare-btn:hover {
    color: #096dd9 !important;
    text-decoration: underline;
}

/* Price Row */
.ktech-single-price-row {
    margin: 12px 0;
}

.ktech-single-price-row .price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin: 0;
}

.ktech-single-price-row .price .amount,
.ktech-single-price-row .price ins .amount {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: var(--primary-color) !important;
}

.ktech-single-price-row .price del,
.ktech-single-price-row .price del .amount {
    font-size: 14px !important;
    color: #8c8c8c !important;
    font-weight: normal !important;
    text-decoration: line-through !important;
}

.ktech-single-price-row .ktech-loop-discount {
    background: var(--primary-color);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
}

/* =============================================================================
   KHỐI MUA HÀNG: SỐ LƯỢNG, MUA NGAY BLOCK, THÊM VÀO GIỎ (CTA BLOCK)
   ============================================================================= */
.ktech-single-cta-block {
    margin-top: 18px;
}

.ktech-single-cart-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

/* 1. Hàng Số lượng: [- 1 +] */
.ktech-single-qty-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 2px;
}

.ktech-qty-label {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    user-select: none;
}

.ktech-qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
    height: 36px;
    box-sizing: border-box;
}

.ktech-qty-step-btn {
    width: 36px;
    height: 34px;
    background: #ffffff;
    border: none;
    color: #555555;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    margin: 0;
    transition: background 0.2s ease, color 0.2s ease;
    user-select: none;
    outline: none;
}

.ktech-qty-step-btn:hover {
    background: #f5f5f5;
    color: #111111;
}

.ktech-qty-step-btn:active {
    background: #e9e9e9;
}

.ktech-qty-input {
    width: 48px !important;
    height: 34px !important;
    min-height: 34px !important;
    border: none !important;
    border-left: 1px solid #e8e8e8 !important;
    border-right: 1px solid #e8e8e8 !important;
    border-radius: 0 !important;
    text-align: center !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: #222222 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -moz-appearance: textfield;
}

.ktech-qty-input::-webkit-outer-spin-button,
.ktech-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 2. Nút MUA NGAY */
.ktech-single-mua-ngay-wrap {
    width: 100%;
    margin: 0;
}

.ktech-single-buy-now-btn,
.ktech-single-cta-block button.ux-buy-now-button {
    width: 100% !important;
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    height: 46px !important;
    line-height: 46px !important;
    padding: 0 20px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    transition: background 0.2s ease, transform 0.1s ease, filter 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    margin: 0 !important;
    text-decoration: none !important;
}

.ktech-single-buy-now-btn:hover,
.ktech-single-cta-block button.ux-buy-now-button:hover {
    background: var(--primary-color) !important;
    filter: brightness(1.15) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
}

.ktech-single-buy-now-btn:active,
.ktech-single-cta-block button.ux-buy-now-button:active {
    transform: translateY(0);
}

/* 3. Nút THÊM VÀO GIỎ */
.ktech-single-add-to-cart-btn,
.ktech-single-cta-block button.single_add_to_cart_button {
    width: 100% !important;
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    height: 46px !important;
    line-height: 46px !important;
    padding: 0 20px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    transition: background 0.2s ease, transform 0.1s ease, filter 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    margin: 0 !important;
    text-decoration: none !important;
}

.ktech-single-add-to-cart-btn:hover,
.ktech-single-cta-block button.single_add_to_cart_button:hover {
    background: var(--primary-color) !important;
    filter: brightness(1.15) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
}

.ktech-single-add-to-cart-btn:active,
.ktech-single-cta-block button.single_add_to_cart_button:active {
    transform: translateY(0);
}

/* Hỗ trợ Form Biến thể (Variable Product) nếu có */
.ktech-single-cta-block form.cart.variations_form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ktech-single-cta-block .variations {
    width: 100%;
    margin-bottom: 8px;
}

.ktech-single-cta-block .single_variation_wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ktech-single-cta-block .single_variation_wrap .woocommerce-variation-add-to-cart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* ---- Column 3: Sidebar (Right ~23%) ---- */
.ktech-single-sidebar-col {
    width: 23%;
    min-width: 220px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.ktech-single-coupons-sidebar {
    margin-bottom: 16px;
}

.ktech-single-coupons-sidebar .ktech-coupon-card {
    /* margin-bottom: 10px; */
}

.ktech-sidebar-view-all-coupons {
    text-align: center;
    margin-top: 8px;
}

.ktech-coupons-view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary-color) !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ktech-coupons-view-all-btn:hover {
    color: #b70010 !important;
    text-decoration: underline;
}

.ktech-single-policy-block {
    margin-top: 12px;
}

/* =============================================================================
/* =============================================================================
   SECTION 2: ĐẶC ĐIỂM NỔI BẬT & THÔNG SỐ KỸ THUẬT (Images 2 & 3)
   ============================================================================= */
.ktech-single-main-detail-row.has-specs {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.ktech-single-main-detail-row.no-specs {
    display: block;
}

/* Left Column: Description */
.ktech-detail-desc-col {
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
}

/* Right Column: Specs */
.ktech-detail-specs-col {
    flex: 0 0 380px;
    max-width: 380px;
    width: 100%;
    box-sizing: border-box;
}

.ktech-desc-card,
.ktech-specs-card {
    background: #ffffff;
    border-radius: 6px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* Left Column Header */
.ktech-desc-header-wrap {
    text-align: center;
    margin-bottom: 18px;
}

.ktech-desc-subtitle {
    font-size: 13.5px;
    font-weight: 700;
    color: #222222;
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
    letter-spacing: 0.3px;
}

.ktech-desc-main-title {
    font-size: 16.5px;
    font-weight: 800;
    color: #111111;
    line-height: 1.4;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -0.2px;
}

/* Collapsible Content Container (Description) */
.ktech-desc-content-container {
    max-height: 523px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.4s ease;
}

.ktech-desc-content-container.is-expanded {
    max-height: none !important;
}

.ktech-desc-body {
    font-size: 14.5px;
    line-height: 1.7;
    color: #333333;
}

.ktech-desc-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 12px auto;
    display: block;
}

.ktech-desc-gradient-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff);
    pointer-events: none;
}

.ktech-desc-content-container.is-expanded .ktech-desc-gradient-fade {
    display: none;
}

/* Action Wrap & Buttons */
.ktech-desc-action-wrap,
.ktech-specs-action-wrap {
    width: 100%;
    text-align: center;
    margin-top: 14px;
}

.ktech-desc-readmore-btn,
.ktech-specs-readmore-btn {
    width: 100% !important;
    height: 35px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    background: #eef2f7 !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 8px 20px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    cursor: pointer !important;
    transition: background 0.2s ease, color 0.2s ease !important;
    outline: none !important;
    text-align: center !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

.ktech-desc-readmore-btn:hover,
.ktech-specs-readmore-btn:hover {
    background: #e2e8f0 !important;
    color: #1a202c !important;
}

.ktech-desc-readmore-btn .btn-icon,
.ktech-specs-readmore-btn .btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #2d3748 !important;
    line-height: 1 !important;
}

.ktech-desc-readmore-btn .btn-icon svg,
.ktech-specs-readmore-btn .btn-icon svg {
    display: block !important;
    width: 14px !important;
    height: 14px !important;
}

/* Right Column: Specs Card */
.ktech-specs-heading {
    font-size: 17px;
    font-weight: 700;
    color: #111111;
    margin: 0 0 16px 0;
    text-align: left;
}

.ktech-specs-content-container {
    max-height: 480px;
    overflow: hidden;
    position: relative;
}

.ktech-specs-gradient-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff);
    pointer-events: none;
}

/* Specs Table Styling (Matching Images 2 & 3) */
.ktech-specs-body table,
.ktech-specs-modal-body table {
    width: 100% !important;
    border-collapse: collapse !important;
    border: 1px solid #333333 !important;
    margin: 0 !important;
    font-size: 13.5px !important;
    background: #ffffff !important;
}

.ktech-specs-body table tr,
.ktech-specs-modal-body table tr {
    background: #ffffff !important;
}

.ktech-specs-body table td,
.ktech-specs-body table th,
.ktech-specs-modal-body table td,
.ktech-specs-modal-body table th {
    border: 1px solid #333333 !important;
    padding: 8px 12px !important;
    vertical-align: top !important;
    font-size: 13.5px !important;
    line-height: 1.45 !important;
    color: #222222 !important;
    word-break: break-word !important;
}

.ktech-specs-body table tr td:first-child,
.ktech-specs-body table tr th:first-child,
.ktech-specs-modal-body table tr td:first-child,
.ktech-specs-modal-body table tr th:first-child {
    width: 38% !important;
    min-width: 105px !important;
    font-weight: 500 !important;
    color: #333333 !important;
}

.ktech-specs-body table tr td:last-child,
.ktech-specs-body table tr th:last-child,
.ktech-specs-modal-body table tr td:last-child,
.ktech-specs-modal-body table tr th:last-child {
    color: #111111 !important;
}

.ktech-specs-body table td p,
.ktech-specs-modal-body table td p {
    margin: 0 !important;
    padding: 0 !important;
}

/* Specs Modal (Image 3) */
.ktech-specs-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ktech-specs-modal.is-active {
    opacity: 1;
}

.ktech-specs-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.ktech-specs-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 6px;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    z-index: 2;
    transform: translateY(15px);
    transition: transform 0.25s ease;
    box-sizing: border-box;
    overflow: hidden;
}

.ktech-specs-modal.is-active .ktech-specs-modal-dialog {
    transform: translateY(0);
}

.ktech-specs-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 20px;
    border-bottom: 1px solid #eeeeee;
}

.ktech-specs-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #222222;
    margin: 0;
}

.ktech-specs-modal-close-btn {
    background: none;
    border: none;
    line-height: 1;
    color: #777777;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s ease, transform 0.2s ease;
    margin: 0 !important;
    font-size: 20px;
}

.ktech-specs-modal-close-btn:hover {
    color: #000000;
    transform: scale(1.15);
}

.ktech-specs-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1 1 auto;
    box-sizing: border-box;
}

body.ktech-modal-locked {
    overflow: hidden !important;
}

/* =============================================================================
   SECTION 3: ĐÁNH GIÁ & HỎI ĐÁP (Photo 3)
   ============================================================================= */
.ktech-reviews-heading {
    font-size: 18px;
    font-weight: 700;
    color: #222222;
    margin: 30px 0 0 0;
}

.ktech-review-tab-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 0;
    margin-bottom: 20px;
}

.ktech-tab-nav-left {
    display: flex;
    gap: 8px;
}

.ktech-review-tab-btn {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    padding: 10px 16px;
    cursor: pointer;
    position: relative;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    outline: none;
}

.ktech-review-tab-btn:hover {
    color: #1e293b;
}

.ktech-review-tab-btn.is-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 700;
}

.ktech-ask-question-btn {
    background: #4f46e5;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ktech-ask-question-btn:hover {
    background: #4338ca;
}

.ktech-tab-panel {
    display: none;
}

.ktech-tab-panel.is-active {
    display: block;
}

.ktech-qa-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888888;
    font-size: 14px;
}

.ktech-empty-text {
    color: #888888;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

/* =============================================================================
   SECTION 4 & 5: SẢN PHẨM CÙNG PHÂN KHÚC GIÁ & SẢN PHẨM ĐÃ XEM
   ============================================================================= */
.ktech-related-title {
    font-size: 18px;
    font-weight: 800;
    color: #222222;
    text-transform: uppercase;
    letter-spacing: -0.2px;
    margin: 0 0 16px 0;
}

.ktech-related-slider-container {
    width: 100%;
}

.ktech-single-recently-viewed-box .ktech-recently-viewed-wrap {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
}

.ktech-single-recently-viewed-box .ktech-recently-viewed-title {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #222222 !important;
    text-transform: uppercase !important;
    letter-spacing: -0.2px !important;
    margin: 0 0 16px 0 !important;
}


/* =============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================= */
@media (max-width: 1024px) {
    .ktech-single-top-row {
        flex-wrap: wrap;
    }

    .ktech-single-gallery-col {
        width: 48%;
    }

    .ktech-single-summary-col {
        width: 48%;
    }

    .ktech-single-sidebar-col {
        width: 100%;
        margin-top: 16px;
    }

    .ktech-single-main-detail-row.has-specs {
        flex-direction: column;
        gap: 20px;
    }

    .ktech-detail-specs-col {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .ktech-single-top-row {
        flex-direction: column;
        padding: 12px;
    }

    .ktech-single-gallery-col,
    .ktech-single-summary-col,
    .ktech-single-sidebar-col {
        width: 100%;
        min-width: 0;
    }

    .ktech-single-product-title {
        font-size: 17px;
    }

    .ktech-section-card,
    .ktech-desc-card,
    .ktech-specs-card {
        padding: 16px;
    }

    .ktech-desc-main-title {
        font-size: 15px;
    }

    .ktech-specs-modal {
        padding: 12px;
    }

    .ktech-specs-modal-dialog {
        max-width: 100%;
        max-height: 90vh;
    }

    .ktech-specs-modal-header {
        padding: 0px 16px;
    }

    .ktech-specs-modal-body {
        padding: 14px 16px;
    }
}

.review-form-inner {
    padding-left: 0px !important;
    padding-right: 0px !important;
}

.review-form-inner.has-border {
    border: none !important;
    padding: 15px;
    padding-top: 0px;
}

.review-form-inner form {
    margin-bottom: 0;
}

.review-form-inner .form-submit input[type="submit"] {
    margin-bottom: 0;
}

#review_form_wrapper {
    padding-bottom: 0px !important;
}