/* BASE STYLES & VARIABLES */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    --xp-black: #231f20;
    --xp-yellow: #ffd520;
    --xp-white: #ffffff;
}
a { text-decoration: none; }

/* --- HEADER HERO (HOME) --- */
#header-hero {
    position: relative;
    height: 350px;
    /* Ensure this path matches where your image is relative to the CSS file, or use /images/.. */
    background: url('../images/header-background.webp') center / cover no-repeat;
    color: var(--xp-white);
    display: flex;
    align-items: center; 
    justify-content: center;
}
#header-hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(35, 31, 32, 0.4); 
    z-index: 1;
}

/* Desktop/Tablet Header Content */
.hero-content {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 20px 40px; z-index: 2; 
}
.hero-top-text { 
    text-align: right; 
    font-size: 1.1rem; 
    font-weight: 600; 
    letter-spacing: 0.05em; 
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7); 
}
.hero-bottom-text { 
    text-align: center; 
    font-size: 2.2rem; 
    font-weight: 800; 
    letter-spacing: 0.1em; 
    text-shadow: 2px 2px 5px rgba(0,0,0,0.8); 
}
.hero-bottom-text .dot { color: var(--xp-yellow); }
.hero-logo-overlay { 
    position: absolute; 
    top: 50%; 
    left: 5%; 
    transform: translateY(-50%); 
    z-index: 3; 
}
.hero-logo-overlay img { 
    max-height: 200px; 
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.7)); 
}

/* =========================================
   3. INTERIOR HERO
   ========================================= */
#interior-hero {
    position: relative;
    height: 200px; /* Increased slightly to give the stacked layout room */
    background-color: var(--xp-black);
    background: url('../images/header-background.webp') center / cover no-repeat;
    /* Remove 'display: flex' here so Bootstrap rows work naturally */
    display: block; 
    padding-top: 0;
}
#interior-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(35, 31, 32, 0.75); /* Slightly darker for contrast */
    z-index: 1;
}
#interior-hero .container {
    position: relative;
    z-index: 2;
    height: 100%; /* Ensure container fills the hero height for vertical centering */
}

/* Mobile Tweak: Add padding when stacked */
@media (max-width: 991.98px) {
    #interior-hero {
        height: auto;
        padding: 50px 0; /* Add top/bottom padding for mobile stacking */
    }
}

/* --- MOBILE HAMBURGER (Fixed) --- */
.mobile-toggler-fixed {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 1500;
    background-color: rgba(35, 31, 32, 0.9); 
    border: 2px solid var(--xp-yellow);
    padding: 5px 10px;
    border-radius: 6px;
    color: var(--xp-white);
}
.mobile-toggler-fixed .navbar-toggler-icon {
    width: 1.5rem; height: 1.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: center; background-size: 1.5rem 1.5rem;
}

/* --- MOBILE ADJUSTMENTS --- */
@media (max-width: 991.98px) {
    #header-hero { height: 220px; }
    .hero-content {
        justify-content: flex-end; align-items: center; text-align: center; padding: 72px 16px 16px; 
    }
    .hero-logo-overlay {
        top: 26%; left: 50%; transform: translate(-50%, -50%);
    }
    .hero-logo-overlay img { max-height: 90px !important; }
    .hero-bottom-text {
        display: block !important; order: 1; font-size: 1.2rem; letter-spacing: 0.09em; margin-top: 8px;
    }
    .hero-top-text {
        order: 2; font-size: 0.9rem; letter-spacing: 0.08em; margin-top: 4px;
    }
    /* Hide logo on interior mobile header if needed, or adjust */
    #interior-hero .hero-logo-overlay img { max-height: 60px; }
}

/* --- DESKTOP NAVIGATION BAND --- */
/* =========================================
   5. NAVIGATION (DRESSED UP)
   ========================================= */
.desktop-nav-band {
    background-color: var(--xp-black);
    /* Add a subtle bottom border for definition */
    border-bottom: 1px solid rgba(255,255,255,0.1); 
}

.navbar-dark .nav-link { 
    color: var(--xp-white); 
    font-weight: 600; 
    
    /* NEW: Typography styling */
    text-transform: uppercase;
    font-size: 0.85rem;      /* Smaller but uppercase looks clean */
    letter-spacing: 0.08em;  /* Spacing between letters */
    
    padding-top: 1.5rem !important;    /* More vertical breathing room */
    padding-bottom: 1.5rem !important;
    padding-left: 1rem !important;     /* More horizontal spacing */
    padding-right: 1rem !important;
    
    position: relative; /* Needed for the underline animation */
    transition: color 0.3s ease; 
}

/* Hover Color */
.navbar-dark .nav-link:hover,
.navbar-dark .nav-link.active { 
    color: var(--xp-yellow); 
}

/* NEW: Animated Underline Effect */
.navbar-dark .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px; /* Thickness of the yellow line */
    bottom: 15px; /* Adjust based on padding-bottom */
    left: 50%;
    background-color: var(--xp-yellow);
    transition: all 0.3s ease-in-out;
    transform: translateX(-50%); /* Centers the line growth */
}

/* Expand line on hover */
.navbar-dark .nav-link:hover::after,
.navbar-dark .nav-link.active::after {
    width: 80%; /* Grow to 80% of the text width */
}

/* Remove underline from the "Pay" button if it inherits it */
.nav-item .btn {
    position: relative;
    z-index: 10;
}

/* Refined Dropdown Styling */
.dropdown-menu {
    border-radius: 0; /* Sharp corners match the print aesthetic */
    border: none;
    border-top: 3px solid var(--xp-yellow); /* Yellow accent on top */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-top: -1px; /* Overlap the border slightly */
}

.dropdown-item {
    font-size: 0.9rem;
    padding: 8px 20px;
    font-weight: 500;
}
.dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--xp-black);
    border-left: 3px solid var(--xp-yellow); /* Little yellow tab on hover */
}
.navbar-dark .nav-link:hover { color: var(--xp-yellow); }

/* --- Mega Menu Styles --- */
.nav-item.dropdown.mega-parent { position: static; }
.navbar .mega-menu {
    position: absolute; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 1100px; margin-top: 0; padding: 20px 0;
    border-radius: 0; box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    top: 100%; z-index: 1020; overflow: hidden; 
}
.mega-menu .dropdown-header {
    display: block; background-color: var(--xp-black); color: var(--xp-white);
    font-weight: 700; margin-bottom: 0.5rem; padding: 0.35rem 0.75rem;
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.09em;
    border-radius: 0.25rem; text-align: left;
}
.mega-menu .list-unstyled a { 
    color: var(--xp-black); padding: 3px 0; display: block; font-size: 0.95rem; transition: color 0.2s; 
}
.mega-menu .list-unstyled a:hover { color: var(--xp-yellow); text-decoration: underline; }
@media (max-width: 991.98px) { .navbar .mega-menu { display: none; } }

/* --- Product Card Styling --- */
.product-card-dark {
    background-color: var(--xp-black); color: var(--xp-white); height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1); transition: transform 0.2s, box-shadow 0.2s;
}
.product-card-dark:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); }
.product-card-dark .card-title { 
    color: var(--xp-yellow) !important; font-weight: 800; font-size: 1.1rem; letter-spacing: 0.05em; 
}
.product-card-dark .card-text { color: rgba(255, 255, 255, 0.8) !important; min-height: 90px; }
.product-card-dark .btn-warning { 
    background-color: var(--xp-yellow) !important; color: var(--xp-black) !important; font-weight: bold; 
}

/* --- Card Section Background --- */
.card-section-bg { position: relative; overflow: hidden; background-color: #f8f9fa; }
.card-section-bg::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background: radial-gradient(circle at 0% 0%, rgba(255, 213, 32, 0.32), transparent 55%),
                radial-gradient(circle at 100% 100%, rgba(35, 31, 32, 0.22), transparent 55%),
                radial-gradient(circle, rgba(0, 0, 0, 0.10) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 16px 16px;
    background-position: 0 0, 100% 100%, 0 0; opacity: 0.8;
}
.card-section-bg .container { position: relative; z-index: 10; }

/* --- SIDEBAR NAV (For Interior Pages) --- */
.sidebar-nav { position: sticky; top: 20px; }
.sidebar-nav .list-group-item {
    border: none; border-left: 3px solid #eee; color: var(--xp-black); font-weight: 500;
}
.sidebar-nav .list-group-item.active {
    background-color: transparent; color: var(--xp-black); border-left-color: var(--xp-yellow); font-weight: 700;
}
.sidebar-nav .list-group-item:hover { background-color: #f8f9fa; color: #000; }

/* =========================================
   8. MOBILE NAVIGATION (DRESSED UP)
   ========================================= */

/* Dark Background & Text */
.offcanvas {
    background-color: var(--xp-black);
    color: var(--xp-white);
}

/* Header Styling */
.offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 24px;
}
.offcanvas-title {
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--xp-yellow);
}

/* Main Links Styling */
#mobileNavAccordion .nav-link {
    color: var(--xp-white);
    font-size: 1.1rem;         /* Larger touch targets */
    font-weight: 700;
    text-transform: uppercase; /* Match desktop */
    letter-spacing: 0.05em;
    padding: 18px 24px;        /* Generous spacing */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Subtle dividers */
    transition: color 0.2s, background-color 0.2s;
}

/* Hover/Active States */
#mobileNavAccordion .nav-link:hover,
#mobileNavAccordion .nav-link:focus {
    color: var(--xp-yellow);
    background-color: rgba(255,255,255,0.02);
}

/* Accordion Chevron Rotation */
.nav-link-chevron {
    transition: transform 0.3s ease;
}
.nav-link-toggle[aria-expanded="true"] {
    color: var(--xp-yellow); /* Turn text yellow when open */
}
.nav-link-toggle[aria-expanded="true"] .nav-link-chevron {
    transform: rotate(180deg);
}

/* Sub-menu (Collapse) Styling */
.collapse-menu {
    background-color: rgba(0, 0, 0, 0.3); /* Darker background for nested items */
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.4); /* Inner shadow for depth */
}

.collapse-menu a {
    color: rgba(255, 255, 255, 0.7); /* Slightly muted text */
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent; /* Prepare for hover accent */
    transition: all 0.2s;
}

.collapse-menu a:hover {
    color: var(--xp-white);
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: var(--xp-yellow); /* Yellow tab on left */
    padding-left: 28px !important; /* Slight nudge movement on hover */
}
/* =========================================
   9. CMS CONTENT STYLING (Responsive Fixes)
   ========================================= */

/* Force images inside the CMS content area to be responsive */
.cms-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;       /* Prevents tiny gaps below images */
    margin: 20px 0;       /* Adds breathing room */
    border-radius: 4px;   /* Optional: adds slight polish */
}

/* Optional: Improve readability of long CMS text blocks */
.cms-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.cms-content ul, 
.cms-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

/* =========================================
   MOBILE MENU FIX (Hide Hamburger on Open)
   ========================================= */

/* When the menu opens, Bootstrap adds aria-expanded="true" to the button.
   We use this to hide the hamburger so it doesn't overlap the 'X'.
*/
.mobile-toggler-fixed[aria-expanded="true"] {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important; /* Prevents clicking the invisible button */
    transition: opacity 0.2s ease;
}

/* =========================================
   MOBILE MENU Z-INDEX FIX
   ========================================= */

/* Force the Offcanvas Menu to sit ON TOP of the fixed hamburger button */
.offcanvas {
    z-index: 10000 !important; 
}

/* Ensure the dark backdrop is also high, but just below the menu */
.offcanvas-backdrop {
    z-index: 9999 !important;
}

/* =========================================
   LEGACY CONTENT FIXES (CMSB WYSIWYG)
   ========================================= */

/* 1. Fix Images: BS5 uses .img-fluid, old site used .img-responsive */
.legacy-content .img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 2. Modernize the Grid */
/* Ensure the old 'row' doesn't cause horizontal scrolling */
.legacy-content .row {
    margin-right: -15px; /* BS3 standard */
    margin-left: -15px;
    display: flex;       /* Turn on Flexbox for BS5 behavior */
    flex-wrap: wrap;     /* Allow wrapping */
}

/* 3. Fix Columns */
/* Make old BS3 columns behave like BS5 columns */
.legacy-content [class*="col-"] {
    padding-right: 15px;
    padding-left: 15px;
    box-sizing: border-box;
}

/* On mobile, force old columns to stack 100% width */
@media (max-width: 768px) {
    .legacy-content .col-md-6 {
        width: 100% !important;
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Center images on mobile if they aren't already */
    .legacy-content img {
        margin: 0 auto 20px auto;
    }
}

/* =========================================
   PAYABLY INVOICE PLUGIN STYLING
   ========================================= */

/* Target the specific ID provided in the HTML */
#payably-btn-lookup {
    background-color: var(--xp-yellow) !important; /* Override 'btn-success' green */
    border-color: var(--xp-yellow) !important;
    color: var(--xp-black, #000) !important;       /* Black text */
    
    /* Branding Styles */
    font-weight: 700 !important;
    text-transform: uppercase !important;
    border-radius: 0.25rem !important;
    box-shadow: none !important;
}

/* Hover State */
#payably-btn-lookup:hover,
#payably-btn-lookup:focus {
    background-color: #ffca2c !important; /* Darker yellow hover */
    border-color: #ffc720 !important;
    color: #000 !important;
    transform: translateY(-1px);
}