/* ===================================
   CONFLICTS RESOLVER CSS
   =================================== */

/* 
 * File này xử lý conflicts giữa các CSS files
 * Đảm bảo specificity đúng mức và không có duplicate styles
 */

/* ===================================
   RESPONSIVE VISIBILITY CLASSES
   =================================== */

/* Desktop Only - Ẩn trên mobile và tablet */
.desktop-only {
    display: block;
}

/* Mobile Only - Ẩn trên desktop */
.mobile-only {
    display: none;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
}

@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
}

/* ===================================
   HEADER CONFLICTS RESOLUTION
   =================================== */

/* Đảm bảo .site-header từ style.css có priority cao nhất */
.site-header {
    /* Override mobile-menu.css và responsive.css */
    position: relative !important; /* Thay đổi từ fixed thành relative để có thể mở rộng */
    top: auto !important; /* Loại bỏ top cố định */
    left: auto !important; /* Loại bỏ left cố định */
    right: auto !important; /* Loại bỏ right cố định */
    z-index: 1000 !important; /* Giảm z-index */
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    height: auto !important; /* Đảm bảo height tự động */
    min-height: auto !important; /* Loại bỏ min-height cố định */
    overflow: visible !important; /* Cho phép overflow visible */
}

/* Đảm bảo header layout hoạt động đúng */
.header-content .header-row {
    display: grid !important;
    grid-template-columns: auto 1fr auto auto !important;
    align-items: center !important;
    gap: var(--spacing-md) !important;
    width: 100% !important;
    overflow: visible !important;
    height: auto !important; /* Đảm bảo height tự động */
    min-height: 60px !important; /* Giữ min-height tối thiểu */
    max-height: none !important; /* Loại bỏ max-height cố định */
}

/* Header Actions - Luôn hiển thị trên tất cả devices */
.header-actions {
    overflow: visible !important;
    min-width: 0 !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: var(--spacing-sm, 12px) !important;
}

/* Search và Theme Toggle - Luôn hiển thị */
.search-toggle-btn,
.theme-toggle-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border: none !important;
    background: transparent !important;
    color: var(--text-primary, #1f2937) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-radius: 8px !important;
}

.search-toggle-btn:hover,
.theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    transform: translateY(-1px) !important;
}

/* CTA Button - Luôn hiển thị */
.header-cta-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 16px !important;
    background: var(--accent-color, #e53e3e) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
}

.header-cta-button:hover {
    background: var(--accent-color-dark, #c53030) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3) !important;
}

/* Đảm bảo navigation không bị wrap */
.main-navigation {
    min-width: 0 !important;
    flex-shrink: 1 !important;
    overflow: visible !important;
}

.main-navigation .nav-container {
    max-width: 700px !important;
    overflow: visible !important;
}

.main-navigation .nav-menu {
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    gap: var(--spacing-md) !important;
    overflow: visible !important;
}

.header-navigation {
    grid-column: 2 !important;
    justify-self: center !important;
}

.header-menu-toggle {
    grid-column: 3 !important;
    justify-self: end !important;
}

.header-actions {
    grid-column: 4 !important;
    justify-self: end !important;
}

/* Đảm bảo navigation không bị wrap */
.main-navigation .nav-menu {
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

/* Đảm bảo search overlay hoạt động đúng */
.header-search-overlay {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10000 !important;
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(8px) !important;
    border-top: 1px solid var(--border-color) !important;
    transform: translateY(-20px) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important; /* Tăng thời gian transition */
    max-height: 0 !important;
    overflow: hidden !important;
    width: 100% !important;
    height: auto !important; /* Đảm bảo height tự động */
    min-height: 0 !important; /* Loại bỏ min-height cố định */
    opacity: 0 !important; /* Thêm opacity ban đầu */
    visibility: hidden !important; /* Thêm visibility ban đầu */
    display: flex !important; /* Thêm display flex để căn giữa */
    align-items: center !important; /* Căn giữa theo chiều dọc */
    justify-content: center !important; /* Căn giữa theo chiều ngang */
    /* Đảm bảo căn giữa hoàn hảo */
    box-sizing: border-box !important;
}

.header-search-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    max-height: 280px !important; /* Giảm max-height từ 400px xuống 280px */
    overflow: visible !important;
    min-height: 180px !important; /* Giảm min-height từ 250px xuống 180px */
    padding: var(--spacing-lg, 24px) var(--spacing-xl, 40px) !important; /* Giảm padding vertical, tăng padding horizontal */
    backdrop-filter: blur(20px) !important; /* Tăng blur effect */
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 2px solid var(--accent-color, #e53e3e) !important; /* Thêm border accent */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important; /* Thêm shadow đẹp */
}

.header-search-overlay .search-overlay-content {
    transform: scale(1) !important;
    opacity: 1 !important;
    border: 2px solid var(--accent-color, #e53e3e) !important; /* Thay đổi border thành accent color */
    margin: 0 !important; /* Loại bỏ margin auto vì đã dùng flexbox */
    background: rgba(255, 255, 255, 0.95) !important; /* Thêm background semi-transparent */
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 15px 40px rgba(229, 62, 62, 0.2) !important; /* Thêm shadow với accent color */
    border-radius: 16px !important; /* Tăng border-radius */
    padding: var(--spacing-lg, 24px) var(--spacing-xl, 40px) !important; /* Giảm padding vertical, tăng padding horizontal */
    width: 95% !important; /* Tăng width từ 90% lên 95% */
    max-width: 800px !important; /* Tăng max-width từ 600px lên 800px */
    flex-shrink: 0 !important; /* Ngăn content bị co lại */
}

/* Đảm bảo search button icons hiển thị đúng */
.header-actions .search-toggle-btn .search-icon {
    display: block !important;
    opacity: 1 !important;
    transition: all 0.3s ease !important;
}

.header-actions .search-toggle-btn .close-icon {
    display: none !important;
    opacity: 0 !important;
    transition: all 0.3s ease !important;
}

.header-actions .search-toggle-btn[aria-expanded="true"] .search-icon {
    display: none !important;
    opacity: 0 !important;
    transform: rotate(-90deg) !important; /* Thêm animation xoay */
}

.header-actions .search-toggle-btn[aria-expanded="true"] .close-icon {
    display: block !important;
    opacity: 1 !important;
    transform: rotate(0deg) !important; /* Thêm animation xoay */
}

/* Cải thiện search form styling */
.header-search-overlay .search-input-container {
    margin-bottom: var(--spacing-md, 16px) !important; /* Giảm margin bottom từ lg xuống md */
    position: relative !important;
    display: flex !important;
    gap: var(--spacing-md, 16px) !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.05) !important;
    padding: var(--spacing-sm, 12px) var(--spacing-md, 16px) !important; /* Giảm padding vertical */
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    transition: all 0.3s ease !important;
}

.header-search-overlay .search-input-container:focus-within {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(229, 62, 62, 0.3) !important;
    box-shadow: 0 4px 20px rgba(229, 62, 62, 0.1) !important;
    transform: translateY(-2px) !important;
}

/* Thêm animation cho search field */
.header-search-overlay .header-search-field {
    flex: 1 !important;
    width: 100% !important;
    padding: var(--spacing-sm, 12px) var(--spacing-lg, 24px) !important; /* Giảm padding vertical */
    border: 2px solid var(--border-color, #e2e8f0) !important;
    border-radius: 12px !important;
    font-size: var(--text-lg, 18px) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--text-primary, #1a202c) !important;
    transition: all 0.3s ease !important;
    outline: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important; /* Thêm shadow nhẹ */
}

.header-search-overlay .header-search-field:focus {
    border-color: var(--accent-color, #e53e3e) !important;
    box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.1), 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    background: rgba(255, 255, 255, 1) !important;
    transform: translateY(-2px) !important;
}

.header-search-overlay .header-search-submit {
    padding: var(--spacing-sm, 12px) var(--spacing-lg, 24px) !important; /* Giảm padding vertical */
    background: var(--accent-color, #e53e3e) !important;
    border: none !important;
    border-radius: 12px !important;
    color: white !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: var(--spacing-sm, 8px) !important;
    white-space: nowrap !important; /* Tránh text bị wrap */
    min-width: fit-content !important; /* Đảm bảo button không bị co */
}

.header-search-overlay .header-search-field {
    width: 100% !important;
    padding: var(--spacing-md, 16px) var(--spacing-lg, 24px) !important;
    border: 2px solid var(--border-color, #e2e8f0) !important;
    border-radius: 12px !important;
    font-size: var(--text-lg, 18px) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--text-primary, #1a202c) !important;
    transition: all 0.3s ease !important;
    outline: none !important;
}

.header-search-overlay .header-search-field:focus {
    border-color: var(--accent-color, #e53e3e) !important;
    box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.1) !important;
    background: rgba(255, 255, 255, 1) !important;
    transform: translateY(-2px) !important;
}

.header-search-overlay .header-search-submit {
    padding: var(--spacing-md, 16px) var(--spacing-lg, 24px) !important;
    background: var(--accent-color, #e53e3e) !important;
    border: none !important;
    border-radius: 12px !important;
    color: white !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: var(--spacing-sm, 8px) !important;
}

.header-search-overlay .header-search-submit:hover,
.header-search-overlay .header-search-submit:focus {
    background: var(--accent-color-dark, #c53030) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(229, 62, 62, 0.3) !important;
    outline: none !important;
}

.header-search-overlay .search-suggestions {
    text-align: center !important;
    margin-top: var(--spacing-sm, 12px) !important; /* Giảm margin top */
    padding: var(--spacing-sm, 12px) var(--spacing-md, 16px) !important; /* Giảm padding vertical */
    background: rgba(255, 255, 255, 0.1) !important; /* Thêm background nhẹ */
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important; /* Thêm border nhẹ */
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    transition: all 0.3s ease !important;
}

.header-search-overlay .search-suggestions:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px) !important;
}

.header-search-overlay .search-hint {
    color: rgba(0, 0, 0, 0.8) !important; /* Thay đổi màu cho phù hợp với dark overlay */
    font-size: var(--text-sm, 14px) !important;
    margin: 0 !important;
    opacity: 1 !important;
    font-style: italic !important; /* Thêm style italic */
    line-height: 1.5 !important;
}

/* Thêm animation cho search overlay khi mở */
@keyframes searchOverlaySlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        max-height: 280px; /* Cập nhật max-height để khớp với CSS */
    }
}

@keyframes searchContentFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.header-search-overlay.active {
    animation: searchOverlaySlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

.header-search-overlay.active .search-overlay-content {
    animation: searchContentFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards !important;
}

/* Cải thiện search field focus animation */
.header-search-overlay .header-search-field {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.header-search-overlay .header-search-field:focus {
    transform: translateY(-3px) !important;
    box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.15), 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

/* Cải thiện search button hover effect */
.header-search-overlay .header-search-submit {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
}

.header-search-overlay .header-search-submit::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
    transition: left 0.5s ease !important;
}

.header-search-overlay .header-search-submit:hover::before {
    left: 100% !important;
}

.header-search-overlay .header-search-submit:hover {
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 12px 30px rgba(229, 62, 62, 0.4) !important;
}

/* ===================================
   BLOG PAGE CONFLICTS RESOLUTION
   =================================== */

/* Đảm bảo blog page hero không conflict với page-hero.css */
.blog-page .page-hero {
    /* Override page-hero.css cho blog page */
    background: var(--bg-secondary) !important;
    background-image: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%) !important;
}

/* Đảm bảo blog page hero title và subtitle có style riêng */
.blog-page .page-hero .page-title {
    color: var(--text-primary) !important;
}

.blog-page .page-hero .page-subtitle {
    color: var(--text-secondary) !important;
}

/* ===================================
   PAGE HERO CONFLICTS RESOLUTION
   =================================== */

/* Đảm bảo tất cả page hero có style nhất quán */
.page-hero,
.single-post-header,
.single-service-header,
.archive-header {
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%) !important;
    padding: calc(var(--header-offset, 60px) + 80px) 0 60px !important;
    text-align: center !important;
    margin-bottom: 50px !important;
    border-bottom: 1px solid var(--border-color) !important;
    width: 100% !important;
    position: relative !important;
}

/* Đảm bảo tất cả hero section có full-width background */
.page-hero::before,
.single-post-header::before,
.single-service-header::before,
.archive-header::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100vw !important;
    height: 100% !important;
    background: inherit !important;
    z-index: -1 !important;
}

.page-hero .page-title {
    font-size: clamp(2rem, 4vw, 3rem) !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    margin: 0 0 14px !important;
}

.page-hero .page-subtitle {
    font-size: 1.05rem !important;
    color: var(--text-secondary) !important;
    max-width: 720px !important;
    margin: 0 auto !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .page-hero {
        padding: calc(var(--header-offset, 60px) + 60px) 0 40px !important;
    }
    
    .page-hero .page-title {
        font-size: clamp(1.5rem, 5vw, 2.5rem) !important;
    }
    
    /* Mobile search overlay adjustments */
    .header-search-overlay.active {
        max-height: 200px !important; /* Giảm height trên mobile */
        min-height: 140px !important;
        padding: var(--spacing-md, 16px) var(--spacing-sm, 12px) !important;
        align-items: flex-start !important; /* Căn lên trên cho mobile */
        padding-top: var(--spacing-lg, 24px) !important; /* Thêm padding top */
    }
    
    .header-search-overlay .search-overlay-content {
        width: 98% !important; /* Tăng width trên mobile */
        max-width: none !important;
        padding: var(--spacing-md, 16px) !important;
        margin: 0 auto !important; /* Căn giữa trên mobile */
    }
    
    .header-search-overlay .search-input-container {
        flex-direction: column !important; /* Stack vertically trên mobile */
        gap: var(--spacing-sm, 12px) !important;
    }
    
    .header-search-overlay .header-search-field {
        width: 100% !important;
        padding: var(--spacing-sm, 12px) !important;
    }
    
    .header-search-overlay .header-search-submit {
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .page-hero {
        padding: calc(var(--header-offset, 60px) + 40px) 0 30px !important;
    }
}

/* ===================================
   HEADER SCROLL ANIMATION & SECTION PADDING
   =================================== */

/* Đảm bảo page content không bị che bởi fixed header */
body {
    padding-top: var(--header-offset, 80px) !important;
}

/* Đảm bảo main content có margin-top đúng */
main.site-main,
.site-main,
.page-content,
.single-post,
.single-post-page,
.single-service-page,
.single-job {
    margin-top: 0 !important;
}

/* Đảm bảo hero sections có padding-top đúng */
.page-hero,
.single-post-header,
.single-service-header,
.archive-header,
.hero-section {
    padding-top: calc(var(--header-offset, 80px) + 60px) !important;
}

/* Header scroll animation - Đè lên content */
.site-header {
    position: fixed !important; /* Luôn fixed để ở trên cùng */
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

/* Header khi scroll lên trên cùng */
.site-header.header-scrolled {
    position: fixed !important; /* Chuyển về fixed khi scroll */
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: var(--shadow-md) !important;
}

/* Header khi ở vị trí đầu trang */
.site-header.header-top {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid transparent !important;
    box-shadow: none !important;
}

/* Header content */
.header-content {
    padding: 15px 0 !important;
    transition: padding 0.3s ease !important;
}

.header-content.header-scrolled {
    padding: 10px 0 !important;
}

.header-content.header-top {
    padding: 20px 0 !important;
}

/* Logo animation */
.header-logo img {
    transition: all 0.3s ease !important;
}

.header-scrolled .header-logo img {
    transform: scale(0.9) !important;
}

.header-top .header-logo img {
    transform: scale(1) !important;
}

/* Navigation links animation */
.header-navigation .main-navigation a {
    transition: all 0.3s ease !important;
    color: var(--text-primary) !important;
}

.header-scrolled .header-navigation .main-navigation a {
    color: var(--text-primary) !important;
}

.header-top .header-navigation .main-navigation a {
    color: var(--text-hero) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* CTA button animation */
.header-cta-button {
    transition: all 0.3s ease !important;
}

.header-scrolled .header-cta-button {
    transform: scale(0.95) !important;
}

.header-top .header-cta-button {
    transform: scale(1) !important;
}

/* Search button animation */
.search-toggle-btn {
    transition: all 0.3s ease !important;
}

.header-scrolled .search-toggle-btn {
    color: var(--text-primary) !important;
}

.header-top .search-toggle-btn {
    color: var(--text-primary) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Menu toggle animation */
.header-menu-toggle {
    transition: all 0.3s ease !important;
}

.header-scrolled .header-menu-toggle {
    color: var(--text-primary) !important;
}

.header-top .header-menu-toggle {
    color: var(--text-light) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Smooth transition for all header elements */
.site-header * {
    transition: all 0.3s ease !important;
}

/* ===================================
   RESPONSIVE HEADER ANIMATION
   =================================== */

@media (max-width: 768px) {
    .site-header {
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    }
    
    .site-header.header-top {
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
    }
    
    .header-navigation .main-navigation a,
    .search-toggle-btn,
    .header-menu-toggle {
        color: var(--text-primary) !important;
        text-shadow: none !important;
    }
}

/* ===================================
   SECTION PADDING ADJUSTMENT
   =================================== */

/* Đảm bảo section đầu tiên không bị header che */
.site-header + *,
.site-header + section,
.site-header + .app-hero-section,
.site-header + .hero-section,
.site-header + .info-features-section {
    padding-top: 120px !important; /* Padding để không bị header che */
}

/* Khi header scroll thì giảm padding */
.site-header.header-scrolled + *,
.site-header.header-scrolled + section,
.site-header.header-scrolled + .app-hero-section,
.site-header.header-scrolled + .hero-section,
.site-header.header-scrolled + .info-features-section {
    padding-top: 80px !important; /* Giảm padding khi header đã scroll */
}

/* Responsive padding */
@media (max-width: 768px) {
    .site-header + *,
    .site-header + section,
    .site-header + .app-hero-section,
    .site-header + .hero-section,
    .site-header + .info-features-section {
        padding-top: 100px !important;
    }
    
    .site-header.header-scrolled + *,
    .site-header.header-scrolled + section,
    .site-header.header-scrolled + .app-hero-section,
    .site-header.header-scrolled + .hero-section,
    .site-header.header-scrolled + .info-features-section {
        padding-top: 70px !important;
    }
}

@media (max-width: 480px) {
    .site-header + *,
    .site-header + section,
    .site-header + .app-hero-section,
    .site-header + .hero-section,
    .site-header + .info-features-section {
        padding-top: 90px !important;
    }
    
    .site-header.header-scrolled + *,
    .site-header.header-scrolled + section,
    .site-header.header-scrolled + .app-hero-section,
    .site-header.header-scrolled + .hero-section,
    .site-header.header-scrolled + .info-features-section {
        padding-top: 65px !important;
    }
}

/* ===================================
   PAGE & SINGLE TOP SPACING FIX (avoid header overlap)
   =================================== */

/* Dùng biến --header-offset để luôn khớp chiều cao thật của header */
:root { --header-offset: 120px; }

/* Áp dụng cho phần tử main ngay sau header trên tất cả các trang */
.site-header + main.site-main,
.site-header + .site-main,
.site-header + .page-content,
.site-header + .single-post,
.site-header + .single-post-page,
.site-header + .single-service-page,
.site-header + .single-job {
    padding-top: calc(var(--header-offset) + 20px) !important;
}

/* Nếu phần tử đầu tiên là hero banner/section tuỳ trang, cũng cộng offset */
.site-header + section.page-hero,
.site-header + section.hero-section,
.site-header + section.app-hero-section,
.site-header + section.info-features-section {
    padding-top: calc(var(--header-offset) + 40px) !important;
}

/* Khi header đã scroll thì giảm bớt padding một chút */
.site-header.header-scrolled + main.site-main,
.site-header.header-scrolled + .site-main,
.site-header.header-scrolled + .page-content,
.site-header.header-scrolled + .single-post,
.site-header.header-scrolled + .single-post-page,
.site-header.header-scrolled + .single-service-page,
.site-header.header-scrolled + .single-job {
    padding-top: calc(var(--header-offset) + 0px) !important;
}

.site-header.header-scrolled + section.page-hero,
.site-header.header-scrolled + section.hero-section,
.site-header.header-scrolled + section.app-hero-section,
.site-header.header-scrolled + section.info-features-section {
    padding-top: calc(var(--header-offset) + 20px) !important;
}

/* Responsive adjustments sử dụng cùng biến offset */
@media (max-width: 768px) {
    :root { --header-offset: 100px; }
}

@media (max-width: 480px) {
    :root { --header-offset: 90px; }
}

/* Đảm bảo .header-content từ style.css có priority cao nhất */
.header-content {
    /* Override mobile-menu.css và responsive.css */
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 var(--spacing-md) !important;
}

/* ===================================
   MOBILE MENU CONFLICTS RESOLUTION
   =================================== */

/* Đảm bảo mobile menu styles không conflict với header styles */
.mobile-menu-container {
    /* Giữ nguyên mobile menu styles */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10001 !important;
}

/* ===================================
   RESPONSIVE CONFLICTS RESOLUTION
   =================================== */

/* Đảm bảo responsive styles không conflict với base styles */
@media (max-width: 768px) {
    .site-header {
        /* Override mobile-menu.css header styles */
        position: fixed !important;
        background: var(--bg-primary) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-bottom: 1px solid var(--bg-tertiary) !important;
    }
    
    .header-content {
        /* Override mobile-menu.css header-content styles */
        padding: var(--spacing-sm) var(--spacing-sm) !important;
    }
}

/* ===================================
   SPECIFICITY ENHANCEMENT
   =================================== */

/* Sử dụng higher specificity để override conflicts */
body .site-header,
html body .site-header {
    /* Đảm bảo header styles từ style.css luôn được ưu tiên */
    background: var(--bg-primary) !important;
    box-shadow: var(--shadow-md) !important;
}

body .header-content,
html body .header-content {
    /* Đảm bảo header-content styles từ style.css luôn được ưu tiên */
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* ===================================
   UTILITY CLASSES OVERRIDE
   =================================== */

/* Đảm bảo utility classes từ modern-base.css không bị override */
.btn,
.card,
.form-input {
    /* Giữ nguyên utility classes */
    all: unset;
    /* Re-apply từ modern-base.css */
}

/* ===================================
   ANIMATION CONFLICTS RESOLUTION
   =================================== */

/* Đảm bảo animations không conflict */
.site-header,
.header-content,
.mobile-menu-container {
    /* Sử dụng CSS variables cho transitions */
    transition: all var(--transition-normal) !important;
}

/* ===================================
   DARK MODE CONFLICTS RESOLUTION
   =================================== */

/* Đảm bảo dark mode hoạt động đúng */
[data-theme="dark"] .site-header {
    background: var(--bg-dark) !important;
    color: var(--text-light) !important;
}

[data-theme="dark"] .header-content {
    color: var(--text-light) !important;
}

/* ===================================
   ACCESSIBILITY ENHANCEMENT
   =================================== */

/* Đảm bảo accessibility không bị ảnh hưởng bởi conflicts */
.site-header:focus-within {
    outline: 2px solid var(--primary-color) !important;
    outline-offset: 2px !important;
}

/* ===================================
   PERFORMANCE OPTIMIZATION
   =================================== */

/* Sử dụng will-change để tối ưu animations */
.site-header,
.header-content,
.mobile-menu-container {
    will-change: transform, opacity;
}

/* ===================================
   BROWSER COMPATIBILITY
   =================================== */

/* Đảm bảo compatibility với các browsers cũ */
.site-header {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ===================================
   PRINT STYLES
   =================================== */

/* Đảm bảo print styles không bị ảnh hưởng */
@media print {
    .site-header,
    .mobile-menu-container {
        display: none !important;
    }
} 

/* Mobile Header Layout */
@media (max-width: 1024px) {
    .header-content .header-row {
        grid-template-columns: auto auto auto !important; /* Logo, Actions, Menu Toggle */
        gap: var(--spacing-sm, 12px) !important;
    }
    
    .header-navigation {
        display: none !important; /* Ẩn navigation trên tablet */
    }
    
    .header-actions {
        gap: var(--spacing-xs, 8px) !important; /* Giảm gap trên tablet */
    }
    
    .search-toggle-btn,
    .theme-toggle-btn {
        width: 36px !important; /* Giảm size trên tablet */
        height: 36px !important;
    }
    
    .header-cta-button {
        padding: 6px 12px !important; /* Giảm padding trên tablet */
        font-size: 0.8rem !important;
    }
}

@media (max-width: 768px) {
    .header-content .header-row {
        grid-template-columns: auto auto auto !important; /* Logo, Actions, Menu Toggle */
        gap: var(--spacing-xs, 8px) !important;
    }
    
    .header-actions {
        gap: var(--spacing-xs, 8px) !important;
        order: 2 !important; /* Đặt actions trước menu toggle */
    }
    
    .header-menu-toggle {
        order: 3 !important; /* Menu toggle cuối cùng */
    }
    
    .search-toggle-btn,
    .theme-toggle-btn {
        width: 32px !important; /* Giảm size trên mobile */
        height: 32px !important;
    }
    
    .header-cta-button {
        padding: 6px 10px !important; /* Giảm padding trên mobile */
        font-size: 0.75rem !important;
    }
    
    /* Đảm bảo tất cả buttons đều hiển thị */
    .search-toggle-btn,
    .theme-toggle-btn,
    .header-cta-button {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 480px) {
    .header-content .header-row {
        gap: 6px !important; /* Giảm gap tối thiểu */
    }
    
    .header-actions {
        gap: 6px !important;
    }
    
    .search-toggle-btn,
    .theme-toggle-btn {
        width: 28px !important; /* Size nhỏ nhất trên mobile */
        height: 28px !important;
    }
    
    .header-cta-button {
        padding: 4px 8px !important;
        font-size: 0.7rem !important;
    }
}

/* Đảm bảo navigation không bị wrap */
.main-navigation {
    min-width: 0 !important;
    flex-shrink: 1 !important;
    overflow: visible !important;
} 