/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/

/*************** ADD CUSTOM CSS HERE.   ***************/
.dadth-tab .tab {
	background-color: #f4f6fe;
	border-radius: 15px;
}
.dadth-tab .tab:hover {
	background-color: #f59d2e;
}
.dadth-tab li
{
width: 16%;
}
.dadth-tab .tab a {
    padding: 1rem 2rem;
    font-size: 13px;
	font-weight: 100;
	color: #2f5254;
}
.dadth-tab .active.tab {
	background-color: #f59d2e;
}
.dadth-tab .active.tab a {
	color: #2f5254 !important;
	font-weight: 900;
}
.dadth-tab .tab a {
	color: #2f5254 !important;
}
.dadth-tab .tab-panels {
	background-color: #fff;
	padding: 10px;
	margin-top: 10px;
}
.dadth-bv .box-image:hover::before {
	-webkit-animation:shine .75s;
	animation: shine .75s;
}
@-webkit-keyframes shine {
	100%{left:125%}
}
@keyframes shine {
	100%{left:125%}
}
.dadth-bv .box-image img
{
	border-radius: 20px;
}
.dadth-bv .box-image:before {
	position:absolute;
	top:0;
	left:-75%;
	z-index:2;
	display:block;
	content:'';
	width:50%;
	height:100%;
	background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,.3) 100%);
	background:linear-gradient(to right,rgba(255,255,255,0) 0,rgba(255,255,255,.3) 100%);
	-webkit-transform:skewX(-25deg);transform:skewX(-25deg);
}
.dadth-bv .box-text {
	bottom: 0;
	padding: 5px;
}

.dadth-bv .box-text .is-divider, .post-l .box-text .is-divider, .post-n .is-divider {
	display: none;
}
/*lien he*/
.lhvct-1 {
	padding: 0 30px 10px !important;
}
.b-kc .f-hvt, .b-kc .f-sdt, .b-kc .f-email, .b-kc .f-diachi, .b-kc .f-noidung {
    padding: 6px 12px;
    font-size: 14px;
    color: #555;
	box-shadow: none !important;
	margin-bottom: 0;
}
.f-khung {
	padding: 5px 12px;
    font-size: 14px;
    color: #555;
    text-align: center;
    background-color: #eee;
    border: 1px solid #ccc;
    border-top-left-radius: 4px;
	border-bottom-left-radius: 4px;
	display: table-cell
}
.hovaten-888, .sdt-888, .email-888, .diachi-888, .noidung-888 {
	display: table-cell !important;
	width: 100%;
}
.b-kc .f-guingay {
	font-family: "Font Awesome 5 Free";
	text-transform: none;
	border-radius: 4px;
}
.lhvct-2 h4, .ctslng-2 h4 {
	text-transform: uppercase;
}
.kbt-fr {
	padding: 0 9.8px 5px !important;
}
/*end*/

/*blog*/
.blog-wrapper {
	padding: 0;
}
.blog-tt .col-inner {
	padding: 20px;
	box-shadow: 0px 0px 21px 0px rgba( 0, 0, 0, 0.1 );
}
.blog-tt .col:nth-child(1) .col-inner, .blog-tt .col:nth-child(4) .col-inner, .blog-tt .col:nth-child(7) .col-inner, .blog-tt .col:nth-child(10) .col-inner {
	border-bottom: 2px solid #000000;
}
.blog-tt .col:nth-child(2) .col-inner, .blog-tt .col:nth-child(5) .col-inner, .blog-tt .col:nth-child(8) .col-inner, .blog-tt .col:nth-child(11) .col-inner {
	border-bottom: 2px solid #ff3b00;
}
.blog-tt .col:nth-child(3) .col-inner, .blog-tt .col:nth-child(6) .col-inner, .blog-tt .col:nth-child(9) .col-inner, .blog-tt .col:nth-child(12) .col-inner {
	border-bottom: 2px solid #002bff;
}
.blog-tt .box-text {
	padding-bottom: 0;
}
.blog-tt .box-text .cat-label {
	text-align: center;
	font-size: 10px;
	color: #ca9868;
}
.blog-tt .box-text .post-title {
	text-transform: uppercase;
	font-size: 14px;
	font-weight: 600;
	margin: 10px 0;
	height: 37px;
	text-overflow: ellipsis;
    -webkit-line-clamp: 2;
	overflow: hidden;
	display: -webkit-box;
    -webkit-box-orient: vertical;
}
.blog-tt .box-text .is-divider {
	display: none;
}
.blog-tt .box-text .post-meta {
	padding-bottom: 10px;
}
.blog-tt .box-text .post-meta:before {
	font-family: "Font Awesome 5 Pro";
    content: "\f017";
	margin-right: 5px;
}
.blog-tt .box-text .from_the_blog_excerpt {
	font-size: 14px;
	color: #333;
	height: 110px;
	text-overflow: ellipsis;
	-webkit-line-clamp: 5;
	overflow: hidden;
	display: -webkit-box;
    -webkit-box-orient: vertical;
}
.blog-ct {
	margin-top: 20px;
}
.blog-ct .entry-content {
	padding: 0;
}
.blog-ct .post {
	margin: 0;
}
.box-blct {
	border-radius: 10px;
	border-bottom: 3px solid #000;
}
.box-blct .entry-content p {
	margin-bottom: 10px;
}
/*end*/
.post-l>.row, .blog-p>.post-l>.post, #tag_cloud-2 .tagcloud {
    background: #fff;
    border-width: 0;
    border-style: solid;
    border-top-color: #d3e1f6;
    border-right-color: #d3e1f6;
    border-bottom-color: #d3e1f6;
    border-left-color: #d3e1f6;
    border-radius: 2px;
    box-shadow: 0 4px 15px 0 rgba(88,106,153,.2);
	margin-bottom: 0;
}
.post-l>.row>.col {
	padding: 10px !important;
}
.post-l .box-text .post-meta {
    text-transform: capitalize;
    font-size: 11px;
    color: #a0afce;
    font-weight: 100;
}
.post-l .box-text .post-meta:before {
    font-family: "Font Awesome 5 Free";
    content: "\f017";
    margin-right: 5px;
}
.post-n .widget-title {
    font-size: 14px;
    color: #000;
    text-transform: uppercase;
    font-weight: 700;
    margin-left: 10px;
}
#tag_cloud-2 .widget-title span:before {
    font-family: "Font Awesome 5 Pro";
    content: "\f02c";
    padding: 10px;
}
.blog-p>.post-l h1 {
    font-size: 130%;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0;
    padding: 15px;
}
.hdt-tgt {
	font-size: 12px;
	float: left;
	width: max-content;
	padding-bottom: 10px;
	padding-left: 15px;
}
.hdt-tgt .byline, .hdt-tgt .posted-on {
	margin-right: 7px;
}
.hdt-tgt .byline:before {
	font-family: "Font Awesome 5 Pro";
	font-weight: 100;
	color: #ccc;
	content: "\f007";
	margin-right: 2px;
}
.hdt-tgt .posted-on:before {
	font-family: "Font Awesome 5 Pro";
	font-weight: 100;
	color: #bbb;
	content: "\f017";
	margin-right: 2px;
}
.blog-p .hdt-brcc {
	border-top: 1px solid #f4f4f4;
    border-bottom: 1px solid #f4f4f4;
    margin-bottom: 0;
    margin-top: 15px;
    position: relative;
    line-height: 40px;
    height: 40px;
    /*overflow: hidden;*/
	clear: both;
}
.hdt-brcc h4 {
    font-size: 13px;
    font-weight: 100;
    position: relative;
    width: max-content;
	padding-left: 20px;
	padding-right: 10px;
    margin-right: 30px;
    background: #000;
    color: #efe18c;
    float: left;
	margin-left: -10px;
}
.hdt-brcc h4:before {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0px 10px 10px;
    border-color: transparent transparent #000;
    content: '';
    display: block;
    position: absolute;
    left: 0px;
    top: -20px;
}
.hdt-brcc h4:after {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 40px 25px 0 0;
    border-color: #000 transparent transparent;
    content: '';
    position: absolute;
    margin-top: 0;
    margin-left: 20px;
    right: -25px;
}
.chia-se {
	font-size: 14px;
	float: right;
	width: max-content;
	padding-bottom: 10px;
	padding-right: 15px;
}
.chia-se span:before {
	font-family: "Font Awesome 5 Pro";
	font-weight: 600;
	color: #bbb;
	content: "\f14d";
	margin-right: 2px;
}
.svl_post_view_count:before {
	font-family: "Font Awesome 5 Pro";
	font-weight: 600;
	color: #bbb;
	content: "\f06e";
	margin-right: 2px;
}
.hdt-tgt .byline, .hdt-tgt .posted-on, .svl_post_view_count, .chia-se span {
	color: #a0afce;
	font-weight: 100;
}
.blog-p .entry-header-text, .tvtt-menu {
	padding: 0px !important;
}
.blog-p .entry-content {
	padding: 15px;
}
.blog-p .entry-content p {
	margin-bottom: 1rem;
}
/*end*/
@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/


}

// Thêm tab "Thông tin khách hàng" vào trang Tài khoản
add_filter( 'woocommerce_account_menu_items', 'tmix_add_customer_info_tab', 30 );
function tmix_add_customer_info_tab( $items ) {
    $items['customer-info'] = 'Thông tin khách hàng';
    return $items;
}

// Nội dung hiển thị trong tab "Thông tin khách hàng"
add_action( 'woocommerce_account_customer-info_endpoint', 'tmix_customer_info_content' );
function tmix_customer_info_content() {
    $current_user = wp_get_current_user();
    ?>
    <h3>Thông tin tài khoản của bạn</h3>
    <ul>
        <li><strong>Họ tên:</strong> <?php echo esc_html( $current_user->display_name ); ?></li>
        <li><strong>Email:</strong> <?php echo esc_html( $current_user->user_email ); ?></li>
        <li><strong>Số điện thoại:</strong> <?php echo esc_html( get_user_meta( $current_user->ID, 'billing_phone', true ) ); ?></li>
        <li><strong>Địa chỉ:</strong> <?php echo esc_html( get_user_meta( $current_user->ID, 'billing_address_1', true ) ); ?></li>
    </ul>
    <a class="button" href="<?php echo wc_get_account_endpoint_url( 'edit-account' ); ?>">Cập nhật thông tin</a>
    <?php
}

// Đăng ký endpoint URL
add_action( 'init', 'tmix_add_customer_info_endpoint' );
function tmix_add_customer_info_endpoint() {
    add_rewrite_endpoint( 'customer-info', EP_ROOT | EP_PAGES );
}

// Flush rewrite rules sau khi thêm endpoint mới
register_activation_hook( __FILE__, 'tmix_flush_rewrite_rules' );
function tmix_flush_rewrite_rules() {
    flush_rewrite_rules();
}
