/*
Theme Name: Mens Trim Guide Child
Description: Precision grooming hardware lab, zero-nick testing, and irritation-free shaving guides.
Author: Nathan Reed
Template: flatsome
Version: 1.0.0
*/

/*************** 1. CORE LAYOUT & ANTI-COLLAPSE (CHỐNG SẬP TRANG) ***************/
#main {
    min-height: 70vh !important;
    background-color: #ffffff !important;
    position: relative;
    z-index: 1;
}

#masthead {
    position: relative !important;
    background-color: #ffffff !important;
}

/*************** 2. HEADER TRÊN MÁY TÍNH (DESKTOP >= 850PX) ***************/
@media (min-width: 850px) {
    .header-main {
        height: 76px !important;
    }

    .header-main .flex-row {
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* Đưa Logo bám sát lề trái, cân đối với thanh Search bên phải */
    .header-main .flex-col.flex-center,
    .header-main .flex-col.flex-left {
        position: static !important;
        transform: none !important;
        left: auto !important;
        margin-right: auto !important;
        margin-left: 0 !important;
        justify-content: flex-start !important;
        text-align: left !important;
        flex: initial !important;
    }

    .header-main .header-logo img {
        max-height: 44px !important;
        width: auto !important;
        display: block !important;
    }
}

/*************** 3. HEADER TRÊN ĐIỆN THOẠI (MOBILE < 850PX) ***************/
@media (max-width: 849px) {
    .header-main {
        height: 60px !important;
    }

    .header-main .container {
        position: relative !important;
        height: 100% !important;
    }

    /* Khóa chặt Logo đúng tâm đối xứng màn hình */
    .header-main .flex-col.flex-center {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        max-width: 70% !important;
        z-index: 99 !important;
    }

    /* Triệt tiêu logo phụ để chống nhân đôi logo */
    .header-logo-dark,
    img.header-logo-dark,
    #logo .header-logo-dark {
        display: none !important;
    }

    /* Hiển thị logo SVG chính sắc nét */
    .header-main #logo img:not(.header-logo-dark),
    .header-main .header-logo img:not(.header-logo-dark) {
        max-height: 36px !important;
        height: auto !important;
        width: auto !important;
        display: block !important;
    }
}

/*************** 4. HEADER BOTTOM (MENU 2 DANH MỤC SILO CHÍNH) ***************/
.header-bottom {
    min-height: 46px !important;
    background-color: #0f172a !important; /* Đổi sang Slate Black tạo vẻ nam tính, vững chãi */
    border-top: 1px solid #1e293b !important;
    border-bottom: 2px solid #0284c7 !important; /* Chỉ line xanh Precision Blue */
}

.header-bottom .nav > li > a {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #e2e8f0 !important;
    padding: 13px 20px !important;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: all 0.2s ease-in-out;
}

.header-bottom .nav > li > a:hover {
    color: #38bdf8 !important;
    background-color: #1e293b;
}

/* Tab chuyên mục đang active */
.header-bottom .nav > li.current-menu-item > a,
.header-bottom .nav > li.current-category-ancestor > a,
.header-bottom .nav > li.active > a {
    color: #38bdf8 !important;
    font-weight: 800 !important;
    position: relative;
}

.header-bottom .nav > li.current-menu-item > a:after,
.header-bottom .nav > li.active > a:after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 20px;
    right: 20px;
    height: 3px;
    background-color: #38bdf8;
    border-radius: 2px 2px 0 0;
}

/*************** 5. TÌM KIẾM & TIÊU ĐỀ ARCHIVE CHUẨN TECH LAB ***************/
.button.primary,
button[type="submit"],
input[type="submit"],
.searchform button {
    background-color: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

.button.primary:hover,
button[type="submit"]:hover,
.searchform button:hover {
    background-color: #0369a1 !important;
}

.search-field {
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px 0 0 4px !important;
    background-color: #f8fafc !important;
}

.archive .page-title h1,
.archive .page-title span {
    font-size: 26px !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    letter-spacing: -0.5px;
    text-transform: capitalize !important;
}

/*************** 6. UI POLISH & HARDWARE CARDS ***************/
.box, .card, .post-item, .button:not(.circle), .badge {
    border-radius: 6px !important; /* Bo góc sắc gọn hơn cho nam tính */
}

.post-item, .box-shadow {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e2e8f0;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12) !important;
    border-color: #cbd5e1;
}

/*************** 7. SIDEBAR WIDGETS CHUẨN TỐI GIẢN ***************/
span.widget-title {
    position: relative;
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    padding-bottom: 8px;
    margin-bottom: 14px;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

span.widget-title:after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 40px;
    height: 2px;
    background-color: #0284c7;
}

.widget_categories ul, .flatsome_recent_posts ul {
    list-style: none;
    padding-left: 0;
}

.widget_categories li, .flatsome_recent_posts li {
    padding: 8px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 14px;
}

/*************** 8. AFFILIATE, QUICK VERDICT & TESTING LAB BOXES (E-E-A-T) ***************/
.safety-note, .answer-box, .verdict-box {
    background-color: #f8fafc;
    border-left: 4px solid #0284c7;
    padding: 18px 22px;
    margin: 25px 0;
    border-radius: 0 6px 6px 0;
    font-size: 15px;
    line-height: 1.65;
    color: #334155;
    border-top: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

/* Nút Amazon CTA tỷ lệ chuyển đổi cao */
.btn-amazon-cta {
    background-color: #f59e0b !important;
    color: #0f172a !important;
    font-weight: 800 !important;
    font-size: 15px !important;
    padding: 13px 28px !important;
    border: none !important;
    display: inline-block;
    text-align: center;
    text-decoration: none !important;
    border-radius: 5px !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
    transition: all 0.2s ease-in-out !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-amazon-cta:hover {
    background-color: #d97706 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.4) !important;
}

/*************** 9. TYPOGRAPHY & BODY CONTENT ***************/
body {
    line-height: 1.75;
    color: #334155;
    font-size: 16.5px;
}

@media only screen and (max-width: 48em) {
    body {
        font-size: 16px;
    }
    .post-item {
        margin-bottom: 20px;
    }
}

/*************** 10. EDITORIAL LINKS & OUTLINKS CHO MENSTRIMGUIDE ***************/
/* Link ngữ cảnh trong bài viết: Xanh chuẩn kỹ thuật #0284c7 */
article a,
.entry-content a,
.post-content a,
.single-post .content a:not(.button):not(.btn-amazon-cta),
#main p a,
#main li a,
#main td a {
    color: #0284c7 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-bottom: none !important;
    transition: all 0.2s ease-in-out !important;
}

/* Hover chuyển sang xanh đậm và highlight nền xanh nhạt */
article a:hover,
.entry-content a:hover,
.post-content a:hover,
.single-post .content a:not(.button):not(.btn-amazon-cta):hover,
#main p a:hover,
#main li a:hover,
#main td a:hover {
    color: #0369a1 !important;
    text-decoration: none !important;
    background-color: #f0f9ff !important;
    border-radius: 2px;
}

/* Icon nhận diện Outlink: Tự động gắn icon ngoại trừ chính domain menstrimguide.com */
article a[href^="http"]:not([href*="menstrimguide.com"]):not(.button):not(:has(img))::after,
.entry-content a[href^="http"]:not([href*="menstrimguide.com"]):not(.button):not(:has(img))::after,
#main p a[href^="http"]:not([href*="menstrimguide.com"]):not(.button):not(:has(img))::after,
#main li a[href^="http"]:not([href*="menstrimguide.com"]):not(.button):not(:has(img))::after {
    content: "" !important;
    display: inline-block !important;
    width: 12px !important;
    height: 12px !important;
    margin-left: 4px !important;
    vertical-align: baseline !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%230284c7'%3E%3Cpath d='M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z'/%3E%3Cpath d='M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
}

/* Loại bỏ gạch chân và background cho ảnh và nút bấm CTA */
article a:has(img),
.entry-content a:has(img),
article a img,
.entry-content a img,
a.button,
a.btn-amazon-cta {
    text-decoration: none !important;
    background-color: transparent !important;
    border: none !important;
}