/*
  Page-specific stylesheet for the 3D Printing Service page
  Version: 6.0 - Final Interaction Lock (Region-Aware Stack)
*/

/* --- Hero, CTA, Universal Styles ... (no changes here) ... --- */
.page-hero {
    background-image: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, .5)), url(../images/backgrounds/hero-bg-3d-printing.jpg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.final-cta-section {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/backgrounds/hero-bg-3d-printing.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.tech-showcase-section,
.materials-gallery-section,
.design-freedom-section,
.process-flow-section {
    padding: var(--section-padding);
}

/* --- Tech Showcase Section (FINAL POLISHED VERSION) --- */
.tech-showcase-section {
    background-color: var(--color-light);
}

.tech-showcase-section .section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.tech-tabs-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .tech-tabs-container {
        grid-template-columns: 1fr 2fr;
        gap: 4rem;
    }
}

.tech-tabs-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tech-tab-btn {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-dark);
    background-color: var(--color-light);
    border: 1px solid var(--color-border);
    border-left: 5px solid var(--color-border);
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tech-tab-btn:hover {
    border-left-color: var(--color-primary);
    background-color: #fbfdff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.tech-tab-btn.is-active {
    color: var(--color-primary);
    background-color: var(--color-light);
    border-color: var(--color-border);
    border-left-color: var(--color-primary);
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.1);
    transform: translateY(-5px);
}

.tech-tabs-content {
    position: relative;
    min-height: 500px;
}

.tech-tab-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(10px);
}

.tech-tab-pane.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tech-tab-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
    /* Increased space */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tech-tab-description h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    /* Increased space */
}

.tech-tab-description p {
    color: var(--color-secondary);
    line-height: 1.7;
    max-width: 500px;
}

/* --- Materials Section (Region-Aware Stack Gallery - FINAL) --- */
.materials-gallery-section {
    background-color: var(--color-light-grey);
}

.materials-gallery-section h2 {
    text-align: center;
    margin-bottom: 4rem;
}

.stacked-gallery-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    /* Increased max-width to comfortably fit 4 cards */
    margin: 0 auto;
    height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stacked-card {
    position: absolute;
    height: 350px;
    width: 230px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    /* Using a single, refined transition for all properties */
    transition: transform 1.0s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.stacked-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 60%);
}

.material-card-caption {
    position: absolute;
    z-index: 2;
    bottom: 1rem;
    left: 1rem;
    color: var(--color-light);
    font-size: 1.1rem;
    font-weight: 700;
}

/* Collapsed (Default) State */
.stacked-card:nth-child(1) {
    transform: translateX(-120px) rotate(-10deg);
}

.stacked-card:nth-child(2) {
    transform: translateX(-40px) rotate(-5deg);
}

.stacked-card:nth-child(3) {
    transform: translateX(40px) rotate(5deg);
}

.stacked-card:nth-child(4) {
    transform: translateX(120px) rotate(10deg);
}

/* Expanded (Hover) State */
.stacked-gallery-container:hover .stacked-card:nth-child(1) {
    transform: translateX(-390px) rotate(0deg);
}

.stacked-gallery-container:hover .stacked-card:nth-child(2) {
    transform: translateX(-130px) rotate(0deg);
}

.stacked-gallery-container:hover .stacked-card:nth-child(3) {
    transform: translateX(130px) rotate(0deg);
}

.stacked-gallery-container:hover .stacked-card:nth-child(4) {
    transform: translateX(390px) rotate(0deg);
}

/* --- Design Freedom & Process Flow Sections ... (no changes here) ... --- */
.design-freedom-section {
    background-color: var(--color-light);
}

.design-freedom-section h2 {
    text-align: center;
    margin-bottom: 4rem;
}

.freedom-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: flex-start;
}

@media (min-width: 992px) {
    .freedom-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

.freedom-item {
    text-align: center;
}

.freedom-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    aspect-ratio: 1/1;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.freedom-item:hover .freedom-image {
    transform: scale(1.03);
}

.freedom-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.freedom-content p {
    color: var(--color-secondary);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

.process-flow-section {
    background-color: var(--color-light-grey);
}

.process-flow-section h2 {
    text-align: center;
    margin-bottom: 4rem;
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    align-items: start;
}

.process-step {
    text-align: center;
}

.process-icon {
    display: block;
    height: 64px;
    margin: 0 auto 1.5rem auto;
}

.process-step h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    min-height: 3.2em;
}

.process-step p {
    color: var(--color-secondary);
    line-height: 1.6;
}