/* ==========================================================================
   MODISON COPPER - OFFICIAL RED & WHITE CORPORATE MASTER DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,800;1,900&display=swap');

:root {
    --copper-primary: #DC2626;
    --copper-hover: #B91C1C;
    --copper-light: #EF4444;
    --copper-dark: #991B1B;
    --copper-gradient: linear-gradient(135deg, #EF4444 0%, #DC2626 50%, #991B1B 100%);
    --copper-glow: rgba(220, 38, 38, 0.25);
    
    --bg-dark: #FFFFFF;
    --bg-card-dark: #F8FAFC;
    --bg-card-hover: #FFFFFF;
    --bg-light: #FFFFFF;
    --bg-subtle: #F1F5F9;
    
    --text-main: #0F172A;
    --text-muted: #475569;
    --text-dark: #0F172A;
    --text-dark-muted: #64748B;
    
    --border-color: #E2E8F0;
    --border-copper: rgba(220, 38, 38, 0.3);
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-card: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
    --shadow-copper: 0 10px 25px -5px rgba(220, 38, 38, 0.3);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: #FFFFFF;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #0F172A;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Ambient 3D Canvas Background */
#canvas-3d-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Section */
.section {
    padding: 5rem 0;
    position: relative;
}

.section-header {
    text-align: center;
    max-width: 750px;
    margin: 0 auto 3.5rem auto;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid var(--border-copper);
    border-radius: var(--radius-full);
    color: var(--copper-primary);
    font-size: 0.825rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 1rem;
}

.section-description {
    font-size: 1.05rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--copper-primary);
    color: #FFFFFF;
    box-shadow: var(--shadow-copper);
}

.btn-primary:hover {
    background: var(--copper-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(220, 38, 38, 0.4);
}

.btn-secondary {
    background: #F1F5F9;
    color: #0F172A;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #E2E8F0;
    color: var(--copper-primary);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--copper-primary);
    color: var(--copper-primary);
}

.btn-outline:hover {
    background: var(--copper-primary);
    color: #FFFFFF;
}

/* NAVBAR */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #FFFFFF;
    border-top: 6px solid #DC2626 !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: var(--transition-smooth);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-brand img {
    height: 48px;
    max-width: 220px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    list-style: none;
}

.nav-link {
    font-size: 0.925rem;
    font-weight: 600;
    color: #334155;
    padding: 0.5rem 0.25rem;
    transition: var(--transition-fast);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--copper-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--copper-primary);
    border-radius: var(--radius-full);
}

/* MEGA DROPDOWN MENU */
.nav-item-dropdown {
    position: relative;
}

.nav-item-dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: -20px;
    width: 340px;
    background: #FFFFFF;
    border-top: 3px solid #DC2626;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-smooth);
    z-index: 1010;
}

.mega-menu-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mega-menu-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.mega-menu-link:hover {
    background: #FEF2F2;
    color: #DC2626;
    padding-left: 1.1rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    cursor: pointer;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: #0F172A;
}

/* HERO SECTION */
.hero {
    padding: 4rem 0 5rem 0;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3.5rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: #FEF2F2;
    border: 1px solid var(--border-copper);
    border-radius: var(--radius-full);
    color: var(--copper-primary);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.1;
    color: #0F172A;
    margin-bottom: 1.25rem;
}

.hero-title span {
    color: var(--copper-primary);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.stat-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--copper-primary);
}

.stat-lbl {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-dark-muted);
}

/* PRODUCTS GRID & CARDS */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.12);
    border-color: var(--border-copper);
}

.product-thumb {
    position: relative;
    height: 200px;
    background: #F1F5F9;
    overflow: hidden;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.product-card:hover .product-thumb img {
    transform: scale(1.06);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--copper-primary);
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.product-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-content .product-footer {
    margin-top: auto !important;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 0.5rem;
}

.product-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* 3D WEBGL STUDIO INSPECTOR */
.studio-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.studio-sidebar {
    background: #F8FAFC;
    padding: 1.75rem;
    border-right: 1px solid var(--border-color);
}

.studio-part-btn {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    transition: var(--transition-fast);
}

.studio-part-btn:hover, .studio-part-btn.active {
    background: var(--copper-primary);
    color: #FFFFFF;
    border-color: var(--copper-primary);
}

#studio-3d-canvas-container {
    height: 520px;
    position: relative;
    background: #0d1322;
}

/* CALCULATOR */
.calc-wrapper {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 0.5rem;
}

.form-input, select.form-input {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #0F172A;
    transition: var(--transition-fast);
}

.form-input:focus {
    border-color: var(--copper-primary);
    background: #FFFFFF;
}

.dimension-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.calc-result-box {
    background: #F8FAFC;
    border: 2px solid var(--copper-primary);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
}

.calc-result-val {
    font-size: 3rem;
    font-weight: 800;
    color: var(--copper-primary);
}

/* FOOTER */
footer {
    background: #1E1E1E;
    color: #94A3B8;
    padding-top: 3.5rem;
    font-size: 0.88rem;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .hero-grid, .calc-grid, .studio-grid {
        grid-template-columns: 1fr;
    }
    .nav-links {
        display: none;
    }
    .menu-toggle {
        display: flex;
    }
}


/* SINGLE HORIZONTAL LINE NAVBAR WITH ZERO TEXT WRAPPING */
.navbar-container {
    max-width: 1380px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 76px !important;
    padding: 0 1.5rem !important;
}

.logo-brand img {
    height: 44px !important;
    max-width: 200px !important;
    width: auto !important;
    object-fit: contain !important;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: nowrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    font-size: 0.86rem !important;
    font-weight: 600 !important;
    color: #334155 !important;
    white-space: nowrap !important;
    padding: 0.4rem 0.2rem !important;
    display: inline-block !important;
}


/* 2-COLUMN MEGA DROPDOWN MENU MATCHING OFFICIAL MODISON DESIGN */
.mega-menu {
    width: 480px !important;
    left: -40px !important;
    padding: 1.25rem 1.5rem !important;
    background: #FFFFFF !important;
    border-top: 3px solid #DC2626 !important;
    border-radius: 0 0 8px 8px !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15) !important;
}

.mega-menu-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem 1.25rem !important;
}

.mega-menu-link {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #334155 !important;
    padding: 0.5rem 0.6rem !important;
    border-radius: 4px !important;
    transition: var(--transition-fast) !important;
    white-space: nowrap !important;
}

.mega-menu-link:hover {
    background: #FEF2F2 !important;
    color: #DC2626 !important;
    padding-left: 0.8rem !important;
}


/* ESTEEMED CLIENTS 4-COLUMN CARD GRID */
.clients-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
}

@media (max-width: 992px) {
    .clients-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 576px) {
    .clients-grid {
        grid-template-columns: 1fr !important;
    }
}


/* CLEAN CENTERED RFQ MODAL CONTAINERS (ZERO WIREFRAME BACKDROPS) */
.modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.82) !important;
    backdrop-filter: blur(8px) !important;
    z-index: 2000 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.5rem !important;
}

.modal-backdrop.active {
    display: flex !important;
}

.modal-card {
    background: #FFFFFF !important;
    border-radius: 12px !important;
    max-width: 560px !important;
    width: 100% !important;
    padding: 2.25rem !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #E2E8F0 !important;
    position: relative !important;
    color: #0F172A !important;
}

.modal-close {
    position: absolute !important;
    top: 16px !important;
    right: 18px !important;
    background: #F1F5F9 !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    font-size: 1.2rem !important;
    color: #64748B !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: var(--transition-fast) !important;
}

.modal-close:hover {
    background: #DC2626 !important;
    color: #FFFFFF !important;
}


/* COMPREHENSIVE MOBILE FIXES */
@media (max-width: 992px) {
    .responsive-hero-grid, .hero-stats-grid, .calc-grid, .studio-grid,
    .responsive-2col-grid, .responsive-4col-grid, .responsive-form-grid {
        grid-template-columns: 1fr !important;
    }
    .hero-h1 {
        font-size: 2.2rem !important;
    }
    .nav-links {
        display: none;
    }
    .menu-toggle {
        display: flex !important;
    }
    .canvas-container, #canvas-3d-bg {
        position: absolute !important;
        z-index: -1 !important;
    }
    .hide-on-mobile {
        display: none !important;
    }

    /* PREVENT HERO TEXT OVERFLOW */
    h1, h2, h3 {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* FIX CAREERS / ALLOY HERO GRID */
    div[style*="grid-template-columns: 1fr 420px"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="grid-template-columns: 1fr 400px"] {
        grid-template-columns: 1fr !important;
    }

    /* HERO SECTION OVERFLOW */
    div[style*="background: linear-gradient"] {
        overflow: hidden;
    }

    /* MOBILE MEGA MENU ACCORDION */
    .mega-menu {
        position: static !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        border-top: none !important;
        border-left: 2px solid #DC2626 !important;
        border-radius: 0 !important;
        padding: 0.5rem 1rem !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        display: none;
        margin-top: 0.5rem;
        background: transparent !important;
    }
    .mega-menu-grid {
        grid-template-columns: 1fr !important;
        gap: 0.2rem !important;
    }

    /* TABLE OVERFLOW — WRAP IN SCROLLABLE BLOCK */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Allow table cells to wrap on small alloy detail tables */
    table td, table th {
        white-space: normal;
        min-width: 80px;
    }

    h2 {
        font-size: 1.7rem !important;
        word-wrap: break-word;
    }
    div[style*="padding: 2.5rem"], div[style*="padding: 2rem"] {
        padding: 1rem !important;
    }
    div[style*="display: flex; gap: 1rem;"] {
        flex-wrap: wrap !important;
    }
    div[style*="display: flex; gap: 1rem;"] > button {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }

    /* CATCH-ALL FOR INLINE GRIDS */
    div[style*="grid-template-columns: repeat(2, 1fr)"],
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1.1fr"],
    div[style*="grid-template-columns: 1.1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1.2fr"],
    div[style*="grid-template-columns: 1.2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* CAREERS JOB CARDS GRID */
    div[style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
    }
}

html, body { max-width: 100vw; overflow-x: hidden; }

@media (max-width: 480px) {
    .nav-actions .btn-primary { padding: 0.5rem; font-size: 0.8rem; }
    .logo-brand img { max-width: 140px !important; }
    h1[style] { font-size: 1.9rem !important; }
    h2[style] { font-size: 1.4rem !important; }
    .container { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* ==========================================
   BEAUTIFICATION UPGRADES
   ========================================== */
body {
    background: radial-gradient(circle at top right, rgba(220, 38, 38, 0.04) 0%, rgba(255, 255, 255, 0) 40%), linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%) !important;
    min-height: 100vh;
}

/* Glassmorphism Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 4px solid #DC2626 !important;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08) !important;
}

/* Enhanced Primary Buttons */
.btn-primary {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 50%, #B91C1C 100%) !important;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3) !important;
    border: none !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.45) !important;
    background: linear-gradient(135deg, #F87171 0%, #EF4444 50%, #DC2626 100%) !important;
}

/* Smooth Card Hover States */
.category-card, .alloy-card, .product-card, .value-card, .feature-card {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.category-card:hover, .alloy-card:hover, .product-card:hover, .value-card:hover, .feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.12) !important;
}

/* Apply to inline-styled cards via attribute selector */
div[style*="border-radius: 8px"][style*="box-shadow"] {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

div[style*="border-radius: 8px"][style*="box-shadow"]:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.12) !important;
}

/* Hero Section Depth */
.hero {
    background: transparent !important;
}

/* Make 3D Canvas feel more integrated */
#canvas-3d-bg {
    opacity: 0.85 !important;
    filter: contrast(1.1) brightness(1.05);
}

/* Softer Typography Headings */
h1, h2, h3 {
    letter-spacing: -0.03em !important;
}

/* Enhanced Footer Divider */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}
