:root {
    --primary-dark: #1e293b;
    --accent-orange: #ea580c;
    --accent-blue: #2563eb;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
}

header {
    background-color: #3b3b3b;
    color: #ffffff;
    padding: 2rem 5%;
    border-bottom: 4px solid rgb(32, 145, 243);
}

header .header-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    max-width: 1400px;
    margin: 0 auto;
}

header .header-logo {
    height: 55px;
    width: auto;
    object-fit: contain;
}

header .header-titles {
    display: flex;
    flex-direction: column;
    padding-left: 8px;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

header p {
    color: var(--border-color);
    font-size: 1.05rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    header .header-logo {
        height: 45px;
    }
    header h1 {
        font-size: 1.6rem;
    }
    header p {
        font-size: 0.95rem;
    }
}

.layout-container {
    display: flex;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2%;
    gap: 2rem;
}

nav.sidebar-nav {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

nav.sidebar-nav h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 0.5rem;
}

nav.sidebar-nav ul.main-nav {
    list-style: none;
}

nav.sidebar-nav ul.main-nav > li {
    margin-bottom: 1rem;
}

nav.sidebar-nav ul.main-nav > li > a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    display: block;
    padding: 0.25rem 0;
}

nav.sidebar-nav ul.main-nav > li > a:hover, 
nav.sidebar-nav ul.main-nav > li > a.active {
    color: var(--accent-orange);
}

/* New Sub-heading Styles */
nav.sidebar-nav ul.sub-nav {
    list-style: none;
    margin-left: 1rem;
    margin-top: 0.25rem;
    border-left: 2px solid var(--border-color);
    padding-left: 0.75rem;
}

nav.sidebar-nav ul.sub-nav li {
    margin-bottom: 0.4rem;
}

nav.sidebar-nav ul.sub-nav li a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    opacity: 0.5;
    transition: color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

nav.sidebar-nav ul.sub-nav li a::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 6px;
    background-color: var(--accent-blue);
    border-radius: 50%;
    margin-right: 0;
    opacity: 0;
    transition: opacity 0.25s ease, width 0.25s ease, margin-right 0.25s ease;
}

nav.sidebar-nav ul.sub-nav li a:hover {
    color: var(--accent-blue);
    opacity: 1;
}

nav.sidebar-nav ul.sub-nav li a.active {
    color: var(--accent-blue);
    font-weight: 600;
    opacity: 1;
    transform: translateX(4px);
}

nav.sidebar-nav ul.sub-nav li a.active::before {
    opacity: 1;
    width: 6px;
    margin-right: 8px;
}

main.content-area {
    flex: 3;
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

section {
    margin-bottom: 3.5rem;
    scroll-margin-top: 2rem; /* Smooth alignment when clicking anchor links */
}

h2 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 0.5rem;
}

h3 {
    color: var(--primary-dark);
    font-size: 1.3rem;
    margin: 1.5rem 0 0.75rem 0;
}

p {
    margin-bottom: 1.2rem;
}

ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

sup {
    font-size: 0.75rem;
    color: var(--accent-blue);
    font-weight: bold;
    margin-left: 2px;
}

.image-placeholder {
    background: #f1f5f9;
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    padding: 2rem;
    margin: 1.5rem 0;
    text-align: center;
}

.image-placeholder .diagram-tag {
    font-weight: bold;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.5rem;
}

.image-placeholder p {
    font-style: italic;
    font-size: 0.95rem;
    color: var(--text-main);
    margin: 0;
}

.callout-box {
    background: #eff6ff;
    border-left: 4px solid var(--accent-blue);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 6px 6px 0;
}

.callout-box.alert {
    background: #fff7ed;
    border-left-color: var(--accent-orange);
}

.callout-box h4 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.cta-block {
    background: var(--primary-dark);
    color: #ffffff;
    padding: 2rem;
    border-radius: 6px;
    margin: 2.5rem 0;
}

.cta-block h3, .cta-block p {
    color: #ffffff;
    margin-top: 0;
}

.cta-button {
    display: inline-block;
    background: rgb(255, 175, 5);
    color: #1e293b;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    border-radius: 4px;
    margin-top: 1rem;
    transition: background 0.2s, color 0.2s;
}

.cta-button:hover {
    background: rgb(255, 188, 5);
    color: #1e293b;
}

.inline-form {
    background: #334155;
    padding: 1.5rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.inline-form input, .inline-form button {
    padding: 0.5rem;
    margin-right: 0.5rem;
    border-radius: 4px;
    border: none;
}

.inline-form button {
    background: rgb(255, 175, 5);
    color: #1e293b;
    font-weight: bold;
    cursor: pointer;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}

th {
    background-color: #f1f5f9;
    color: var(--primary-dark);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.image-container {
    margin: 2rem 0;
    text-align: center;
    background: var(--bg-white);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 0 auto 1rem auto;
}

.image-container .caption {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: block;
    padding: 0 1rem;
}

.tolerance-table-container {
    margin: 2rem 0;
    width: 100%;
}

.tolerance-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Open Sans', sans-serif;
    color: #ffffff;
    text-align: center;
    border: 1px solid #ffffff;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

.tolerance-table th, .tolerance-table td {
    padding: 0.75rem;
    border: 1px solid #ffffff;
    vertical-align: middle;
}

.tolerance-table .table-title {
    background-color: #4b85b2;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.9rem;
    text-align: center;
}

.tolerance-table .label-cell {
    background-color: #386e97;
    font-weight: 600;
    width: 16%;
    font-size: 0.9rem;
}

.tolerance-table .data-cell {
    font-size: 0.9rem;
    font-weight: 600;
}

.tolerance-table .metric {
    font-size: 0.78rem;
    font-weight: 400;
    opacity: 0.95;
    display: block;
    margin-top: 0.15rem;
}

.tolerance-table .col-dark {
    background-color: #1a4c70;
}

.tolerance-table .col-light {
    background-color: #3d7aab;
}

.table-caption {
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.finishing-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0 0.75rem 0;
    width: 100%;
}

.gallery-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin-bottom: 0.75rem;
}

.gallery-item .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    display: block;
}
.resin-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Open Sans', sans-serif;
    color: #0c233c;
    text-align: center;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

.resin-comparison-table th {
    background-color: #1e4c7a; /* Dark blue steel header */
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.9rem 0.5rem;
    border: 1px solid #ffffff;
    vertical-align: middle;
}

.resin-comparison-table td {
    padding: 0.8rem 0.5rem;
    border: 1px solid #ffffff;
    vertical-align: middle;
}

.resin-comparison-table .material-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0c233c;
}

.resin-comparison-table .rating-cell {
    font-size: 1.1rem;
    letter-spacing: 0.15rem;
    color: #0c233c;
    padding-left: 0.15rem; /* center the text with letter-spacing */
}

.resin-comparison-table .row-dark-blue {
    background-color: #a5c8e4;
}

.resin-comparison-table .row-light-blue {
    background-color: #cce0f0;
}

/* Sticky Promo Header */
.sticky-promo-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #1e293b; /* Premium dark slate */
    color: #ffffff;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    border-bottom: 2px solid rgb(255, 175, 5); /* Subtle gold accent border */
}

.sticky-promo-header.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.sticky-promo-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.6rem 2%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    text-align: center;
}

.sticky-promo-content .promo-text {
    font-weight: 600;
    font-size: 0.95rem;
}

/* HubSpot yellow button styling */
.fl-button {
    display: inline-block;
    background: rgb(255, 175, 5);
    color: #1e293b;
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    font-weight: 700;
    border-radius: 4px;
    font-size: 0.88rem;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fl-button:hover {
    background: rgb(255, 188, 5);
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.fl-button:active {
    transform: translateY(0);
}

.fl-button-text {
    display: inline-block;
}

@media (max-width: 600px) {
    .sticky-promo-content {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    .sticky-promo-content .promo-text {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    .fl-button {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
        width: 100%;
        max-width: 280px;
    }
}

/* Hide HubSpot Chat and slide-out feedback widgets */
#hubspot-messages-iframe-container,
.hs-messages-widget,
.hs-chat-widget,
#hs-feedback-widget,
.hs-feedback-widget {
    display: none !important;
}

@media (max-width: 968px) {
    .layout-container {
        flex-direction: column;
    }
    nav.sidebar-nav {
        max-width: 100%;
        position: static;
    }
    .tolerance-table-container {
        overflow-x: auto;
    }
}