/**
 * M4H Furniture Product Tabs Modern Styling
 *
 * Đồng bộ phong cách chuyên nghiệp cho trang chi tiết sản phẩm WooCommerce.
 */

/* ==========================================================================
   1. PRODUCT TABS HEADER & NAVIGATION
   ========================================================================== */

.woocommerce-tabs.tabbed-content {
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Tab Header List */
.woocommerce-tabs ul.product-tabs.wc-tabs {
    display: flex !important;
    align-items: stretch;
    gap: unset !important;
    border-bottom: none !important;
    margin: 0 0 -1px 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Từng Tab Header Item */
.woocommerce-tabs ul.product-tabs.wc-tabs li {
    flex: 1 1 0;
    max-width: 50%;
    margin: 0 !important;
    padding: 0 !important;
    background: #f8fafc;
    border: 1px solid #dbe2ea !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    text-align: center;
    transition: all 0.25s ease-in-out;
    position: relative;
    overflow: hidden;
}

/* Link bên trong Tab Header */
.woocommerce-tabs ul.product-tabs.wc-tabs li a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 14px 20px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #475569 !important;
    letter-spacing: 0.6px;
    line-height: 1.4 !important;
    border: none !important;
    background: transparent !important;
    transition: color 0.2s ease;
    text-decoration: none !important;
}

/* Inactive Hover */
.woocommerce-tabs ul.product-tabs.wc-tabs li:not(.active):hover {
    background: #eef2f7;
    border-color: #cbd5e1 !important;
}

.woocommerce-tabs ul.product-tabs.wc-tabs li:not(.active):hover a {
    color: #0f172a !important;
}

/* Active Tab Item */
.woocommerce-tabs ul.product-tabs.wc-tabs li.active {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    border-top: 3px solid #1a2b49 !important;
    border-bottom: 2px solid #ffffff !important;
    z-index: 3;
    box-shadow: 0 -3px 10px rgba(15, 23, 42, 0.04);
}

.woocommerce-tabs ul.product-tabs.wc-tabs li.active a {
    color: #1a2b49 !important;
    font-weight: 800 !important;
}

/* ==========================================================================
   2. TAB PANELS CONTAINER
   ========================================================================== */

.woocommerce-tabs .tab-panels {
    position: relative;
    z-index: 1;
}

.woocommerce-tabs .tab-panels .woocommerce-Tabs-panel.panel {
    background: #ffffff;
    /* border: 1px solid #cbd5e1; */
    border-radius: 0 10px 10px 10px;
    padding: 24px 28px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    margin-bottom: 30px;
}

/* ==========================================================================
   3. INTERNAL SECTION CARDS (BOX THÔNG SỐ & MÔ TẢ)
   ========================================================================== */

.m4h-tab-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 22px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.m4h-tab-card:last-child {
    margin-bottom: 0;
}

.m4h-tab-card:hover {
    border-color: #cbd5e1;
}

/* Card Header */
.m4h-tab-card-header {
    background: #f8fafc;
    border-bottom: 1px solid #eef2f6;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dấu gạch cam nhận diện */
.m4h-orange-bar {
    width: 4px;
    height: 16px;
    background: #f36f21;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

/* Tiêu đề Box */
.m4h-tab-card-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: #1a2b49 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
    line-height: 1.3 !important;
}

/* Card Body */
.m4h-tab-card-body {
    padding: 20px 22px;
}

/* ==========================================================================
   4. THÔNG SỐ KỸ THUẬT (SPECIFICATIONS TABLE & EMPTY STATE)
   ========================================================================== */

.m4h-specs-table-wrapper {
    overflow-x: auto;
    border: 1px solid #eef2f6;
    border-radius: 6px;
}

.m4h-specs-table {
    width: 100%;
    margin: 0 !important;
    border-collapse: collapse;
    font-size: 13.5px;
}

.m4h-specs-table tr {
    border-bottom: 1px solid #f1f5f9;
}

.m4h-specs-table tr:last-child {
    border-bottom: none;
}

.m4h-specs-table tr:nth-child(even) {
    background-color: #f8fafc;
}

.m4h-specs-table tr:nth-child(odd) {
    background-color: #ffffff;
}

.m4h-specs-table th.m4h-spec-label {
    width: 32%;
    padding: 11px 16px;
    font-weight: 600;
    color: #475569;
    text-align: left;
    vertical-align: top;
    border-right: 1px solid #eef2f6;
    background: transparent;
    line-height: 1.5;
}

.m4h-specs-table td.m4h-spec-value {
    width: 68%;
    padding: 11px 16px;
    font-weight: 500;
    color: #1e293b;
    vertical-align: top;
    line-height: 1.5;
}

/* Empty State khi chưa có thông số */
.m4h-spec-empty-state {
    padding: 30px 15px;
    text-align: center;
}

.m4h-spec-updating-text {
    margin: 0;
    font-style: italic;
    color: #64748b;
    font-size: 14px;
    letter-spacing: 0.2px;
}

/* ==========================================================================
   5. MÔ TẢ SẢN PHẨM (COLLAPSIBLE CONTENT & GRADIENT FADE)
   ========================================================================== */

.m4h-desc-content-outer {
    position: relative;
    transition: max-height 0.35s ease-in-out;
}

.m4h-desc-content-outer.collapsed {
    max-height: 380px;
    overflow: hidden;
}

.m4h-desc-content-outer.expanded {
    max-height: none;
}

.m4h-desc-content-inner {
    font-size: 14.5px;
    line-height: 1.75;
    color: #334155;
}

.m4h-desc-content-inner p {
    margin-bottom: 14px;
}

.m4h-desc-content-inner img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 10px 0;
}

/* Gradient Fade Mask */
.m4h-desc-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 110px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 60%, #ffffff 100%);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.m4h-desc-content-outer.expanded .m4h-desc-fade-overlay {
    opacity: 0;
    visibility: hidden;
}

/* Toggle Button Container */
.m4h-desc-toggle-wrapper {
    margin-top: 14px;
    padding-top: 6px;
}

.m4h-desc-toggle-btn {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    padding: 6px 0 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    color: #f36f21 !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: none !important;
    transition: color 0.2s ease, transform 0.2s ease;
}

.m4h-desc-toggle-btn:hover {
    color: #d9530f !important;
    transform: translateY(-1px);
}

.m4h-desc-toggle-icon {
    transition: transform 0.3s ease;
    stroke: currentColor;
}

.m4h-desc-toggle-btn.is-expanded .m4h-desc-toggle-icon {
    transform: rotate(180deg);
}

/* ==========================================================================
   6. TAB 2: CHẤT LIỆU & BẢO HÀNH (FURNITURE WARRANTY & CARE)
   ========================================================================== */

/* Warranty 3-Item Grid */
.m4h-warranty-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.m4h-warranty-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
}

.m4h-warranty-item:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

/* Header hàng ngang: Icon + Tiêu đề cùng 1 hàng */
.m4h-warranty-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.m4h-warranty-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 8px;
    background: rgba(243, 111, 33, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.m4h-warranty-icon svg {
    width: 20px;
    height: 20px;
}

.m4h-warranty-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1a2b49 !important;
    line-height: 1.35 !important;
    text-align: left !important;
}

.m4h-warranty-text {
    padding-left: 0;
}

.m4h-warranty-text p {
    margin: 0 !important;
    font-size: 13px !important;
    color: #64748b !important;
    line-height: 1.5 !important;
}

/* Care List Items */
.m4h-care-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.m4h-care-item {
    border-left: 3px solid #1a2b49;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
}

.m4h-care-badge {
    display: inline-block;
    background: #1a2b49;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.m4h-care-desc p {
    margin: 0 0 5px 0 !important;
    font-size: 13.5px !important;
    color: #334155 !important;
    line-height: 1.55 !important;
}

.m4h-care-desc p:last-child {
    margin-bottom: 0 !important;
}

/* ==========================================================================
   7. RESPONSIVE BREAKPOINTS (MOBILE & TABLET)
   ========================================================================== */

@media (max-width: 768px) {
    .woocommerce-tabs ul.product-tabs.wc-tabs {
        gap: 6px;
    }

    .woocommerce-tabs ul.product-tabs.wc-tabs li a {
        padding: 12px 10px !important;
        font-size: 12.5px !important;
    }

    .woocommerce-tabs .tab-panels .woocommerce-Tabs-panel.panel {
        padding: 16px 14px;
        border-radius: 0 0 8px 8px;
    }

    .m4h-tab-card-header {
        padding: 10px 14px;
    }

    .m4h-tab-card-body {
        padding: 14px 12px;
    }

    .m4h-specs-table th.m4h-spec-label {
        width: 40%;
        padding: 9px 12px;
        font-size: 12.5px;
    }

    .m4h-specs-table td.m4h-spec-value {
        width: 60%;
        padding: 9px 12px;
        font-size: 12.5px;
    }

    .m4h-warranty-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.product-footer .woocommerce-tabs {
    border-top: 0 !important;
}