/**
 * @version		1.0.2
 * @package		JoomlaXTC Stocky template for Joomla! 3.x
 * @author		JoomlaXTC http://www.joomlaxtc.com
 * @copyright	Copyright (C) 2015 Monev Software LLC. All rights reserved.
 * @license		http://www.joomlaxtc.com/license JoomlaXTC Proprietary Use License
 */

/* EMERGENCY LAYOUT FIXES */

/* 1. Force Full Width Backgrounds & Reset Body */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Ensure main wrappers take full width */
#headerwrap, 
#region1wrap, #region2wrap, #region3wrap, #region4wrap, 
#footerwrap, 
.xtc-wrapper {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
}

/* 2. Center Content Inner Containers */
#header, 
.xtc-wrapperpad, 
#region1, #region2, #region3, #footer {
    max-width: 1200px !important;
    margin: 0 auto !important;
    width: 100% !important;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

/* 3. Header Layout (Flexbox for Logo + Menu) */
#header {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    flex-wrap: wrap;
    height: auto !important;
    padding-top: 25px;
    padding-bottom: 25px;
}

#logo {
    float: none !important;
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    margin-right: 40px; /* Minimum spacing from menu */
}

#menuwrap {
    float: none !important;
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    width: auto !important;
    margin-top: 0 !important;
    padding: 0 !important;
    margin-left: auto; /* Push to the far right */
}

/* 4. Horizontal Menu Fix */
ul.xtcdefaultmenu, ul.menu {
    margin: 0;
    padding: 0;
    list-style: none !important;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    flex-wrap: wrap;
}

ul.xtcdefaultmenu > li, ul.menu > li {
    display: inline-block !important;
    float: none !important;
    position: relative;
    padding: 0 !important;
    margin: 0;
    list-style: none !important;
}

ul.xtcdefaultmenu > li > a, ul.menu > li > a {
    display: block;
    text-decoration: none;
    white-space: nowrap;
    padding: 15px 20px;
    font-size: 14px;
    text-transform: uppercase;
    /* Inherit color or force if needed, assuming theme handles colors */
}

/* Submenus */
ul.xtcdefaultmenu ul, ul.menu ul {
    position: absolute;
    display: none;
    top: 100%;
    left: 0;
    z-index: 9999;
    background-color: #fff;
    min-width: 200px;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: left;
}

ul.xtcdefaultmenu li:hover > ul, ul.menu li:hover > ul {
    display: block;
}

ul.xtcdefaultmenu ul li, ul.menu ul li {
    display: block;
    width: 100%;
    float: none;
    border-bottom: 1px solid #eee;
}

ul.xtcdefaultmenu ul li a, ul.menu ul li a {
    padding: 10px 15px;
    display: block;
    color: #333; /* Ensure submenu text is visible on white bg */
}

/* 5. Hero Image & Module Fixes */
.row-fluid {
    width: 100% !important;
}

/* Add more space to the Hero section (likely Region 1 or Region 2) */
#region1wrap, #region1 {
    padding-top: 80px !important;
    padding-bottom: 80px !important;
}

/* If Hero is in Showcase position inside Region 3, target it too */
#showcase1_6 {
    padding-top: 40px;
    padding-bottom: 40px;
}

.module {
    margin-bottom: 20px;
}

/* Remove extra spacing that might cause white bars */
.xtc-spacer {
    display: none;
}

/* 6. Footer Fixes */
#footerwrap {
    text-align: center;
}

#footer ul.menu, #footer .module-content ul {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 20px 0;
}

#footer ul.menu li {
    display: inline-block;
    float: none;
    margin: 0 15px;
}

#footer ul.menu li a {
    text-transform: uppercase;
    color: #2676ac; /* Adjust color to match design (light blue) if needed, or white/grey */
    font-weight: bold;
    text-decoration: none;
}

/* Fix footer copyright text centering */
#footer p {
    text-align: center;
}

/* Mobile Responsive Adjustments */
.mobile-only {
    display: none !important;
}

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

    /* Adjust Header Layout */
    #header {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        padding: 10px 15px;
        align-items: center;
    }
    
    #logo {
        margin-right: auto;
        margin-bottom: 0;
        text-align: left;
        flex: 0 1 auto;
    }
    
    #logo img {
        max-height: 60px;
        width: auto;
    }
    
    #menuwrap {
        width: auto !important;
        text-align: right;
        margin-left: 0;
        flex: 0 0 auto;
    }
    
    /* Hide Desktop Menu */
    ul.xtcdefaultmenu, ul.menu {
        display: none !important;
    }
    
    /* Hamburger Menu Styles */
    .mobile-hamburger-wrapper {
        position: relative;
        width: auto;
        display: inline-block;
        margin-top: 0;
    }
    
    .hamburger-btn {
        background: transparent;
        border: 1px solid rgba(255,255,255,0.3);
        border-radius: 4px;
        cursor: pointer;
        padding: 8px 10px;
        display: inline-block;
    }
    
    .hamburger-btn span.bar {
        display: block;
        width: 22px;
        height: 2px;
        background-color: #fff; /* White bars */
        margin: 5px 0;
        border-radius: 2px;
    }
    
    .mobile-menu-content {
        display: none; /* Toggled by JS */
        background-color: #fff;
        margin-top: 15px;
        text-align: left;
        width: 300px; /* Width of dropdown */
        right: 0; /* Align right */
        left: auto;
        position: absolute;
        z-index: 10000;
        border-top: 1px solid #eee;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        border-radius: 4px;
    }
    
    .mobile-menu-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .mobile-menu-list li {
        border-bottom: 1px solid #f0f0f0;
        display: block;
        width: 100%;
    }
    
    .mobile-menu-list li a {
        display: block;
        padding: 15px;
        text-decoration: none;
        color: #333;
        font-size: 16px;
        text-transform: uppercase;
    }
    
    /* Adjust Hero Padding for Mobile */
    #region1wrap, #region1 {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
}