/*
Theme Name: MatBaoWS
Description: This is a child theme for Flatsome Theme
Author: MatBaoWS Team
Template: flatsome
Version: 3.0
*/
/*************** ADD CUSTOM CSS HERE.   ***************/

/* Logo & Header expansion rules */
@media (min-width: 850px) {
    .show-for-medium,
    .mobile-nav-left,
    .mobile-nav-right {
        display: none !important;
    }
    .desktop-search-col {
        display: flex !important;
        align-items: center !important;
    }
    .desktop-contact-col {
        display: flex !important;
        align-items: center !important;
        margin-left: auto !important;
    }
    #masthead {
        padding: 8px 0 !important;
        min-height: 94px !important;
        transition: padding 0.25s ease, min-height 0.25s ease !important;
    }
    #masthead .header-inner {
        min-height: 88px !important;
        height: auto !important;
        transition: min-height 0.25s ease !important;
    }
    #logo {
        width: auto !important;
        min-width: 170px !important;
    }
    #logo img,
    .header_logo,
    .header-logo,
    .header-logo-dark,
    .nav-dark .header-logo,
    .nav-dark .header-logo-dark {
        display: block !important;
        max-height: 82px !important;
        height: 78px !important;
        width: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        filter: drop-shadow(0 1px 3px rgba(0,0,0,0.06));
        transition: all 0.3s ease !important;
    }
}

/* Mobile & Tablet Header (compact, centered, perfectly aligned) */
@media (max-width: 849px) {
    .hide-for-medium,
    .desktop-search-col,
    .desktop-contact-col {
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .show-for-medium {
        display: flex !important;
    }
    #masthead {
        padding: 6px 0 !important;
        min-height: 56px !important;
        height: auto !important;
    }
    #masthead .header-inner {
        min-height: 48px !important;
        height: auto !important;
        align-items: center !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
    }
    #logo {
        min-width: auto !important;
        width: auto !important;
        margin: 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
    }
    #logo img,
    .header_logo,
    .header-logo,
    .header-logo-dark,
    .nav-dark .header-logo,
    .nav-dark .header-logo-dark {
        display: block !important;
        max-height: 42px !important;
        height: 40px !important;
        width: auto !important;
        margin: 0 auto !important;
        object-fit: contain !important;
        filter: drop-shadow(0 1px 2px rgba(0,0,0,0.06));
    }
    .medium-logo-center .mobile-nav-left {
        flex: 0 0 44px !important;
        width: 44px !important;
        order: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }
    .medium-logo-center .logo {
        flex: 1 1 auto !important;
        order: 2 !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .medium-logo-center .mobile-nav-right {
        flex: 0 0 44px !important;
        width: 44px !important;
        order: 3 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }
}

/* Sticky Header Rules */
#header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 990 !important;
    background-color: #ffffff !important;
    transition: box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s ease !important;
}

#header.stuck,
#header.is-stuck {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
}

/* Smooth collapse top bar on scroll */
#header.stuck #top-bar,
#header.is-stuck #top-bar {
    max-height: 0 !important;
    opacity: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: none !important;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease !important;
}

/* Compact masthead on scroll */
#header.stuck #masthead,
#header.is-stuck #masthead {
    padding: 4px 0 !important;
    min-height: 64px !important;
}

#header.stuck #masthead .header-inner,
#header.is-stuck #masthead .header-inner {
    min-height: 56px !important;
}

#header.stuck #logo img,
#header.stuck .header-logo-dark,
#header.is-stuck #logo img,
#header.is-stuck .header-logo-dark {
    max-height: 54px !important;
    height: 48px !important;
}

#header.stuck .search-field,
#header.is-stuck .search-field {
    height: 38px !important;
    transition: height 0.25s ease !important;
}

#header.stuck .ux-search-submit,
#header.is-stuck .ux-search-submit {
    height: 38px !important;
    transition: height 0.25s ease !important;
}

#header.stuck #wide-nav .nav-top-link,
#header.is-stuck #wide-nav .nav-top-link {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    transition: padding 0.25s ease !important;
}

#wide-nav {
    background-color: #0c63a6 !important;
    border-top: none !important;
}

#header .header-bottom {
    border-top: none !important;
}

#header .search-field {
    background-color: #f8fafc !important;
    color: #1e293b !important;
    border: 1.5px solid #cbd5e1 !important;
    border-right: none !important;
    border-radius: 4px 0 0 4px !important;
    margin: 0 !important;
}

#header .search-field:focus {
    background-color: #ffffff !important;
    border-color: #0c63a6 !important;
    outline: none !important;
}

#header .ux-search-submit {
    background-color: #0c63a6 !important;
    border-color: #0c63a6 !important;
    border-radius: 0 4px 4px 0 !important;
    margin-left: 0 !important;
    color: #ffffff !important;
}

#wide-nav .nav-top-link {
    color: #ffffff !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    background: transparent !important;
    position: relative !important;
    border-radius: 0 !important;
    transition: all 0.2s ease !important;
}

#wide-nav .nav-line-grow > li > a:before,
#wide-nav .nav-line-grow > li:hover > a:before,
#wide-nav .nav-line-grow > li.active > a:before,
#wide-nav .nav-line-bottom > li > a:before,
#wide-nav .nav-line > li > a:before {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
    height: 0 !important;
}

#wide-nav .menu-item > .nav-top-link {
    background: transparent !important;
}

#wide-nav .menu-item.active > .nav-top-link,
#wide-nav .menu-item.current > .nav-top-link {
    color: #ffffff !important;
    background: transparent !important;
    box-shadow: inset 0 -3px 0 0 #ffffff !important;
}

#wide-nav .menu-item:hover > .nav-top-link {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: inset 0 -3px 0 0 rgba(255, 255, 255, 0.5) !important;
}

@media (max-width: 849px) {
    #header.stuck #logo img,
    #header.is-stuck #logo img {
        max-height: 46px !important;
        height: 42px !important;
    }
}

/* QSM Blue Palette Overrides */
.button.primary,
.button.checkout,
.btn-primary,
button[type="submit"].primary {
    background-color: #0c63a6 !important;
    border-color: #0c63a6 !important;
}
.button.primary:hover,
.button.checkout:hover,
.btn-primary:hover,
button[type="submit"].primary:hover {
    background-color: #084d85 !important;
    border-color: #084d85 !important;
}
.nav-line-grow > li.active > a:before,
.nav-line-grow > li:hover > a:before {
    background-color: #138cd2 !important;
}


/* Flatsome Blog & Sidebar styling matching 6483 */
.blog-wrapper {
    padding: 30px 0;
}
.blog-archive .post {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #ececec;
}
.blog-archive .post:last-child {
    border-bottom: none;
}
.entry-image img {
    width: 100%;
    height: auto;
    display: block;
}
.entry-category a {
    color: #0c63a6;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.entry-title {
    margin-top: 5px;
    margin-bottom: 10px;
    font-size: 1.6em;
    line-height: 1.3;
}
.entry-title a {
    color: #333;
    transition: color .2s;
}
.entry-title a:hover {
    color: #0c63a6;
}
.entry-divider.is-divider {
    height: 2px;
    max-width: 30px;
    background-color: #084d85;
    margin-top: 10px;
    margin-bottom: 10px;
}
.entry-meta {
    color: #999;
    font-size: 0.8em;
    margin-bottom: 15px;
}
.entry-meta a {
    color: #999;
}
.entry-meta a:hover {
    color: #0c63a6;
}
.entry-summary p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}
.more-link.button.primary.is-outline {
    color: #0c63a6 !important;
    border: 2px solid #0c63a6 !important;
    background: transparent !important;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 15px;
    border-radius: 99px;
    display: inline-block;
    transition: all .2s ease;
}
.more-link.button.primary.is-outline:hover {
    background: #0c63a6 !important;
    color: #fff !important;
}
footer.entry-meta {
    font-size: 0.85em;
    color: #777;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}
footer.entry-meta a {
    color: #555;
}
footer.entry-meta a:hover {
    color: #0c63a6;
}

/* Sidebar Widgets */
.post-sidebar .widget {
    margin-bottom: 30px;
}
.post-sidebar .widget-title {
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    margin-bottom: 10px;
    display: block;
    color: #111;
}
.post-sidebar .widget-title + .is-divider {
    height: 2px;
    max-width: 30px;
    background-color: #b20000;
    margin-top: 5px;
    margin-bottom: 15px;
}
.post-sidebar .widget_recent_entries ul,
.post-sidebar .widget_categories ul {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}
.post-sidebar .widget_recent_entries ul li,
.post-sidebar .widget_categories ul li {
    padding: 8px 0;
    border-bottom: 1px solid #ececec;
    font-size: 0.95em;
    line-height: 1.4;
}
.post-sidebar .widget_categories ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.post-sidebar .widget_categories ul li .count {
    color: #888;
    font-size: 0.88em;
    font-weight: normal;
}
.post-sidebar .widget_categories ul li.current-cat > a {
    font-weight: 700;
    color: #0c63a6;
}
.post-sidebar .widget_recent_entries ul li a,
.post-sidebar .widget_categories ul li a {
    color: #333;
    transition: color .2s;
}
.post-sidebar .widget_recent_entries ul li a:hover,
.post-sidebar .widget_categories ul li a:hover {
    color: #0c63a6;
}
.tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.tagcloud a {
    display: inline-block;
    border: 1px solid #ddd;
    color: #555;
    padding: 4px 10px;
    border-radius: 3px;
    text-transform: capitalize;
    transition: all .2s;
    line-height: 1.2;
}
.tagcloud a:hover,
.tagcloud a.active-tag {
    background-color: #0c63a6 !important;
    border-color: #0c63a6 !important;
    color: #fff !important;
}

/* Page Header Wrapper */
.page-header-wrapper .page-title {
    position: relative;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.page-header-wrapper .page-title-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}
.page-header-wrapper .title-overlay {
    background: rgba(0,0,0,0.5);
}
.page-header-wrapper .page-title-inner {
    position: relative;
    z-index: 1;
    padding: 30px 15px;
    width: 100%;
}
.page-header-wrapper .entry-title {
    color: #fff;
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 5px;
    text-transform: uppercase;
}
.page-header-wrapper .breadcrumbs {
    color: #ddd;
    font-size: 0.85em;
    text-transform: uppercase;
}
.page-header-wrapper .breadcrumbs a {
    color: #fff;
}
.page-header-wrapper .breadcrumbs .divider {
    margin: 0 6px;
    color: #aaa;
}

/* Related posts styling */
.mbws_related-post {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ececec;
}
.mbws_title_related h2 {
    font-size: 1.4em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 25px;
    color: #111;
}
.mbws_blog-1 .box-blog-post {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #ececec;
    border-radius: 4px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.mbws_blog-1 .box-text {
    padding: 15px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.mbws_blog-1 .post-title a {
    color: #222;
    font-weight: 700;
}
.mbws_blog-1 .post-title a:hover {
    color: #0c63a6;
}
.mbws_blog-1 .from_the_blog_excerpt {
    font-size: 0.88em;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
}
.single-post .entry-content p {
    text-align: justify;
    line-height: 1.8;
    margin-bottom: 16px;
    color: #333;
}
.single-post .entry-content ul {
    margin-bottom: 16px;
    line-height: 1.8;
}
.single-post .entry-content img,
.entry-content img {
    max-width: 100%;
    height: auto;
    margin: 15px auto;
    display: block;
    border-radius: 4px;
}

/* Responsive & Full-width Video Embeds for Posts */
.entry-content iframe,
.entry-content iframe.ql-video,
.entry-content .ql-video,
.entry-content video {
    display: block;
    width: 100% !important;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 420px;
    margin: 24px auto !important;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
}

.entry-content iframe.video-size-75,
.entry-content iframe[data-size="75"],
.entry-content iframe[style*="width: 75%"],
.entry-content iframe[style*="width:75%"] {
    width: 75% !important;
    max-width: 75% !important;
    margin: 24px auto !important;
}

.entry-content iframe.video-size-50,
.entry-content iframe[data-size="50"],
.entry-content iframe[style*="width: 50%"],
.entry-content iframe[style*="width:50%"] {
    width: 50% !important;
    max-width: 50% !important;
    margin: 24px auto !important;
}

@media (max-width: 768px) {
    .entry-content iframe,
    .entry-content iframe.ql-video,
    .entry-content .ql-video,
    .entry-content video,
    .entry-content iframe.video-size-75,
    .entry-content iframe.video-size-50 {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 220px;
        margin: 16px auto !important;
    }
}

/* Flatsome & Client Pagination Styling */
.woocommerce-pagination .nav-pagination,
.pagination-loop .nav-pagination,
ul.page-numbers.nav-pagination {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 30px auto !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}
.nav-pagination li {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
}
.nav-pagination li a.page-numbers,
.nav-pagination li span.page-numbers {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 14px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    color: #444444 !important;
    background-color: #ffffff !important;
    border: 1px solid #dcdcdc !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    transition: all 0.2s ease !important;
}
.nav-pagination li a.page-numbers:hover {
    color: #ffffff !important;
    background-color: var(--primary-color, #0c63a6) !important;
    border-color: var(--primary-color, #0c63a6) !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(12, 99, 166, 0.25) !important;
}
.nav-pagination li span.page-numbers.current,
.nav-pagination li span.current {
    color: #ffffff !important;
    background-color: var(--primary-color, #0c63a6) !important;
    border-color: var(--primary-color, #0c63a6) !important;
    cursor: default !important;
    box-shadow: 0 2px 5px rgba(12, 99, 166, 0.3) !important;
}
.nav-pagination li.disabled span.page-numbers {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    background-color: #f7f7f7 !important;
    border-color: #e5e5e5 !important;
}