/**
 * Alignment Fix CSS
 * Đảm bảo tất cả các phần được căn chỉnh thống nhất
 * @package SoiCauPro
 */

/* ========================================
   GLOBAL ALIGNMENT SYSTEM
   ======================================== */

/* Define consistent max-width for all sections */
:root {
    --content-max-width: 1160px;
    --site-padding: 0;
}

/* Reset body và html */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ========================================
   HERO BANNER - TOP POSITION
   ======================================== */

/* Banner wrapper - full width background */
.page > .hero-banner-section,
#page > .hero-banner-section {
    width: 100%;
    background: transparent;
    padding: 0;
    margin: 0;
}

.hero-banner-section {
    width: 100%;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
}

.hero-banner-section .hero-banner-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0;
    border-radius: 0;
    overflow: hidden;
}

/* ========================================
   HEADER ALIGNMENT
   ======================================== */

header#masthead,
header#masthead.site-header,
.site-header {
    width: 100%;
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
}

.site-header .header-wrapper,
header#masthead .header-wrapper {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
}

.site-header .container {
    width: 100%;
    padding: 0 20px;
    margin: 0;
    box-sizing: border-box;
}

.header-top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin: 0;
}

.site-branding {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #ffd700;
    font-weight: bold;
    font-size: 24px;
    text-transform: uppercase;
}

.header-info {
    display: flex;
    gap: 20px;
    align-items: center;
    color: white;
    margin-left: auto;
    padding-right: 0;
}

.header-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffd700;
    font-size: 14px;
}

.header-date i {
    color: #ffd700;
}

.header-phone {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffd700;
    font-size: 14px;
}

.header-phone i {
    color: #ffd700;
}

/* ========================================
   NAVIGATION ALIGNMENT
   ======================================== */

#site-navigation,
.main-navigation {
    width: 100%;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    padding: 0;
    margin-top: -1px !important; /* Sát với header */
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    outline: none !important;
}

#site-navigation::before,
#site-navigation::after,
.main-navigation::before,
.main-navigation::after {
    display: none !important;
    content: none !important;
}

.main-navigation .nav-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
    background: linear-gradient(90deg, #2c3e50 0%, #34495e 100%);
    box-sizing: border-box;
    padding: 0;
    border-radius: 8px;
    margin-top: 0;
}

.main-navigation .container {
    width: 100%;
    padding: 10px 20px;
    margin: 0;
    box-sizing: border-box;
}

/* ========================================
   QUICK MENU ALIGNMENT
   ======================================== */

.quick-menu-bar {
    width: 100%;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    padding: 15px 0;
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.quick-menu-bar::before,
.quick-menu-bar::after {
    display: none !important;
    content: none !important;
}

.quick-menu-bar .menu-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    box-sizing: border-box;
}

.quick-menu {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========================================
   CONTENT SECTIONS ALIGNMENT
   ======================================== */

.site-content {
    width: 100%;
    padding: 0px 0;
}

.site-content .container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

/* Homepage sections */
.homepage-section {
    max-width: var(--content-max-width);
    margin: 0 auto 15px;
    padding: 0;
    box-sizing: border-box;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

/* Loại bỏ padding thừa từ section content */
.homepage-section .section-content {
    padding: 0px;
}

/* Hero section alignment */
.hero-banner-section {
    max-width: var(--content-max-width);
    margin: 0 auto 15px;
    padding: 0;
    box-sizing: border-box;
    border-radius: 8px;
    overflow: hidden;
}

/* ========================================
   FOOTER ALIGNMENT
   ======================================== */

.site-footer {
    width: 100%;
    background: #2c3e50;
}

.site-footer .container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

/* Tablet */
@media (max-width: 1199px) and (min-width: 768px) {
    :root {
        --content-max-width: calc(100% - 40px);
    }
    
    .site-header .header-wrapper,
    .main-navigation .nav-wrapper,
    .quick-menu-bar .menu-wrapper,
    .homepage-section {
        margin-left: 20px;
        margin-right: 20px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    :root {
        --content-max-width: calc(100% - 30px);
    }
    
    .site-header .header-wrapper,
    .main-navigation .nav-wrapper,
    .quick-menu-bar .menu-wrapper,
    .homepage-section {
        margin-left: 15px;
        margin-right: 15px;
        border-radius: 0;
    }
    
    .header-info {
        display: flex !important;
        font-size: 11px;
        gap: 8px;
    }
    
    .header-date span,
    .header-phone span {
        display: inline-block;
    }
    
    .header-date i,
    .header-phone i {
        font-size: 12px;
    }
    
    .homepage-section {
        margin-bottom: 10px;
    }
    
    .homepage-section .section-content {
        padding: 0px;
    }
}

/* ========================================
   IMPORTANT OVERRIDES
   ======================================== */

/* Đảm bảo không có element nào tràn ra ngoài */
* {
    max-width: 100%;
}

/* Override các styles từ files khác */
body {
    background: #f0f0f0;
}

/* Ensure proper page wrapper */
.site {
    background: transparent;
    padding: 0;
    margin: 0;
}

/* Remove unwanted paddings */
.single-column-layout {
    padding: 0;
    margin: 0;
}

/* Fix navigation menu items */
.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 10px 0;
    gap: 15px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.1);
}

/* Fix cho tables và elements rộng */
.table-responsive {
    overflow-x: auto;
    max-width: 100%;
}

/* Đảm bảo images không tràn */
img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   REMOVE UNWANTED LINES & BORDERS
   ======================================== */

/* Remove all separator lines and backgrounds */
.site-header::after,
.site-header::before,
.main-navigation::after,
.main-navigation::before,
.quick-menu-bar::after,
.quick-menu-bar::before,
.header-wrapper::after,
.header-wrapper::before,
.nav-wrapper::after,
.nav-wrapper::before,
.menu-wrapper::after,
.menu-wrapper::before,
#masthead::after,
#masthead::before {
    display: none !important;
    content: none !important;
    background: none !important;
    border: none !important;
    height: 0 !important;
    width: 0 !important;
}

/* Remove all borders from header elements */
#masthead,
#masthead *,
.site-header,
.site-header *,
.header-wrapper,
.header-wrapper * {
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Remove any horizontal lines */
#masthead::after,
#masthead::before,
.site-header::after,
.site-header::before,
.header-wrapper::after,
.header-wrapper::before {
    display: none !important;
    content: none !important;
    height: 0 !important;
    border: none !important;
}

/* Remove any box shadows or outlines */
#site-navigation,
.nav-wrapper,
.menu-wrapper {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}

/* Remove border-bottom from header elements */
.header-top-bar,
.header-wrapper,
.site-header {
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* Remove all horizontal lines/separators */
hr,
.separator,
.divider {
    display: none !important;
}

/* ========================================
   MASTHEAD SPECIFIC FIXES
   ======================================== */

#masthead,
header#masthead,
header#masthead.site-header {
    background: transparent !important;
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0;
    padding: 0;
    position: relative;
}

#masthead:after,
#masthead:before,
header#masthead:after,
header#masthead:before {
    display: none !important;
    content: none !important;
    border: none !important;
    background: none !important;
}

#masthead .header-wrapper {
    max-width: var(--content-max-width);
    margin: 20px auto 0;
    background: linear-gradient(135deg, #c8232c 0%, #e74c3c 100%);
    border-radius: 8px 8px 0 0;
    padding: 0;
}

#masthead .container {
    padding: 0 20px;
    margin: 0;
}

/* Clean layout */
body #page > .hero-banner-section {
    margin-bottom: 0;
}

body #page > header#masthead {
    margin-top: 0;
}

#masthead .header-top {
    padding: 15px 0;
    margin: 0;
    width: 100%;
}
