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

/* --- Global Background --- */
#wrapper, #main {
    background: url(/wp-content/themes/flatsome-child/assets/images/main-bg.png) !important;
}

/*************** ADD CUSTOM CSS HERE.   ***************/

.entry-content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ==========================================================================
   CSS CLONE TỪ XONGHOIBEBOI.COM
   ========================================================================== */

/* --- Container & General --- */
.container { max-width: 1250px; }
form { margin-bottom: 0; }
.is-divider { display: none; }

/* --- Fonts & Headings --- */
.heading-font { 
    color: #333333; 
    font-family: 'Montserrat', sans-serif; 
    font-weight: 700; 
    font-style: normal; 
}

/* --- Header Main & Background --- */
.header-main { 
    height: 78px; 
    border-bottom: 5px solid #e5b936; 
}
.header-bg-color { background-color: #fbfbfb; }

/* --- Logo Sizing --- */
#logo { width: 141px; }
#logo img { 
    max-height: 78px; 
    padding: 6px 0; 
}

@media (max-width: 549px) {
    .header-main { height: 70px; }
    #logo img { max-height: 70px; }
}

/* --- Search Box Styling --- */
.search-form { width: 60%; }
input[type='search'] { border-radius: 10px; height: 40px; }
.header-search-form-wrapper input[type='search'] { 
    box-shadow: none; 
    border-color: #fc8706; 
    border-right: none; 
}

/* --- Cart Button & Spacing --- */
.header-nav.nav-right .cart-item {
    margin-left: 20px; /* Tạo khoảng cách giữa tìm kiếm và giỏ hàng */
}
.header-nav .cart-item a.button.primary {
    height: 40px; /* Bằng với chiều cao của ô tìm kiếm */
    line-height: 40px;
    padding: 0 15px;
}

/* --- Main Navigation Styling --- */
.header-main .nav > li { margin: 0; }
.header-main .nav > li > a { 
    line-height: 53px; 
    padding: 10px 12px; 
    font-size: 16px; 
    font-family: 'Montserrat', sans-serif; 
    font-weight: 700; 
    font-style: normal; 
}
.header:not(.transparent) .header-nav-main.nav > li > a { color: #2f2f2f; }

/* Hover & Active states for Nav */
.header:not(.transparent) .header-nav-main.nav > li > a:hover,
.header:not(.transparent) .header-nav-main.nav > li.active > a,
.header-main .nav > li.active > a, 
.header-main .nav > li:hover > a { 
    color: #ffffff !important; 
    background-color: #e5b936; 
}

.has-dropdown .icon-angle-down { margin-left: 5px; opacity: 1; }

/* --- Dropdown Menu Styling --- */
.nav-dropdown { 
    font-size: 100%; 
    padding: 0; 
    background-color: #333333; 
}
.flex-right .nav-dropdown { background-color: #ffffff; }

.nav-dropdown.nav-dropdown-default li a { 
    font-size: 14px; 
    color: #ffffff; 
    border-bottom: none; 
}
.nav-dropdown.nav-dropdown-default > li > a { border-bottom: 1px solid #333333; }
.nav-dropdown.nav-dropdown-default > li:hover > a { border-bottom-color: #a36f3f; }
.nav-dropdown li { 
    border-left: 3px solid #333333; 
    margin-left: 0 !important; /* Bỏ margin left bị ảnh hưởng từ flatsome */
}

/* --- Primary Buttons --- */
a.button.primary { 
    background: linear-gradient(145deg, #ffd700, #DAA520, #B8860B); 
    color: #ffffff; 
    border: none; 
    font-weight: bold; 
    transition: all 0.3s ease; 
    height: 50px; 
    padding: 0 25px; 
    line-height: 50px; 
}
a.button.primary:hover { 
    background: linear-gradient(145deg, #B8860B, #DAA520, #FFD700); 
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.4); 
}

/* --- Image Box & Shine Effect --- */
.box-cat .box-text {
    background: #f2f2f2;
    padding: 10px;
}
.box-cat .box-text h4 {
    color: #333333;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-style: normal;
}
.box-cat a.button {
    margin-bottom: 0;
}

/* Shine effect on hover */
.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);
}
.box-image:hover::before {
    -webkit-animation: shine .75s;
    animation: shine .75s;
}
@-webkit-keyframes shine {
    100% { left: 125%; }
}
@keyframes shine {
    100% { left: 125%; }
}

/* --- Global Section Title --- */
.xc-section-title b {
    background-color: transparent !important;
    border: none !important;
    /* Xóa vạch gạch 2 bên nhưng không ẩn hoàn toàn thẻ b (display: none sẽ làm hỏng Flex căn lề của UX Builder) */
}

/* --- Box Why (Lý do chọn An Bình) --- */
.xc-home.why .box-why {
    padding: 20px;
    background: #ffffff;
    border-radius: 10px;
    border-bottom: 5px solid #2859a3;
    min-height: 345px;
    overflow: hidden;
    transition: all .3s;
}
.xc-home.why .box-why:hover {
    cursor: pointer;
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.15);
    transform: translateY(-10px);
}

.xc-home.why .box-why .icon-box-text h3 {
    font-weight: bold;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 10px;
}
.xc-home.why .box-why .icon-box-text h3:before {
    content: '';
    width: 28px;
    height: 3px;
    background-color: #2859a3;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}

/* --- Products Section Tabs --- */
.xc-home.products .row .tabbed-content ul {
    justify-content: center;
}
.xc-home.products .row .tabbed-content ul li {
    margin: 0;
}
.xc-home.products .row .tabbed-content ul li a {
    text-align: center;
    font-size: 14px;
    text-transform: uppercase;
    color: #fff !important;
    background-color: #2858a2 !important;
    border-radius: 5px !important;
    border: none !important;
    padding: 0 30px;
    height: 45px;
    line-height: 45px;
    margin: 0 5px 10px;
    transition: all 500ms ease;
    position: relative;
    z-index: 1;
}
.xc-home.products .row .tabbed-content ul li.active a,
.xc-home.products .row .tabbed-content ul li a:hover {
    transition: all 500ms ease;
    background: #e5b936 !important; /* primary color */
    color: #ffffff !important;
}
.xc-home.products .row .tabbed-content ul li a:after {
    content: "";
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 10px solid #e5b936;
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    margin: 0 auto;
    visibility: hidden;
    opacity: 0;
    transition: all 500ms ease;
    z-index: -1;
}
.xc-home.products .row .tabbed-content ul li.active a:after {
    opacity: 1;
    bottom: -10px;
    visibility: visible;
}

/* --- Product Small Box Global --- */
.product-small.box {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.product-small.box:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.product-small.box .box-text {
    background: #f2f2f2;
    padding: 10px;
}
.product-small.box .box-text p.product-title a {
    font-weight: bold !important;
    font-size: 15px;
    color: #333333;
}
.product-small.box:hover p.product-title a {
    color: #ff8400 !important;
}
.product-small.box .box-text .price-wrapper {
    margin: 5px 0;
}
.product-small.box .box-text .price-wrapper span.price del,
.product-small.box .box-text .price-wrapper span.price ins {
    display: block; /* Ép mỗi giá 1 dòng */
    text-decoration: none; /* Bỏ gạch chân nếu có của thẻ ins */
}
.product-small.box .box-text .price-wrapper span.price del {
    text-decoration: line-through; /* Giữ gạch ngang cho giá cũ */
    font-size: 13px; /* Thu nhỏ giá cũ một chút */
    color: #999;
}
.product-small.box .box-text .price-wrapper span.price ins span.amount,
.product-small.box .box-text .price-wrapper span.price > span.amount {
    color: red !important;
    font-size: 16px;
    font-weight: bold;
}
.product-small.box .box-text .price-wrapper span.price del span.amount {
    color: #999 !important; /* Giá cũ phải màu xám, không bị đè bởi màu đỏ */
    font-size: 14px;
    font-weight: normal;
}

.absolute-footer {
    display: none !important;
}

@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/
    a.button.primary { font-size: 15px; }

    /* Box Why Mobile */
    .xc-home.why .row .col.large-3 { max-width: 100%; flex-basis: 100%; }
    .xc-home.why .box-why { min-height: auto; }

    /* Single Post Mobile */
    .blog-single .article-inner { padding: 15px; }
}

/* --- Dấu ấn An Bình (Gallery Slider) --- */
.xc-home.impression .box-image {
    border: 3px solid #fff;
    overflow: hidden;
}
.xc-home.impression .flickity-page-dots .dot.is-selected {
    background-color: #fc8706 !important; /* Secondary color */
}
/* Kèm màu cho cả nút prev/next cho đồng bộ nếu slider hiển thị mũi tên */
.xc-home.impression .flickity-prev-next-button .arrow {
    fill: #fc8706 !important;
}

/* --- Sidebar Widgets --- */
.is-divider {
    display: none;
}
.widget-title, .widgettitle {
    margin-bottom: 0;
    background: #e5b936;
    padding: 15px 25px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    color: white;
    display: block;
}
.widget ul {
    margin: 0;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    background: #e5b9364a; /* Vàng trong suốt */
    padding: 10px;
    border-radius: 14px;
}
.recent-blog-posts-li .mr-half {
    margin-right: 10px;
}
.recent-blog-posts a {
    line-height: 1.1;
    font-size: 15px;
}

/* Sidebar: Border bottom dashed cho danh mục */
.widget_product_categories > ul > li {
    border-bottom: 1px dashed #ccc;
    border-top: none !important;
}
.widget_product_categories > ul > li:last-child {
    border-bottom: none;
}

/* Sidebar: Ảnh bài viết tròn */
.flatsome_recent_posts .badge,
.flatsome_recent_posts .badge-outline,
.flatsome_recent_posts .badge-inner {
    border-radius: 50% !important;
    overflow: hidden;
}

/* --- Tin tức (Blog Post Box) --- */
/* Ẩn ngày tháng */
.box-blog-post .badge.post-date {
    display: none !important;
}

/* Khung tin tức (Border, border-radius, hover shadow như Product) */
.box-blog-post {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.box-blog-post:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.box-blog-post .box-text {
    background: #f2f2f2;
    padding: 10px 15px;
}

/* Tiêu đề in đậm, giới hạn 2 dòng và luôn giữ cao độ bằng 2 dòng */
.box-blog-post .post-title {
    font-weight: bold !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    line-height: 1.3;
    min-height: 2.6em; /* Luôn chiếm diện tích của 2 dòng */
}
.box-blog-post .post-title a {
    color: #333333;
}
.box-blog-post:hover .post-title a {
    color: #ff8400 !important;
}

/* Mô tả giới hạn 2 dòng */
.box-blog-post .from_the_blog_excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

/* --- Contact Form 7 (.xc-contact-form) --- */
.xc-contact-form {
    display: block;
    width: 100%;
}
.xc-contact-form__group {
    background: white;
    display: inline-block;
    width: 100%;
    clear: both;
    border: 1px solid #006f81;
    border-radius: 5px;
    margin-bottom: 10px; /* Thêm khoảng cách nhẹ giữa các input do đã bỏ thẻ p */
}
.xc-contact-form__submit-group {
    padding-bottom: 15px;
}
.xc-contact-form__icon {
    display: inline-block;
    width: 10%;
    float: left;
    padding: 10px 7px;
    text-align: center;
}
.xc-contact-form__group .wpcf7-form-control-wrap {
    display: inline-block;
    float: right;
    width: 90%;
}
.xc-contact-form input:not([type='submit']), 
.xc-contact-form select {
    height: 40px;
    line-height: 40px;
    box-shadow: none;
    font-size: 14px;
    margin-bottom: 0;
    border: none;
    border-left: 1px solid #dcdcdc;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    background: transparent;
    width: 100%; /* Giữ cho input đầy khuôn */
}
.xc-contact-form input[type='submit'] {
    width: 100%;
    font-weight: bold;
    font-size: 17px;
    border-radius: 5px;
    display: block;
    min-width: 200px;
    margin: 0 auto;
    box-shadow: none;
    border: none;
    background: #052968;
    color: white;
    padding: 10px 0;
}
.xc-contact-form__header {
    display: none;
}
.xc-contact-form__header h3 {
    text-align: center;
    color: #ffee00;
    text-transform: uppercase;
    font-weight: 900;
    line-height: 22px;
    margin-bottom: 5px;
}
.xc-contact-form__header h4 {
    text-align: center;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 10px;
}

/* --- Single Post (Trang chi tiết bài viết) --- */
.blog-single .article-inner {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* --- Single Product (Trang chi tiết sản phẩm) --- */
/* Gallery và Info tạo thành 1 khối nền trắng */
.product-main .product-gallery,
.product-main .product-info {
    background-color: #fff;
    padding-top: 30px;
    padding-bottom: 30px;
}
.product-main .product-gallery {
    border-radius: 8px 0 0 8px;
}
.product-main .product-info {
    border-radius: 0 8px 8px 0;
}
@media (max-width: 849px) {
    .product-main .product-gallery {
        border-radius: 8px 8px 0 0;
    }
    .product-main .product-info {
        border-radius: 0 0 8px 8px;
    }
}

/* Phần Mô tả, Đánh giá, Sản phẩm tương tự, Sản phẩm bán chéo (Mỗi phần 1 khối trắng riêng) */
.product-footer .custom-product-section,
.product-footer .related-products-wrapper,
.product-footer .upsells {
    background-color: #fff;
    padding: 30px 15px; /* Giảm left/right padding về 15px để bằng với các cột của product-main */
    margin-left: -15px; /* Kéo giãn ra sát viền bù trừ cho padding của .container */
    margin-right: -15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 30px;
}
.custom-product-section .section-title,
.product-footer .related-products-wrapper .product-section-title,
.product-footer .upsells .product-section-title {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #ccc;
}

/* --- Breadcrumb (Thanh điều hướng) --- */
.page-title-inner {
    background-color: #fff;
    padding: 15px; /* Đổi padding left/right về 15px để thẳng hàng text */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 15px;
}

/* Khoảng cách dưới cùng của trang sản phẩm */
.product-footer {
    margin-bottom: 40px;
}

/* --- Responsive Mobile: Tạo khoảng cách 5px với mép màn hình --- */
@media (max-width: 849px) {
    /* Breadcrumb, Gallery và Info */
    .page-title-inner,
    .product-main .product-gallery,
    .product-main .product-info {
        margin-left: 5px !important;
        margin-right: 5px !important;
        width: auto !important;
        max-width: calc(100% - 10px) !important;
        flex-basis: calc(100% - 10px) !important;
    }
    
    /* Các section trong Footer (đang nằm trong .container có padding 15px) 
       Ta dùng margin -10px để lùi ra ngoài, giữ lại đúng 5px khoảng trống */
    .product-footer .custom-product-section,
    .product-footer .related-products-wrapper,
    .product-footer .upsells {
        margin-left: -10px !important;
        margin-right: -10px !important;
    }
}