/*
Theme Name: CalcPro
Theme URI: https://example.com/calcpro
Author: Antigravity
Author URI: https://example.com
Description: A high-performance, mobile-first WordPress theme dedicated to pro-level construction calculators. Features detailed cost breakdowns and visual charts.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: calcpro
Tags: calculator, construction, mobile-first, fast, optimized
*/

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #1e293b;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #16a34a;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --border-radius: 12px;
    --nav-height: 60px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--nav-height) + 20px); /* Space for bottom nav */
}

/* Header & Top Nav */
.site-header {
    background-color: var(--card-background);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 999;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

/* Main Content area */
.site-main {
    padding: var(--spacing-xl) 0;
    min-height: calc(100vh - 150px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--secondary-color);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

/* Basic Form Styles */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--secondary-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #f9fafb;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: #fff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
    width: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* Bottom Navigation (Mobile App Feel) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--card-background);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--nav-height);
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.2s;
    flex: 1;
    height: 100%;
}

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    stroke: currentColor;
    fill: none;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--primary-color);
}

/* Cards */
.card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: var(--spacing-lg);
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none; /* Hide on desktop */
    }
    body {
        padding-bottom: 0; /* Remove bottom padding on desktop */
    }
}

/* =========================================
   Navigation & Megamenu Styles
   ========================================= */

/* Desktop Navigation */
.desktop-nav {
    display: none;
}
@media (min-width: 992px) {
    .desktop-nav {
        display: block;
    }
    .mobile-menu-toggle {
        display: none;
    }
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu > li > a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    transition: color 0.3s;
}
.nav-menu > li > a:hover {
    color: var(--primary-color);
}

/* Megamenu */
.has-megamenu {
    position: static;
}

.megamenu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    padding: 2rem 0;
}

.has-megamenu:hover .megamenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.megamenu-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.megamenu-item {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}
.megamenu-item:hover {
    background: #eff6ff;
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Mobile Navigation */
.mobile-menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
}
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    background: var(--card-background);
    z-index: 99;
    overflow-y: auto;
    padding: 1rem var(--spacing-md);
}
.mobile-nav.active {
    display: block;
}
.mobile-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mobile-nav-menu > li {
    border-bottom: 1px solid var(--border-color);
}
.mobile-nav-menu > li > a {
    display: block;
    padding: 1rem 0;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}
.mobile-submenu {
    display: none;
    list-style: none;
    padding-left: 1rem;
    margin-bottom: 1rem;
}
.mobile-submenu.active {
    display: block;
}
.mobile-submenu li a {
    display: block;
    padding: 0.75rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
}

    }
}

/* =========================================
   Homepage & Shortcode Card Grids
   ========================================= */

/* The card links */
.glass-card-link, .calcpro-card {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* The cards themselves */
.glass-card, .calcpro-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    border-radius: var(--border-radius);
    padding: var(--spacing-xl);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.glass-card-link:hover .glass-card,
.calcpro-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.12);
    border-color: var(--primary-color);
}

/* Icon Wrappers */
.icon-wrapper, .calcpro-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    font-size: 1.5rem;
    font-weight: 700;
}

.icon-wrapper svg, .calcpro-icon svg {
    width: 32px;
    height: 32px;
}

.glass-card h3, .calcpro-card h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.glass-card p, .calcpro-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* =========================================
   Calculator Page Layout
   ========================================= */
.calculator-page-layout {
    max-width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
}
.calculator-page-main {
    width: 100%;
}
/* =========================================
   Top Scrolling Menu
   ========================================= */
.top-scroll-menu-wrapper {
    position: sticky;
    top: var(--nav-height, 70px);
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    margin: 0 -1rem 1rem -1rem;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.top-scroll-menu {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    align-items: center;
}
.top-scroll-menu::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}
.scroll-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    color: #0f172a;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.scroll-menu-item:hover, .scroll-menu-item.active {
    background: #ecfccb;
    border-color: #84cc16;
    color: #4d7c0f;
    box-shadow: 0 4px 6px -1px rgba(132, 204, 22, 0.2);
}
.scroll-icon {
    display: flex;
    align-items: center;
}
.scroll-icon svg {
    width: 18px;
    height: 18px;
}

/* =========================================
   Top Scrolling Menu
   ========================================= */
.top-scroll-menu-wrapper {
    position: sticky;
    top: calc(var(--nav-height, 70px) + 20px);
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    margin: 0 auto 1.5rem auto;
    max-width: 100%;
    border-radius: 12px;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.top-scroll-menu {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-items: center;
}
.top-scroll-menu::-webkit-scrollbar {
    display: none;
}
.scroll-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    color: #0f172a;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.scroll-menu-item:hover, .scroll-menu-item.active {
    background: #ecfccb;
    border-color: #84cc16;
    color: #4d7c0f;
    box-shadow: 0 4px 6px -1px rgba(132, 204, 22, 0.2);
}
.scroll-icon {
    display: flex;
    align-items: center;
}
.scroll-icon svg {
    width: 18px;
    height: 18px;
}



@media (min-width: 992px) {
    .top-scroll-menu-wrapper {
        display: none !important;
    }
}


/* PREMIUM MENU OVERHAUL */
.site-header {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 30px rgba(0,0,0,0.03) !important;
    transition: all 0.3s ease;
}

.site-title {
    font-size: 1.6rem !important;
    background: linear-gradient(135deg, var(--primary-color), #7e22ce);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-menu > li > a {
    font-size: 1.05rem !important;
    padding: 0.6rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s ease !important;
}

.nav-menu > li > a:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-color) !important;
}

/* Hide desktop menu on mobile */
@media (max-width: 991px) {
    .desktop-nav {
        display: none !important;
    }
}

/* Premium Mobile Menu Drawer */
@media (max-width: 991px) {
    .mobile-nav {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 300px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        background: #ffffff !important;
        z-index: 1000 !important;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1) !important;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1) !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 80px 20px 20px !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
        left: auto !important;
    }

    .mobile-nav.active {
        right: 0 !important;
    }

    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-nav-menu {
        display: flex;
        flex-direction: column;
    }

    .mobile-nav-menu > li {
        border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    }

    .mobile-nav-menu > li > a {
        font-size: 1.25rem !important;
        padding: 1.2rem 0 !important;
        font-weight: 700 !important;
        color: var(--secondary-color) !important;
    }

    .mobile-nav-menu > li > a:hover {
        color: var(--primary-color) !important;
        padding-left: 10px !important;
        transition: all 0.2s ease;
    }

    .mobile-submenu-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mobile-menu-toggle {
        z-index: 1001 !important;
        position: relative !important;
        background: transparent !important;
        border: none !important;
        color: var(--secondary-color) !important;
        padding: 0.5rem !important;
        display: block !important;
    }

    .mobile-menu-toggle.active svg line:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
        transform-origin: center;
    }
    .mobile-menu-toggle.active svg line:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active svg line:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
        transform-origin: center;
    }

    .mobile-menu-toggle svg line {
        transition: all 0.3s ease;
    }
}

/* Ensure mobile nav is hidden on desktop */
@media (min-width: 992px) {
    .mobile-nav {
        display: none !important;
    }
    .mobile-menu-toggle {
        display: none !important;
    }
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* MAXIMIZE MOBILE SPACE */
@media (max-width: 767px) {
    .container {
        padding: 0 8px !important; /* Extremely tight left/right padding */
    }
    .stage-card {
        padding: 12px 8px !important; /* Less inner padding on calculator cards */
        margin-bottom: 12px !important;
        border-radius: 8px !important;
    }
    .form-group input, .form-group select {
        padding: 0.6rem !important; /* Slightly tighter inputs to save vertical space */
        font-size: 1.1rem !important; /* Larger text inside inputs for better visibility */
    }
    .result-value {
        font-size: 1.1rem !important;
        font-weight: 700;
    }
    .boq-table th, .boq-table td {
        padding: 0.4rem 0.2rem !important;
        font-size: 0.9rem !important;
    }
    body {
        font-size: 16px !important; /* Slightly larger base font for visibility */
    }
}






/* =========================================
   Mobile Bottom Menu Button (Premium)
   ========================================= */
@media (max-width: 991px) {
    .bottom-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 1rem;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
        border-top: 1px solid rgba(0,0,0,0.05);
    }
    
    .bottom-nav-item.mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.75rem !important;
        background: linear-gradient(135deg, var(--primary-color), #7e22ce) !important;
        color: white !important;
        padding: 0.75rem 2rem !important;
        border-radius: 50px !important;
        font-weight: 600 !important;
        font-size: 1.1rem !important;
        box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
        margin: 0.5rem 0;
        transition: transform 0.2s;
    }
    
    .bottom-nav-item.mobile-menu-toggle svg {
        stroke: white !important;
    }
    
    .bottom-nav-item.mobile-menu-toggle:active {
        transform: scale(0.96);
    }
}




/* =========================================
   Dashboard Style Integrated Sidebar
   ========================================= */
.desktop-sidebar { display: none; }
@media (min-width: 992px) {
    .calculator-page-layout {
        display: grid;
        grid-template-columns: 1fr 260px;
        gap: 2rem;
        align-items: start;
        max-width: 1400px;
        margin: 2rem auto;
        padding: 0 2rem;
    }
    
    .desktop-sidebar {
        display: block !important;
        position: sticky;
        top: 100px; /* Keep it in view when scrolling */
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.5);
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        border-radius: var(--border-radius);
        width: 100% !important; /* Override old fixed width */
        height: auto !important; /* Override old fixed height */
    }
}


/* =========================================
   Mobile Optimization (95% Width & Bottom Nav)
   ========================================= */
@media (max-width: 768px) {
    /* 95% Width Rule */
    .calculator-page-layout {
        width: 95% !important;
        max-width: 95% !important;
        margin: 1rem auto !important;
        padding: 0 !important;
    }
    
    .calc-grid {
        gap: 1rem;
    }
    
    .calc-input-section, .calc-results-section {
        padding: 1rem !important; /* Reduce padding to maximize space for content */
    }

    /* Professional Mobile Bottom Tabs */
    .bottom-nav {
        display: flex !important;
        justify-content: space-around !important;
        align-items: stretch !important;
        padding: 0 !important;
        height: 65px;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05) !important;
    }
    
    .bottom-nav-item {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        flex: 1 1 0 !important; /* Force equal width */
        gap: 4px !important;
        padding: 0 !important;
        color: var(--text-secondary) !important;
        text-decoration: none !important;
        background: transparent !important;
        border-radius: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }
    
    .bottom-nav-item svg {
        width: 22px !important;
        height: 22px !important;
        stroke: currentColor !important;
    }
    
    .bottom-nav-item span {
        font-size: 0.65rem !important;
        font-weight: 500 !important;
        white-space: nowrap !important;
    }
    
    .bottom-nav-item:active, .bottom-nav-item.active {
        color: var(--primary-color) !important;
        transform: none !important;
    }
    
    .bottom-nav-item.active svg {
        stroke: var(--primary-color) !important;
    }
}



/* =========================================
   Premium Desktop Sidebar Styling
   ========================================= */
@media (min-width: 992px) {
    .desktop-sidebar-inner {
        padding: 1.5rem;
    }

    .sidebar-title {
        font-size: 1.1rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid rgba(var(--primary-color-rgb), 0.1);
        color: var(--text-main);
        position: relative;
    }

    .sidebar-title::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: -2px;
        height: 2px;
        width: 40px;
        background: var(--primary-color);
        border-radius: 2px;
    }

    .sidebar-menu {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .sidebar-menu li {
        margin: 0;
        padding: 0;
    }

    .sidebar-menu li a {
        display: flex;
        align-items: center;
        padding: 0.8rem 1rem;
        color: var(--text-secondary);
        text-decoration: none;
        font-weight: 500;
        font-size: 0.95rem;
        border-radius: 8px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
        background: transparent;
        border: 1px solid transparent;
    }

    /* Subtle left border marker for links */
    .sidebar-menu li a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%) scaleY(0);
        width: 3px;
        height: 60%;
        background: var(--primary-color);
        border-radius: 0 4px 4px 0;
        transition: transform 0.3s ease;
    }

    .sidebar-menu li a:hover,
    .sidebar-menu li a.active {
        color: var(--primary-color);
        background: rgba(139, 92, 246, 0.05); /* very light primary tint */
        border: 1px solid rgba(139, 92, 246, 0.1);
        transform: translateX(4px);
        box-shadow: 0 2px 8px rgba(139, 92, 246, 0.05);
    }

    .sidebar-menu li a:hover::before,
    .sidebar-menu li a.active::before {
        transform: translateY(-50%) scaleY(1);
    }
}


/* =========================================
   Responsive Mobile Table (Stacked Cards)
   ========================================= */
@media (max-width: 768px) {
    .boq-table thead {
        display: none;
    }
    .boq-table, .boq-table tbody, .boq-table tr, .boq-table td {
        display: block;
        width: 100%;
    }
    .boq-table tr {
        margin-bottom: 1.5rem;
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 12px;
        padding: 0.5rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    }
    .boq-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        text-align: right;
    }
    .boq-table td:last-child {
        border-bottom: none;
    }
    .boq-table td.hide-mobile {
        display: none !important;
    }
    .boq-table td::before {
        content: attr(data-cat) " - " attr(data-label);
        font-weight: 600;
        color: var(--text-main);
        text-align: left;
        margin-right: 15px;
    }
}

/* =========================================
   Site Footer Styling
   ========================================= */
.site-footer {
    background: #1e293b;
    color: #cbd5e1;
    padding: 4rem 2rem 1rem 2rem;
    margin-top: 4rem;
    font-family: 'Inter', sans-serif;
}

.site-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-col p {
    line-height: 1.6;
    color: #94a3b8;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-col ul li a:hover {
    color: #8b5cf6; /* Brand purple */
}

.site-footer-bottom {
    text-align: center;
    border-top: 1px solid #334155;
    padding-top: 1.5rem;
    color: #64748b;
    font-size: 0.9rem;
}

/* Hide desktop footer on mobile to avoid clashing with bottom nav */
@media (max-width: 768px) {
    .site-footer {
        padding-bottom: 80px; /* Space for the fixed bottom nav */
    }
}


/* Vertical Layout for Calculators in Footer */
.footer-col-calculators ul {
    display: block !important;
}

.footer-col-calculators ul li {
    margin-bottom: 0.75rem !important;
}

.footer-col-calculators ul li a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-col-calculators ul li a:hover {
    color: #8b5cf6 !important;
    padding-left: 5px;
}


/* Footer 2-Row Layout Styling */
@media (min-width: 992px) {
    .footer-row-1 {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    .footer-row-2 {
        grid-template-columns: 1fr 1fr !important;
    }
}



/* =========================================
   Print & PDF Download Styles
   ========================================= */
@media print {
    body {
        background: #fff;
        color: #000;
        margin: 0;
        padding: 0;
    }
    
    /* Hide Everything Unnecessary */
    .site-header, 
    .site-footer, 
    .desktop-sidebar, 
    .bottom-nav, 
    .calc-input-section, 
    .calc-tips-section, 
    .entry-content,
    .results-header-actions button,
    .hero-section,
    .mission-section {
        display: none !important;
    }

    /* Expand the layout for print */
    .calculator-page-layout {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }

    .calc-results-section {
        display: block !important;
        width: 100% !important;
    }

    /* Print styling for BOQ table */
    .boq-table {
        width: 100%;
        border-collapse: collapse;
    }
    .boq-table th, .boq-table td {
        border: 1px solid #ccc;
        padding: 8px;
    }
    
    /* Reset mobile stacked cards to standard table for print */
    .boq-table thead {
        display: table-header-group !important;
    }
    .boq-table, .boq-table tbody, .boq-table tr, .boq-table td {
        display: table-cell !important;
        width: auto !important;
    }
    .boq-table tr {
        display: table-row !important;
        margin-bottom: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }
    .boq-table td::before {
        display: none !important;
    }
    .boq-table td.hide-mobile {
        display: table-cell !important;
    }
    
    .stage-card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd;
        margin-bottom: 2rem;
    }
}


/* =========================================
   Branding and Terms & Conditions
   ========================================= */

.print-brand-header {
    display: none; /* Hidden on screen by default */
}

.result-terms-conditions {
    display: none; /* Hidden on screen by default */
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.6;
}

.result-terms-conditions h4 {
    color: #334155;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

@media print {
    .print-brand-header {
        display: block;
        text-align: center;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid #8b5cf6;
    }
    .print-brand-header .brand-name {
        font-size: 2rem;
        font-weight: 800;
        color: #1e293b;
    }
    .print-brand-header .brand-tagline {
        font-size: 1rem;
        color: #64748b;
        margin-top: 0.25rem;
    }
    .print-brand-header .brand-meta {
        font-size: 0.85rem;
        color: #94a3b8;
        margin-top: 1rem;
    }
    
    .result-terms-conditions {
        display: block;
        margin-top: 3rem;
        page-break-inside: avoid;
        border: none;
        border-top: 1px solid #e2e8f0;
        border-radius: 0;
        padding: 1.5rem 0 0 0;
        background: transparent;
    }
}

