/* BASE & VARIABLES */
:root {
    /* Color Palette */
    --bg-darker: #0a0b0e;
    --bg-dark: #12141a;
    --bg-slate: #1a1d24;
    --bg-slate-hover: #22262f;

    /* Accents */
    --copper: #dca516;
    /* Dark Yellow / Gold */
    --copper-glow: rgba(220, 165, 22, 0.4);
    --copper-hover: #eebb33;
    --steel: #9ca3af;
    --steel-light: #d1d5db;
    --steel-dark: #4b5563;

    /* Text */
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Structure */
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    text-align: left;
}

p,
li,
.service-content p,
.service-content li {
    text-align: left;
    line-height: 1.6;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for grid items */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-400 {
    transition-delay: 400ms;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

/* Offset anchor scrolling so the sticky header doesn't cover titles */
.section-header,
h2.section-title,
section {
    scroll-margin-top: 100px;
    /* Accounts for the 80px nav bar + some padding */
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

#services {
    display: none;
}

.bg-dark {
    background-color: var(--bg-dark);
}

.bg-slate {
    background-color: var(--bg-slate);
}

.text-copper {
    color: var(--copper);
}

.text-steel {
    color: var(--steel-light);
}

/* SPECIALTIES GRID */
.bg-darker {
    background-color: var(--bg-darker);
}

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.specialty-card {
    position: relative;
    height: 350px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.specialty-card:hover {
    transform: translateY(-10px);
    border-color: var(--copper);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.specialty-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 11, 14, 0.9) 0%, rgba(10, 11, 14, 0.2) 60%, rgba(10, 11, 14, 0.4) 100%);
    transition: var(--transition);
}

.specialty-card:hover .specialty-overlay {
    background: linear-gradient(to top, rgba(196, 118, 75, 0.6) 0%, rgba(10, 11, 14, 0.3) 100%);
}

.specialty-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.specialty-content h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.explore-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--copper);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.explore-btn::after {
    content: '→';
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.specialty-card:hover .explore-btn::after {
    transform: translateX(5px);
}

.specialty-card:hover .explore-btn {
    color: #fff;
}

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

@media (max-width: 600px) {
    .specialties-grid {
        grid-template-columns: 1fr;
    }
    
    .specialty-card {
        height: 300px;
    }
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    font-weight: 500;
    font-family: var(--font-heading);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--copper), #a67c00);
    color: #fff;
    box-shadow: 0 4px 15px var(--copper-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--copper-hover), #cca100);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--copper-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--steel-dark);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--steel-light);
    background: rgba(255, 255, 255, 0.05);
}

/* HEADER */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.5rem 0;
    transition: var(--transition);
    background: transparent;
    border-bottom: none;
}

.navbar.scrolled {
    background: rgba(10, 11, 14, 0.98);
    /* Almost solid to compensate for no blur */
    border-bottom: none;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    padding: 0.5rem 0;
}

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

.logo {
    display: flex;
    align-items: center;
    /* Pushed a bit right to align with the sidebar inner content */
    margin-left: calc(50% - 50vw + 2rem);
    position: relative;
}

.logo img {
    height: 175px;
    width: auto;
    object-fit: contain;
    margin-right: 1rem;
    margin-top: -45px;
    margin-bottom: -80px;
    position: relative;
    z-index: 1050;
    transition: var(--transition);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.navbar-nav a:not(.btn) {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.navbar-nav a:not(.btn):hover {
    color: var(--copper);
}

/* DROPDOWN */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-toggle::after {
    content: '▾';
    font-size: 0.8rem;
    transition: var(--transition);
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: -1rem;
    background: var(--bg-slate);
    min-width: 220px;
    border-radius: var(--radius-md);
    padding: 0.5rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

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

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-main);
    transition: var(--transition);
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background: rgba(196, 118, 75, 0.1);
    color: var(--copper);
    padding-left: 1.8rem;
}

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

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-main);
    transition: var(--transition);
}

/* HERO SECTION */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 14rem;
    /* Increased significantly to prevent overlap with the larger logo navbar */
    overflow: hidden;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./assets/hero.png') center/cover no-repeat;
    filter: brightness(0.5);
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(10, 11, 14, 0.9) 0%, rgba(10, 11, 14, 0.4) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: clamp(2rem, 3.2vw, 3.2rem);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: -1px;
    white-space: normal;
    word-break: break-word;
    opacity: 0;
    animation: fadeUp 1s cubic-bezier(0.25, 0.8, 0.25, 1) 0.2s forwards;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    opacity: 0;
    animation: fadeUp 1s cubic-bezier(0.25, 0.8, 0.25, 1) 0.4s forwards;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    opacity: 0;
    animation: fadeUp 1s cubic-bezier(0.25, 0.8, 0.25, 1) 0.6s forwards;
}

/* COMPONENT GRID */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

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

.grid {
    display: grid;
    gap: 2rem;
}

.services-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    justify-content: center;
}

@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.card {
    background: var(--bg-darker);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--copper);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(196, 118, 75, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--copper);
    display: inline-block;
    padding: 1rem;
    background: rgba(196, 118, 75, 0.1);
    border-radius: 50%;
}

.card-img {
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--copper);
    transition: var(--transition);
}

.laser-img {
    background-image: url('./assets/LASER ICON.png');
}

.print-img {
    background-image: url('./assets/3d_printing_service.png');
}

.scan-img {
    background-image: url('./assets/3d_scanning_service.png');
}

.draft-img {
    background-image: url('./assets/2d_drafting_service.png');
}

.model-img {
    background-image: url('./assets/3d_modeling_service.png');
}

.skill-img {
    background-image: url('./assets/training_program_service.png');
}

.card:hover .card-img {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--copper-glow);
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* TABLE REFINEMENTS */
table {
    white-space: normal;
}

table th:first-child,
table td:first-child {
    white-space: nowrap;
    padding-right: 2rem !important;
}

table th:last-child,
table td:last-child {
    padding-left: 2rem !important;
}

.materials-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.material-item {
    text-align: center;
}

.material-img {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background-color: var(--bg-slate);
    border: 2px solid var(--steel-dark);
    transition: var(--transition);
    background-size: cover;
    background-position: center;
}

/* Base style for material images using our materials asset placeholder */
.material-img {
    background-image: url('./assets/materials.png');
    background-size: cover;
    filter: grayscale(0.5);
}

.material-item:hover .material-img {
    border-color: var(--copper);
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--copper-glow);
    filter: grayscale(0);
}

.material-item h4 {
    margin-bottom: 0.5rem;
    color: var(--steel-light);
}

.material-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* GALLERY */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    grid-auto-rows: 250px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-darker);
    background-size: cover;
    background-position: center;
    min-height: 250px;
}

.gallery-item.item-1 {
    background-image: url('./assets/services.png');
}

.gallery-item.item-2 {
    background-image: url('./assets/materials.png');
}

.gallery-item.item-3 {
    background-image: url('./assets/hero.png');
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-overlay span {
    font-family: var(--font-heading);
    font-weight: 600;
    color: #fff;
    transform: translateY(20px);
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-overlay span {
    transform: translateY(0);
}

/* TECH INFO CARDS */
.tech-info-card {
    margin: 0 auto 4rem auto;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.service-heading-h3 {
    color: var(--copper);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.service-heading-h4 {
    color: var(--copper);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.service-desc-text {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 1.1rem;
}

.service-quote-block {
    color: var(--steel-light);
    font-style: italic;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 500;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(196, 118, 75, 0.05);
    border-left: 4px solid var(--copper);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 2.5rem;
    -webkit-overflow-scrolling: touch;
}

/* SERVICE FEATURE IMAGES */
.service-feature-image {
    width: 100%;
    margin-bottom: 2.5rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.service-feature-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16/9;
}

.service-feature-image::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    pointer-events: none;
}

/* SERVICE LAYOUT GRID */
.service-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    max-width: 1200px !important;
}

.service-layout-grid > * {
    min-width: 0; /* Prevents long overflowing tables from breaking out of the screen */
}

.service-image-col {
    position: sticky;
    top: 100px;
}

.service-layout-grid .service-feature-image {
    margin-bottom: 0;
}

@media (max-width: 992px) {
    .service-layout-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .service-image-col {
        grid-row: 1;
        /* Move image above text on mobile */
        position: static;
        /* Disable sticky on mobile */
    }
}

/* QUOTE / CONTACT */
.quote-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.quote-info p {
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.contact-item {
    margin-bottom: 2rem;
}

.contact-item strong {
    display: block;
    color: var(--steel-light);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.contact-item p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.quote-form-wrapper {
    background: var(--bg-slate);
    padding: 3rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--steel-light);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--steel-dark);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font-body);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--copper);
    box-shadow: 0 0 0 2px rgba(196, 118, 75, 0.2);
}

.upload-zone {
    border: 2px dashed var(--steel-dark);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    background: rgba(18, 20, 26, 0.5);
    transition: var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--copper);
    background: rgba(196, 118, 75, 0.05);
}

.upload-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.upload-text {
    display: block;
    font-weight: 500;
    color: var(--steel-light);
}

.upload-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-list-item {
    display: flex;
    justify-content: space-between;
    background: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    font-size: 0.85rem;
    border: 1px solid var(--steel-dark);
}

.file-remove {
    color: #ef4444;
    cursor: pointer;
}

/* MODAL / POPUP */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 11, 14, 0.9);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity var(--transition);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: var(--bg-slate);
    border: 1px solid var(--steel-dark);
    border-radius: var(--radius-lg);
    padding: 3rem;
    max-width: 800px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(20px);
    transition: transform var(--transition);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--steel-light);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--copper);
}

.modal-body-content h3 {
    color: var(--copper);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.modal-body-content p {
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.modal-body-content h4 {
    color: var(--steel-light);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.modal-body-content ul {
    list-style-type: none;
    padding: 0;
}

.modal-body-content li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.modal-body-content li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--copper);
}

/* FOOTER */
.footer {
    background: var(--bg-darker);
    padding: 4rem 0 2rem 260px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 1rem;
    font-size: 0.9rem;
    max-width: 300px;
}

.footer-links h4,
.footer-social h4 {
    color: var(--steel-light);
    margin-bottom: 1.5rem;
}

.footer-links a,
.footer-social a {
    display: block;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.footer-links a:hover,
.footer-social a:hover {
    color: var(--copper);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .logo {
        margin-left: 1.5rem; /* Better mobile compatibility, not touching extreme edge */
    }
    .logo img {
        height: 125px; /* Updated to requested 125px size */
        margin-top: -25px; /* Pushed absolutely to the top end */
        margin-bottom: -40px;
        transform: scale(1);
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* SERVICES TABS */
.services-tabs-container {
    width: 100%;
}

.services-tab-nav {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--copper) var(--bg-darker);
    -webkit-overflow-scrolling: touch;
}

.services-tab-nav::-webkit-scrollbar {
    height: 6px;
}

.services-tab-nav::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 4px;
}

.services-tab-nav::-webkit-scrollbar-thumb {
    background: var(--steel-dark);
    border-radius: 4px;
}

.services-tab-nav:hover::-webkit-scrollbar-thumb {
    background: var(--copper);
}

.tab-btn {
    background: var(--bg-slate);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    flex: 0 0 auto;
}

.tab-btn:hover {
    background: var(--bg-slate-hover);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(220, 165, 22, 0.15), rgba(166, 124, 0, 0.05));
    border-color: var(--copper);
    color: var(--copper);
    box-shadow: 0 4px 15px rgba(220, 165, 22, 0.1);
}

/* Tablet / Desktop expansion */
@media (min-width: 768px) {
    .services-tab-nav {
        flex-wrap: wrap;
        justify-content: center;
        overflow-x: visible;
        padding-bottom: 0;
    }

    .tab-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

.service-tab-pane {
    display: none;
    animation: fadeInTab 0.5s ease-in-out forwards;
}
.service-tab-pane.active {
    display: block;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }

    body {
        font-size: 15px;
    }

    .section {
        padding: 4rem 1.25rem !important;
    }

    .container {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Typography */
    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
        white-space: normal !important;
    }

    .section-title {
        font-size: 1.6rem !important;
        letter-spacing: normal !important;
    }

    /* Navigation */
    .mobile-menu-btn {
        display: flex !important;
        z-index: 1100;
    }

    .mobile-menu-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .navbar-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: #0a0a0c;
        display: flex !important;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 8rem;
        transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 1000;
        visibility: hidden;
        overflow-y: auto;
    }

    .navbar-nav.active {
        right: 0;
        visibility: visible;
    }

    .navbar-nav a {
        font-size: 1.25rem !important;
        padding: 1.25rem 0 !important;
        width: 100%;
        text-align: center;
    }

    .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        background: transparent !important;
        max-height: none !important; /* Expanded by default */
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-top: 0 !important;
    }

    .dropdown-menu a {
        font-size: 1.1rem !important; /* Slightly smaller for sub-items */
        padding: 0.75rem 0 !important;
        color: var(--text-muted) !important;
    }

    /* Services & Tabs */
    .services-tab-nav {
        gap: 0.5rem !important;
        padding: 0.5rem !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }

    .tab-btn {
        padding: 0.8rem 1rem !important;
        font-size: 0.9rem !important;
        flex: 0 0 auto !important;
    }

    .service-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 0 !important;
    }

    .tech-info-card {
        padding: 1.25rem !important;
        margin-bottom: 2rem !important;
        border-radius: var(--radius-md) !important;
    }

    .service-content h3 {
        font-size: 1.3rem !important;
        line-height: 1.3 !important;
    }

    .service-content p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }

    /* General Grids */
    .services-grid, .materials-grid, .gallery-grid, .quote-container {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    /* SURGICAL MOBILE FIXES */
    *, *::before, *::after {
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .section {
        padding: 3rem 1rem !important;
    }

    .container {
        padding: 0 !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .tech-info-card {
        padding: 1rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    .service-content {
        padding: 0 !important;
        width: 100% !important;
    }

    .service-desc-text {
        color: var(--text-main);
        margin-bottom: 1.5rem;
        line-height: 1.6;
        font-size: 0.95rem;
        text-align: left !important;
    }

    .service-quote-block {
        color: var(--steel-light);
        font-style: italic;
        text-align: left !important;
        font-size: 1.1rem;
        font-weight: 500;
        margin: 1.5rem 0;
        padding: 1rem !important;
        background: rgba(220, 165, 22, 0.05);
        border-left: 3px solid var(--copper);
        width: 100% !important;
    }

    .service-content h3, 
    .service-content h4 {
        font-size: 1.25rem !important;
        margin-bottom: 1rem !important;
        line-height: 1.2 !important;
        text-align: left !important;
        width: 100% !important;
        display: block !important;
    }

    .table-responsive {
        margin: 0 -1rem 2rem -1rem !important;
        padding: 0 1rem !important;
        width: calc(100% + 2rem) !important;
    }

    .table-responsive table th,
    .table-responsive table td {
        white-space: nowrap !important;
        word-break: normal !important;
    }

    table th:first-child,
    table td:first-child {
        padding-right: 1.5rem !important;
    }

    table th:last-child,
    table td:last-child {
        padding-left: 1.5rem !important;
    }
}

.mobile-only {
    display: none;
}/* Service Pages Sidebar Layout */
.container:has(.services-page-layout) {
    max-width: 100% !important;
    padding: 0 !important;
}

.services-page-layout {
    display: block;
    padding-left: 260px;
    min-height: 100vh;
}

.services-sidebar {
    background: var(--bg-darker);
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    padding: 200px 1.5rem 2rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    box-shadow: none;
    height: 100vh;
    overflow-y: auto;
    z-index: 900;
}

.service-main-content {
    padding-left: 3rem;
    padding-right: 2rem;
    padding-top: 1rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 500;
    font-family: var(--font-body);
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    transition: var(--transition);
    border-left: none;
    text-decoration: none;
    font-size: 0.95rem;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    padding-left: 1rem;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-weight: 600;
}

/* Group Headers */
.sidebar-group-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-weight: 600;
    font-family: var(--font-body);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
    cursor: default;
}

.sidebar-sublink {
    display: block;
    padding: 0.6rem 1rem 0.6rem 2.8rem;
    color: var(--text-muted);
    font-weight: 500;
    font-family: var(--font-body);
    border-radius: var(--radius-md);
    margin-bottom: 0.2rem;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.9rem;
}

.sidebar-sublink:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.sidebar-sublink.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    font-weight: 600;
}

@media (max-width: 992px) {
    .logo {
        margin-left: 1.5rem;
    }
    .logo img {
        height: 125px; /* Updated to requested 125px size */
        margin-top: -25px; /* Pushed absolutely to the top end */
        margin-bottom: -40px;
        transform: scale(1);
    }
    .services-page-layout {
        padding-left: 0;
    }
    .footer {
        padding-left: 0;
    }
    .services-sidebar {
        display: none !important;
    }
    .service-main-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Ultimate Mobile Optimizations & Cache-Bust Overrides */
@media (max-width: 992px) {
    /* Disable expensive fixed backgrounds on mobile OS (iOS Safari lag fix) */
    .hero-bg, .specialty-card, body {
        background-attachment: scroll !important;
    }
    
    /* Ensure strict no horizontal scroll */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Force absolute dominance over sidebar removal */
    .services-sidebar, .services-sidebar * {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        position: absolute !important;
        pointer-events: none !important;
    }
    
    .services-page-layout {
        display: block !important;
        padding-left: 0 !important;
    }
}

@media (max-width: 768px) {
    /* Optimize Hero Header for small iPhones */
    .hero-title {
        font-size: 2.1rem !important;
        line-height: 1.2;
    }
    
    .specialties-grid {
        margin-top: 2rem !important;
        gap: 1.5rem !important;
    }
}
