/*
Theme Name: Trong Ha Child
Theme URI: https://trongha.io.vn/
Description: Theme con tối ưu hóa hiệu năng dành riêng cho Trọng Hà Official, phát triển từ Flatsome.
Author: Trong Ha
Author URI: https://trongha.io.vn/
Template: flatsome
Version: 3.0
Text Domain: trongha-child
*/

/* =========================================================================
   0. KHAI BÁO FONT & ICON CHUẨN ĐẦU FILE (TRÁNH LỖI NẠP CHẬM ICON)
   ========================================================================= */
@font-face { font-family: "fl-icons"; font-display: block; }
@font-face { font-family: "Icons"; font-display: block; }

/* 1. Xóa sạch khoảng đệm trên/dưới của masthead */
#masthead.header-main {
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}

/* 2. Loại bỏ giới hạn chiều rộng 'container' và lề 2 bên của khung inner */
#masthead .header-inner {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}

/* 3. Ép khung #logo chiếm trọn 100% chiều rộng */
#masthead #logo {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 4. Ép ảnh banner/logo hiển thị sát mép, không để lề thừa */
#masthead #logo a,
#masthead #logo img.header_logo {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 5. Ẩn các cột thừa đang nằm trống ở 2 bên trên Desktop */
#masthead .flex-left.hide-for-medium,
#masthead .flex-right.hide-for-medium {
    display: none !important;
}

/* =========================================================================
   1. CSS TINH GỌN LÀM SẠCH BẢNG ĐƠN HÀNG: ẨN HOÀN TOÀN TẠM TÍNH & TỔNG CỘNG
   ========================================================================= */

/* 1.1 Ẩn giá 1đ và 0đ hiển thị trên toàn bộ giỏ hàng, thanh toán và trang cảm ơn */
.is-cart .cart_totals .amount,
.checkout .shop_table .amount,
.checkout #order_review .amount,
.woocommerce-checkout-review-order-table .amount,
.product-total .woocommerce-Price-amount,
.shipping .amount,
.woocommerce-order-received .product-total .amount,
.woocommerce-order-received .shop_table .amount,
.woocommerce-order-received .woocommerce-table--order-details td .amount {
    display: none !important;
}

/* Ẩn dấu hai chấm thừa và ký tự rác bên cạnh cột tiền tệ */
.cart_totals .order-total td::before,
.checkout #order_review .order-total td::before,
.woocommerce-checkout-review-order-table .order-total td::before,
.shipping td::before,
.woocommerce-order-received .woocommerce-table--order-details .order-total td::before {
    display: none !important;
}

/* 1.2 Sửa lỗi hàng ngang tóm tắt trang cảm ơn: Ẩn hẳn ô "Tổng cộng" bị trống */
.woocommerce-order-received .woocommerce-thankyou-order-received-wrapper .overview .total,
.woocommerce-order-received ul.overview li.total {
    display: none !important;
}

/* 1.3 ẨN HOÀN TOÀN CẢ DÒNG TỔNG SỐ PHỤ (SUBTOTAL) VÀ TỔNG CỘNG (TOTAL) TRÊN TOÀN TRANG */
.cart-subtotal,
.order-total,
.woocommerce-order-received .cart-subtotal,
.woocommerce-order-received .order-total,
.woocommerce-order-received .woocommerce-table--order-details .cart-subtotal,
.woocommerce-order-received .woocommerce-table--order-details .order-total {
    display: none !important;
}

/* 1.4 Định dạng chung cho chữ thông báo màu xanh thương hiệu */
.custom-msg {
    font-size: 14px;
    font-weight: 600;
    color: #1d5d3b !important;
    font-style: italic;
    display: inline-block;
}

/* 1.5 Gắn nhãn "Chờ báo giá" thay thế phần tiền sản phẩm ở Checkout & Trang Cảm Ơn */
.woocommerce-checkout-review-order-table .product-total,
.woocommerce-order-received .product-total,
.woocommerce-order-received .woocommerce-table--order-details .product-total {
    font-size: 0 !important;
}
.woocommerce-checkout-review-order-table .product-total::after,
.woocommerce-order-received .product-total::after,
.woocommerce-order-received .woocommerce-table--order-details .product-total::after {
    content: "Chờ báo giá";
    font-size: 13px;
    color: #1d5d3b;
    font-weight: 600;
    font-style: italic;
}

/* 1.6 TỐI GIẢN CÁC KHU VỰC THỪA KHÁC Ở CHECKOUT FORM */
.woocommerce-form-login-toggle, 
.woocommerce-form-coupon-toggle,
.checkout_coupon.woocommerce-form-coupon {
    display: none !important;
}
.woocommerce-billing-fields h3 {
    display: none !important;
}
#customer_details .col-1, 
#customer_details .col-2 {
    width: 100% !important;
    float: none !important;
}
#place_order {
    background-color: #1d5d3b !important;
    color: #fff !important;
    font-size: 16px;
    font-weight: bold;
    padding: 15px 30px !important;
    border-radius: 5px;
}

/* =========================================================================
   2. CẤU HÌNH LIÊN QUAN ĐẾN FAKE STOCK & DANH SÁCH SẢN PHẨM KHU VỰC FAKE
   ========================================================================= */
.fake-product-info {
    margin: 10px 0;
    padding: 12px;
    background: #f7faf8;
    border: 1px solid #e5efe8;
    border-radius: 8px;
    font-size: .9rem;
    line-height: 1.7;
}
.fake-product-info p {
    margin: 0;
}
.stock-status {
    font-weight: 600;
}
.stock-status.in {
    color: #1d5d3b;
}
.stock-status.low {
    color: #844606;
}
.stock-status.medium {
    color: #764F04;
}
.stock-status.out {
    color: #AD1F1F;
}

/* =========================================================================
   3. CĂN CHỈNH NỘI DUNG, BÀI VIẾT, BẢNG VÀ GIAO DIỆN HIỂN THỊ
   ========================================================================= */
.callout-box {
    background: #f5fbf7;
    border-left: 5px solid #1d5d3b;
    padding: 18px 20px;
    margin: 25px 0;
    border-radius: 8px;
    color: #333;
    font-size: 15px;
    line-height: 1.8;
    position: relative;
    text-align: justify;
}
.callout-box strong {
    color: #1d5d3b;
}
.callout-box::before {
    content: "\e017";
    font-family: fl-icons;
    color: #1d5d3b;
    font-size: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

.box-note {
    background: #fffdf5;
    border-left: 5px solid #f4b400;
    padding: 18px 20px;
    margin: 25px 0;
    border-radius: 8px;
    color: #333;
    font-size: 15px;
    line-height: 1.8;
    position: relative;
    text-align: justify;
}
.box-note strong {
    color: #9a6700;
}
.box-note::before {
    content: "\e004";
    font-family: fl-icons;
    color: #f4b400;
    font-size: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 15px;
}
.entry-content table th {
    background: #1d5d3b;
    color: #fff;
    padding: 12px;
    text-align: left;
}
.entry-content table td {
    padding: 12px;
    border: 1px solid #e5e5e5;
}
.entry-content table tbody tr:nth-child(even) {
    background: #f8f8f8;
}
.entry-content table tbody tr:hover {
    background: #eef8f2;
}
.aligncenter {
    clear: both !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
.chu-dan-deu p {
    text-align: justify;
}
.single-post .entry-content :is(blockquote,dl,figure,form,ol,p,pre,ul),
.page-inner :is(blockquote,dl,figure,form,ol,p,pre,ul),
.product-short-description :is(blockquote,dl,figure,form,ol,p,pre,ul),
.product-footer :is(blockquote,dl,figure,form,ol,p,pre,ul) {
    text-align: justify;
}
.col-breadcrumbs a {
    text-decoration: underline !important;
}
.col-breadcrumbs a:hover {
    text-decoration: none !important;
}
.single-post .entry-content a,
.page-inner a,
.single-product #tab-description a {
    text-decoration: underline !important;
}
.single-product #tab-description .contact-buttons-wrap a {
    text-decoration: none !important;
}
.single-product .product_meta a[href*="/thuong-hieu/"] {
    text-decoration: underline !important;
}
.single-post .entry-content a:hover,
.page-inner a:hover {
    text-decoration: none !important;
}
#ftwp-container a,
.ftwp-wrap a,
.ftwp-anchor {
    text-decoration: none !important;
}
#ftwp-container a:hover,
.ftwp-wrap a:hover,
.ftwp-anchor:hover {
    text-decoration: underline !important;
}

/* =========================================================================
   4. TỐI ƯU GIAO DIỆN WIDGET SẢN PHẨM NỔI BẬT
   ========================================================================= */
.product_list_widget li {
    padding: 10px 0 !important;
    border-bottom: 1px solid #ececec !important;
}
.product_list_widget li a {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-decoration: none !important;
    box-shadow: none !important;
}
.product_list_widget img {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    object-fit: cover !important;
    margin: 0 !important;
    float: none !important;
    flex-shrink: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
    padding: 0 !important;
}
.product_list_widget li a::before,
.product_list_widget li a::after,
.product_list_widget img::before,
.product_list_widget img::after {
    display: none !important;
    content: none !important;
}
.product_list_widget .star-rating,
.product_list_widget .kk-star-ratings {
    margin-top: 4px !important;
    margin-left: 72px !important;
}
.recent-blog-posts-li .recent-blog-posts {
    align-items: center !important;
}
.archive .entry-category,
.blog .entry-category,
.category .entry-category {
    display: none !important;
}
.footer-menu {
    display: none;
}
.absolute-footer {
    color: #fff;
}

ul li.bullet-arrow,
ul li.bullet-checkmark,
ul li.bullet-cross,
ul li.bullet-star {
    border-bottom: none !important;
}

.kk-star-ratings {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    text-align: center !important;
}
.kk-star-ratings .kksr-legend,
.kk-star-ratings .kksr-status {
    font-size: 13.5px !important;
    color: #555 !important;
    font-weight: 500 !important;
}

/* =========================================================================
   5. KHU VỰC THÔNG TIN BIÊN SOẠN & SLIDER FLATSOME (ĐÃ TỐI ƯU CỐ ĐỊNH CHẤM DOTS)
   ========================================================================= */
.entry-meta {
    text-align: center !important;
}
.entry-meta.uppercase {
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.post-meta-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 18px auto 30px;
    padding: 12px 18px;
    background: #f8faf8;
    border: 1px solid #e8efe9;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
    color: #666;
}
.post-meta-box span {
    display: inline-flex;
    align-items: center;
}
.post-meta-box .meta-label {
    color: #1d5d3b;
    font-weight: 600;
    margin-right: 4px;
}
.post-meta-box .meta-separator {
    color: #cfcfcf;
    font-weight: 400;
}
.post-meta-box .meta-author {
    color: #1d5d3b;
    font-weight: 600;
    text-decoration: none;
    transition: .2s ease;
}
.post-meta-box .meta-author:hover {
    color: #5e9665;
    text-decoration: underline;
}

.home .slider .slide:first-child,
.home .slider .flickity-slider>.slide:first-child {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    backface-visibility: hidden;
}

/* Định vị chấm tròn chuyển Slide tuyệt đối nằm trên Slider */
.flickity-page-dots {
    position: absolute !important;
    bottom: 10px !important;
    left: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    text-align: center !important;
    z-index: 99 !important;
    pointer-events: auto !important;
}
.row-slider .flickity-page-dots {
    bottom: -15px !important;
}
.flickity-page-dots .dot,
.nav-dots-small .flickity-page-dots .dot,
.row-slider .flickity-page-dots .dot {
    border: 3px solid #135f36 !important;
    height: 24px !important;
    width: 24px !important;
    background-color: transparent !important;
    opacity: .8 !important;
    touch-action: manipulation;
}
.flickity-page-dots .dot.is-selected,
.slider-nav-light .flickity-page-dots .dot.is-selected,
.slider-nav-light.slider-nav-dots-simple .flickity-page-dots .dot {
    background-color: #135f36 !important;
    opacity: 1 !important;
    box-shadow: 0 1px 1px rgba(255,255,255,.4), inset 0 1px 1px rgba(0,0,0,.1), 0 0 0 5px rgba(255,255,255,.5) !important;
}
/* Xóa bỏ hoàn toàn khung nền xanh, làm nút mũi tên trong suốt tinh tế */
.flickity-prev-next-button {
    background: transparent !important;
    background-color: transparent !important;
    color: #135f36 !important;
    opacity: 0.7 !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    transition: transform .2s ease, opacity .2s ease, color .2s ease !important;
}

.flickity-prev-next-button:hover {
    background: transparent !important;
    background-color: transparent !important;
    color: #c60325 !important; /* Đổi sang màu đỏ thương hiệu khi hover (hoặc đổi màu tùy thích) */
    transform: scale(1.25) !important;
    opacity: 1 !important;
    box-shadow: none !important;
}

/* =========================================================================
   6. SHORTCODES ĐẶC THÙ (NÚT LIÊN HỆ, CONTACT FORM 7 & SECURITY CLOUDFLARE)
   ========================================================================= */
.contact-buttons-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 10px;
}
.contact-buttons-item a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #1d4ed8;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
}
.contact-buttons-item img {
    width: 32px;
    height: 32px;
}
.form-container-custom {
    background-color: #f0fff4;
    border: 1px solid #bfeecd;
    border-radius: 8px;
    padding: 12px;
    max-width: 640px;
    box-sizing: border-box;
    margin: 0 auto;
}
.form-container-custom .form-title-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    color: #187a2f;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
}
.form-container-custom .form-title-custom svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.form-flat input:not([type=submit]) {
    border-radius: 5px;
}
.wpcf7-display-none {
    display: none !important;
}
div.wpcf7-response-output {
    margin: 1.5em 0 1em;
    padding: .8em 1em;
    border: 2px solid transparent;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
}
div.wpcf7-mail-sent-ok {
    border-color: #fef83e !important;
    background-color: rgba(254,248,62,.1);
    color: #333;
}
.wpcf7-acceptance-missing,
div.wpcf7-validation-errors {
    border-color: #e35e5e;
    background-color: #fdf2f2;
    color: #e35e5e;
}
.screen-reader-response p[role="status"] {
    text-align: center !important;
    font-style: italic !important;
    color: var(--primary-color,#fef83e) !important;
    font-weight: 500;
    margin: 10px 0;
}
.screen-reader-response ul {
    display: none !important;
}
.wpcf7-turnstile {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}
.wpcf7-spinner {
    display: none;
}
.turnstile-reset {
    text-align: center;
    margin-top: 8px;
    font-size: .8rem;
    line-height: 1.4;
}
.turnstile-reset a {
    display: inline-block;
}
.turnstile-reset p {
    text-align: center !important;
    margin: 0 !important;
}

/* =========================================================================
   7. ĐỊNH DẠNG HEADER BARS & CÁC KHỐI TIÊU ĐỀ NỔI BẬT THEME H2
   ========================================================================= */
body:not(.home) h2:not(footer h2) {
    background: linear-gradient(to right,#c60325,#fcc800) !important;
    color: #fff !important;
    padding: 10px 15px;
    border-radius: 4px;
    border-left: 5px solid #14432a;
    box-shadow: 0 4px 12px rgba(29,93,59,.15);
}
body:not(.home) h2:not(footer h2) a {
    color: #fff !important;
    transition: color .2s ease-in-out;
}
body:not(.home) h2:not(footer h2) a:hover {
    color: rgba(255,255,255,.8) !important;
    text-decoration: none !important;
}

body.page:not(.home) .page-inner ol,
body.page:not(.home) .page-inner ul {
    list-style-position: inside;
    text-align: justify;
    margin-left: 20px !important;
}
#ftwp-container.ftwp-wrap #ftwp-list {
    margin-left: 0 !important;
}

body.page:not(.home) .page-inner ol ol,
body.page:not(.home) .page-inner ol ul,
body.page:not(.home) .page-inner ul ol,
body.page:not(.home) .page-inner ul ul {
    margin: 1em 0 !important;
}
.blog-wrapper.blog-single.page-wrapper p,
.large-9.col p,
.page-wrapper.page-right-sidebar p,
.product-footer .woocommerce-tabs.container p {
    text-align: justify;
}
.product-short-description {
    text-align: justify;
}

/* =========================================================================
   8. TỐI ƯU GIAO DIỆN HIỂN THỊ ĐÁP ỨNG TRÊN THIẾT BỊ DI ĐỘNG (BỎ MIN-HEIGHT 500PX)
   ========================================================================= */
.home .slider {
    min-height: 0 !important;
    height: auto !important;
}

@media(max-width:849px) {
    .post-meta-box {
        font-size: 13px;
        gap: 8px;
        padding: 10px 15px;
    }
}

@media(max-width:549px) {
    .post-meta-box {
        justify-content: center;
        row-gap: 8px;
        column-gap: 6px;
    }
    .post-meta-box .meta-separator {
        display: none;
    }
    #ftwp-container {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    #ftwp-container a,
    #ftwp-container .ftwp-text {
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }
    #ftwp-container .ftwp-sub {
        padding-left: 12px !important;
    }
}

@media only screen and (max-width:48em) {
    body {
        padding-bottom: 55px !important;
    }
    .footer-menu {
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 8px 0;
        border-top: 1px solid #ddd;
        z-index: 9999;
        transition: transform .3s ease-in-out, opacity .3s ease-in-out;
        opacity: 1;
    }
    .footer-menu.hidden {
        transform: translateY(100%) !important;
        opacity: 0 !important;
        pointer-events: none;
    }
    .footer-menu .footer-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 12px;
        color: #333;
        text-decoration: none !important;
        flex: 1;
    }
    .footer-menu img {
        width: 24px;
        height: 24px;
        margin-bottom: 4px;
        display: block;
    }
    .contact-buttons-item a {
        font-size: 16px;
    }
    .contact-buttons-item img {
        width: 24px;
        height: 24px;
    }
    .form-container-custom .medium-flex-wrap {
        flex-flow: row nowrap !important;
    }
    .entry-content table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-collapse: collapse;
    }
}