/* 
   ========================================
   Main Stylesheet for Ferroleiria Rebuilt
   ========================================
*/

/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;900&display=swap');

/* CSS Variables for Branding */
:root {
    --brand-dark: #04201f;
    --brand-accent: #0f5c59;
    --bg-main: #f4f4f5;
    --text-dark: #111827;
    --text-gray: #4b5563;
    --white: #ffffff;
    /* Legacy variables mapped to new palette for backward compatibility */
    --primary-dark: var(--brand-dark);
    --primary-light: var(--white);
    --accent-gold: var(--brand-accent);
    --text-light: var(--white);
    --background-light-gray: var(--bg-main);
 }

/* A simple reset to make styling more consistent across browsers */
*, *::before, *::after {
    box-sizing: border-box;
}

body, h1, h2, p, ul, li {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif; /* A modern, clean font */
    color: var(--text-dark);
    line-height: 1.6;
}

/* ==========================================================================
   GLOBAL COMPONENTS: SUBPAGE HERO
   ========================================================================== */
.subpage-hero {
    position: relative;
    padding: 160px 5% 80px;
    min-height: 400px; /* Forces identical height across all subpages */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--brand-dark);
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    color: var(--white);
    text-align: center;
    z-index: 1;
}

.subpage-hero.has-bg::before {
    content: ''; 
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(4, 32, 31, 0.85);
    z-index: -1;
}

.subpage-hero .container { position: relative; z-index: 2; width: 100%; }

.subpage-hero h1 { 
    font-size: clamp(2.5rem, 4vw, 3.5rem); 
    font-weight: 900; 
    margin-bottom: 15px; 
    letter-spacing: -1px; 
    text-transform: uppercase; 
    line-height: 1.1; 
}
.subpage-hero p { 
    font-size: 1.1rem; 
    max-width: 700px; 
    margin: 0 auto; 
    color: rgba(255,255,255,0.9); 
    font-weight: 400; 
    line-height: 1.6; 
}

@media (max-width: 768px) {
    .subpage-hero { 
        padding: 120px 5% 60px; 
        min-height: 320px;
    }
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn-glass {
    display: inline-block;
    padding: 15px 35px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 9999px;
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: var(--white);
}

/* General Section Spacing */
section {
    padding: 60px 0;
}

.site-footer {
    background-color: var(--brand-dark);
    color: rgba(255, 255, 255, 0.62);
    padding: 72px 0 28px;
    margin-top: auto;
    border-top: none;
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14) 20%, rgba(255, 255, 255, 0.14) 80%, transparent);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
    text-align: left;
}

.footer-widget h3 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 700;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-widget a:hover {
    color: var(--accent-gold);
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s, color 0.3s;
}

.social-icons a:hover {
    background: var(--accent-gold);
    color: var(--primary-dark);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* Contact Form Styles */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit; /* Ensures textarea uses the same font */
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-gold);
    outline: none;
    box-shadow: 0 0 5px rgba(254, 201, 1, 0.5);
}

.btn-submit {
    display: inline-block;
    background-color: var(--accent-gold);
    color: var(--primary-light);
    font-weight: bold;
    padding: 12px 25px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.btn-submit:hover {
    opacity: 0.9;
}

/* General Button Styles */
.btn {
    display: inline-block;
    background-color: var(--accent-gold);
    color: var(--primary-light);
    font-weight: bold;
    padding: 12px 25px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

/* Contact Page Specific Styles */
#contact-page {
    background-color: var(--background-light-gray);
}

#contact-page .section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 50px;
    color: #666;
}

.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
}

.contact-form-wrap {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.contact-form-wrap h3,
.contact-details-wrap h3 {
    color: var(--primary-dark);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.contact-details-wrap p {
    margin-bottom: 20px;
}

.contact-details-wrap ul {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
}

.contact-details-wrap ul li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.contact-details-wrap ul li i {
    color: var(--accent-gold);
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.map-placeholder iframe {
    border-radius: 8px;
}

.map-consent-notice {
    border: 1px dashed var(--border-color, #ccc);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}

.map-consent-notice p {
    margin-bottom: 14px;
}

.footer-legal-links {
    margin-top: 8px;
    font-size: 13px;
    opacity: 0.85;
}

.footer-legal-links a {
    color: inherit;
    text-decoration: underline;
}

/* Responsive for contact grid */
@media (max-width: 992px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Product Detail Page */
#product-detail {
    padding: 80px 0;
    background-color: #fff;
}

.btn-back {
    display: inline-block;
    margin-bottom: 30px;
    color: #777;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.btn-back i {
    margin-right: 10px;
}

.btn-back:hover {
    color: var(--accent-gold);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* Give a bit more space for the text */
    gap: 60px;
    align-items: start;
}

.product-detail-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.product-detail-info h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

.product-detail-info p {
    margin-bottom: 30px;
    line-height: 1.7;
    color: #555;
}

/* Responsive for product detail grid */
@media (max-width: 992px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* Scroll Animation Classes */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Styles for content rendered from the Rich Text Editor */
.editable-content p:last-child,
.editable-content-small p:last-child {
    margin-bottom: 0;
}

.editable-content p {
    margin-bottom: 1rem;
}

.editable-content-small,
.editable-content-small p {
    font-size: 0.95rem;
    color: #666;
}

/* --- V7 PREMIUM CORE --- */
:root {
    --brand-dark: #04201f;
    --brand-accent: #0f5c59;
    --bg-main: #f4f4f5;
    --text-dark: #111827;
    --text-gray: #4b5563;
    --white: #ffffff;
}

body { background-color: var(--bg-main); color: var(--text-dark); overflow-x: hidden; scroll-behavior: smooth; }

/* HEADER */
header.premium-header { position: fixed; top: 0; left: 0; width: 100%; padding: 25px 5%; display: flex; justify-content: space-between; align-items: center; z-index: 100; background: linear-gradient(to bottom, rgba(4, 32, 31, 0.95), transparent); }
.premium-header .logo img { height: 40px; filter: brightness(0) invert(1); }
.premium-header .nav-links { display: flex; gap: 40px; }
.premium-header .nav-links a { color: var(--white); text-decoration: none; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; position: relative; }
.premium-header .nav-links a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: -6px; left: 0; background-color: var(--white); transition: width 0.3s ease; }
.premium-header .nav-links a:hover::after { width: 100%; }

/* Mobile Header Toggle */
.mobile-menu-toggle { display: none; background: transparent; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; padding: 5px; }

@media (max-width: 992px) {
    .mobile-menu-toggle { display: block; }
    .premium-header { padding: 15px 5%; background: var(--brand-dark); }
    .premium-header .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--brand-dark);
        flex-direction: column;
        gap: 0;
        box-shadow: 0 15px 30px rgba(0,0,0,0.3);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-15px);
        transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    }
    .premium-header .nav-links.active { opacity: 1; visibility: visible; transform: translateY(0); padding: 5px 0 20px; }
    
    /* Premium Staggered Link Animation */
    .premium-header .nav-links a { padding: 15px 5%; width: 100%; display: block; text-align: left; opacity: 0; transform: translateY(10px); transition: all 0.4s ease; }
    .premium-header .nav-links.active a { opacity: 1; transform: translateY(0); }
    .premium-header .nav-links.active a:nth-child(1) { transition-delay: 0.10s; }
    .premium-header .nav-links.active a:nth-child(2) { transition-delay: 0.15s; }
    .premium-header .nav-links.active a:nth-child(3) { transition-delay: 0.20s; }
    .premium-header .nav-links.active a:nth-child(4) { transition-delay: 0.25s; }
    
    .premium-header .nav-links a::after { display: none; }
}

/* HERO - GAP FIXED */
.hero-v7 { position: relative; min-height: 650px; height: 85vh; max-height: 900px; width: 100%; display: flex; align-items: center; justify-content: center; text-align: center; }
.hero-v7 video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.hero-v7 .hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(4, 32, 31, 0.65); z-index: 2; }
.hero-v7 .hero-content { position: relative; z-index: 3; color: var(--white); max-width: 1000px; padding: 0 20px; margin-top: -60px; }
.hero-v7 .hero-heading { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
.hero-v7 h1 { font-size: clamp(3rem, 6vw, 4.5rem); font-weight: 900; line-height: 1.1; letter-spacing: -2px; margin-bottom: 0; }
.hero-title-logo {
    display: block;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 28px rgba(0, 0, 0, 0.35));
}
.hero-heading-switch {
    display: none;
}

body.is-site-admin .hero-heading-switch {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    opacity: 0.55;
    pointer-events: none;
}

body.is-site-admin.editing-active .hero-heading-switch {
    opacity: 1;
    pointer-events: auto;
}
.hero-v7 p { font-size: clamp(1.1rem, 2vw, 1.2rem); font-weight: 300; max-width: 600px; margin: 0 auto 40px; color: rgba(255,255,255,0.9); }

/* CTA BUTTONS */
.cta-pill { display: inline-flex; align-items: center; gap: 15px; padding: 16px 35px; border: 1px solid var(--white); border-radius: 50px; color: var(--white); text-decoration: none; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 2px; transition: all 0.4s ease; background: rgba(255,255,255,0.1); backdrop-filter: blur(5px); }
.cta-pill:hover { background: var(--white); color: var(--brand-dark); transform: scale(1.05); }

/* --- HOMEPAGE CONTACT CTA --- */
.homepage-contact-cta {
    background: var(--white);
    padding: 100px 5%;
    text-align: center;
    position: relative;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.homepage-contact-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 3px;
    background: var(--brand-accent);
    border-radius: 0 0 2px 2px;
}

.homepage-contact-cta__inner {
    max-width: 680px;
    margin: 0 auto;
}

.homepage-contact-cta h2 {
    color: var(--brand-dark);
    font-size: clamp(2rem, 4vw, 2.65rem);
    font-weight: 900;
    margin-bottom: 18px;
    letter-spacing: -0.75px;
}

.homepage-contact-cta p {
    color: var(--text-gray);
    font-size: 1.05rem;
    line-height: 1.75;
    max-width: 520px;
    margin: 0 auto 32px;
}

.homepage-contact-cta .cta-pill {
    border-color: var(--brand-dark);
    color: var(--brand-dark);
    background: transparent;
    backdrop-filter: none;
}

.homepage-contact-cta .cta-pill:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: var(--white);
}

/* PILLARS - OVERLAP ADJUSTED */
.pillars-wrapper { position: relative; z-index: 10; max-width: 1200px; margin: -120px auto 0; padding: 0 5%; }
.pillars-grid { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--white); border-radius: 12px; box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15); overflow: hidden; }
.pillar-card { position: relative; padding: 45px 30px; text-align: center; border-right: 1px solid rgba(0,0,0,0.05); transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); background: var(--white); }
.pillar-card:last-child { border-right: none; }
.pillar-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); z-index: 2; }

/* Editorial Section */
.editorial-section { padding: 100px 5%; background-color: var(--bg-main); display: grid; grid-template-columns: 1fr 1fr; gap: 80px; max-width: 1400px; margin: 0 auto; align-items: center; }
.editorial-text h2 { font-size: 2.5rem; font-weight: 900; color: var(--brand-dark); line-height: 1.1; margin-bottom: 25px; letter-spacing: -1px; }
.editorial-text p { font-size: 1.05rem; line-height: 1.8; color: var(--text-gray); margin-bottom: 20px;}
.editorial-image { width: 100%; height: 100%; min-height: 450px; background-size: cover; background-position: center; border-radius: 16px; box-shadow: 0 20px 40px rgba(0,0,0,0.05);}

/* Swipe Track Fixes */
.products-section { padding: 60px 0 120px; background-color: var(--bg-main); overflow: hidden; }
.products-header { display: flex; justify-content: space-between; align-items: flex-end; max-width: 1400px; margin: 0 auto 30px; padding: 0 5%; }
.products-header h2 { font-size: 2.2rem; font-weight: 900; color: var(--brand-dark); letter-spacing: -1px; margin: 0; }

.product-track-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding-left: 5%;
}

.product-track-wrapper::before,
.product-track-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 56px;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.product-track-wrapper::before {
    left: 5%;
    background: linear-gradient(to right, var(--bg-main) 20%, transparent);
}

.product-track-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-main) 20%, transparent);
}

.product-track-wrapper.can-scroll-left::before,
.product-track-wrapper.can-scroll-right::after {
    opacity: 1;
}

.product-track {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    padding-right: 5%;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    cursor: grab;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.product-track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
    user-select: none;
}

.product-track.is-dragging a {
    pointer-events: none;
}

.product-track:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 4px;
}

.product-track::-webkit-scrollbar {
    display: none;
}

.product-track-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--white);
    color: var(--brand-dark);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.product-track-nav:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.product-track-nav--prev { left: calc(5% + 8px); }
.product-track-nav--next { right: 16px; }

.product-track-nav[hidden] {
    display: none;
}

.prod-card-v7 { flex: 0 0 280px; scroll-snap-align: start; position: relative; height: 360px; border-radius: 12px; overflow: hidden; display: flex; align-items: flex-end; text-decoration: none; box-shadow: 0 10px 25px rgba(0,0,0,0.05); background-color: var(--white); }
.prod-card-v7 img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s ease; z-index: 1; }
.prod-card-v7 .prod-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(4,32,31,0.95) 0%, rgba(4,32,31,0.4) 50%, transparent 100%); z-index: 2; transition: opacity 0.4s ease; }
.prod-card-v7 .prod-info { position: relative; z-index: 3; padding: 25px; width: 100%; transition: transform 0.4s ease; }
.prod-card-v7 h3 { color: var(--white); font-size: 1.3rem; font-weight: 700; margin-bottom: 5px; text-shadow: 0 4px 15px rgba(0,0,0,0.8); }
.prod-card-v7 span { color: rgba(255,255,255,0.7); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;}
.prod-card-v7:hover img { transform: scale(1.08); }
.prod-card-v7:hover .prod-overlay { background: linear-gradient(to top, rgba(4,32,31,0.95) 0%, rgba(4,32,31,0.3) 100%); }
.prod-card-v7:hover .prod-info { transform: translateY(-8px); }

@media (max-width: 992px) {
    .pillars-wrapper { margin-top: -60px; }
    .pillars-grid { grid-template-columns: 1fr; }
    .pillar-card { border-right: none; border-bottom: 1px solid rgba(0,0,0,0.05); padding: 35px 20px;}
    .editorial-section { grid-template-columns: 1fr; gap: 40px; padding-top: 60px;}
    .editorial-image { order: -1; min-height: 350px; }
    .products-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .prod-card-v7 { flex: 0 0 250px; height: 320px;}
    .product-track-nav { display: none; }
}

/* --- V6 CATALOG MASTERPIECE OVERRIDES --- */
/* Layout Grid */
.catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 40px; max-width: 1300px; margin: 0 auto; padding: 50px 5% 100px; }
#catalog { scroll-margin-top: 120px; }

/* --- MINIMALIST PURE FILTER SIDEBAR --- */
.catalog-sidebar {
    position: sticky;
    top: 120px;
    height: max-content;
    /* No max-height/overflow here on purpose: capping it forced the menu to
       scroll on itself instead of the page, hiding content (e.g. "Ver todos
       os produtos") below the viewport. Sticky positioning already releases
       naturally once the page scrolls past the sidebar's own height. */
    padding-right: 15px;

    /* NUKING THE DASHBOARD BOX: Restoring transparent, borderless container */
    background: transparent;
    border: none;
    border-radius: 0;
    padding-left: 0;
    box-shadow: none;
}

.sidebar-header {
    display: flex; align-items: flex-end; height: 42px; margin-bottom: 30px; padding-bottom: 12px; border-bottom: 2px solid rgba(0,0,0,0.12); 
}
.sidebar-header h3,
.sidebar-header .sidebar-desktop-title { 
    font-size: 0.8rem; font-weight: 800; color: var(--text-gray); text-transform: uppercase; letter-spacing: 1.5px; line-height: 1; margin: 0; margin-bottom: 3px;
}

.sidebar-mobile-kicker,
.sidebar-mobile-title {
    display: none;
}

/* Mobile Filter Toggle */
.mobile-only-icon { display: none !important; transition: transform 0.3s ease; }

/* Native HTML5 Accordion */
details.ghost-accordion { margin-bottom: 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
details.ghost-accordion summary { padding: 18px 0; font-size: 0.95rem; font-weight: 700; color: var(--brand-dark); cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; transition: color 0.3s ease; text-transform: uppercase; letter-spacing: 0.5px; }
details.ghost-accordion summary::-webkit-details-marker { display: none; }
/* Crisp 1px Math Vector Icons */
details.ghost-accordion summary::after { 
    content: ''; width: 12px; height: 12px; padding: 15px; margin-right: -15px;
    background: linear-gradient(var(--text-gray), var(--text-gray)) center/1px 12px no-repeat, linear-gradient(var(--text-gray), var(--text-gray)) center/12px 1px no-repeat; 
    background-origin: content-box; transition: all 0.3s ease; flex-shrink: 0;
}
details.ghost-accordion[open] summary::after { 
    background: linear-gradient(var(--brand-dark), var(--brand-dark)) center/12px 1px no-repeat; 
    background-origin: content-box;
}
details.ghost-accordion[open] summary { color: var(--brand-dark); }
details.ghost-accordion summary:hover { color: var(--brand-dark); }

/* Subcategory Links */
.subcat-list { display: flex; flex-direction: column; padding-bottom: 15px; }
.subcat-link { font-size: 0.85rem; color: var(--text-gray); text-decoration: none; font-weight: 500; padding: 8px 0; transition: all 0.3s ease; display: block; }
.subcat-link:hover { color: var(--brand-dark); padding-left: 8px; }
/* Em-Dash Active State */
.subcat-link.active { color: var(--brand-dark); font-weight: 700; }
.subcat-link.active::before { content: '— '; color: var(--brand-accent); margin-right: 5px; font-weight: 400;}

/* Main Content Area */
.catalog-content-area { display: flex; flex-direction: column; transition: opacity 0.3s ease; }
.section-header-locked { display: flex; align-items: flex-end; justify-content: space-between; height: 42px; margin-bottom: 30px; padding-bottom: 12px; border-bottom: 2px solid rgba(0,0,0,0.12); }
.section-header-locked h2 { font-size: 1.8rem; font-weight: 900; color: var(--brand-dark); letter-spacing: -1px; text-transform: uppercase; line-height: 1; margin: 0; }
.result-count { font-size: 0.8rem; font-weight: 600; color: var(--text-gray); text-transform: uppercase; letter-spacing: 1px; line-height: 1; margin: 0; margin-bottom: 3px; }

/* Dense B2B Product Grid */
.dense-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.b2b-card { background: var(--white); border-radius: 8px; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; box-shadow: 0 4px 15px rgba(0,0,0,0.02); transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); border: 1px solid rgba(0,0,0,0.06); }
.b2b-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.06); border-color: rgba(4, 32, 31, 0.15); }
.b2b-card-img { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; position: relative; background: #f0f0f0; border-bottom: 1px solid rgba(0,0,0,0.05); }
.b2b-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s ease; }
.b2b-card:hover .b2b-card-img img { transform: scale(1.05); }
.b2b-card-details { padding: 20px 15px; display: flex; flex-direction: column; flex-grow: 1; }
.b2b-card-details h3 { font-size: 1rem; font-weight: 800; color: var(--brand-dark); margin-bottom: 6px; line-height: 1.3; }
.b2b-card-details p { font-size: 0.85rem; color: var(--text-gray); line-height: 1.4; margin-bottom: 20px; flex-grow: 1; }
.b2b-card-link { font-size: 0.75rem; font-weight: 700; color: var(--brand-accent); text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 6px; transition: all 0.3s ease; }
.b2b-card:hover .b2b-card-link { gap: 10px; color: var(--brand-dark); }

@media (max-width: 992px) {
    .catalog-layout { grid-template-columns: 1fr; gap: 40px; padding-top: 40px;}
    .catalog-sidebar { position: relative; top: 0; max-height: none; margin-bottom: 30px; padding-right: 0; }
    .sidebar-header {
        display: flex;
        margin-bottom: 0;
        cursor: pointer;
        align-items: center;
        justify-content: space-between;
        height: auto;
        padding: 18px 0;
        border-bottom: 2px solid rgba(0, 0, 0, 0.08);
        gap: 16px;
    }
    .sidebar-header__label {
        flex: 1;
        min-width: 0;
    }
    .sidebar-desktop-title {
        display: none;
    }
    .sidebar-mobile-kicker {
        display: block;
        font-size: 0.68rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 1.6px;
        color: var(--brand-accent);
        margin-bottom: 5px;
    }
    .sidebar-mobile-title {
        display: block;
        font-size: 0.95rem;
        font-weight: 800;
        color: var(--brand-dark);
        text-transform: uppercase;
        letter-spacing: 0.4px;
        line-height: 1.2;
    }
    .sidebar-header.open { margin-bottom: 20px; border-bottom-color: var(--brand-accent); }
    .sidebar-header.open .mobile-only-icon { transform: rotate(180deg); }
    .mobile-only-icon { display: block !important; color: var(--brand-accent); flex-shrink: 0; }
    .sidebar-content { display: none; padding-top: 10px; }
    .sidebar-content.open { display: block; }
    .section-header-locked { height: auto; align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 30px;}
    .section-header-locked h2 { font-size: 1.8rem; transform: none; }
    .dense-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* Static Card Overrides */
.b2b-card-static { cursor: default; }
.b2b-card-static:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.06); }

/* Upgrade: Micro-Copy Watermark to fill visual voids on static cards */
.b2b-card-static .b2b-card-details { position: relative; }
.b2b-card-static .b2b-card-details::after {
    content: 'Sob Consulta'; /* B2B Contextual text */
    position: absolute;
    bottom: 20px; 
    left: 20px; /* Aligned to the left to anchor the typography */
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.5; /* Keeps it subdued so it doesn't look like a clickable button */
    width: auto; height: auto; background-color: transparent; border-radius: 0;
}

/* UX Fix: Split-Action Accordion Headers */
details.ghost-accordion summary { padding: 0; } /* Remove padding from summary so link can absorb it */
.summary-link { 
    display: block; flex-grow: 1; padding: 14px 0; font-size: 0.9rem;
    color: inherit; text-decoration: none; transition: color 0.3s ease; 
}
.summary-link:hover, .summary-link.active { color: var(--brand-accent); }

/* Restoring the classy, flat typography list */
.ghost-accordion-link { 
    border-bottom: 1px solid rgba(0,0,0,0.06); 
    margin: 0; /* Removing the pill gap */
}

.ghost-accordion-link a { 
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; 
    font-size: 0.85rem; 
    font-weight: 700; 
    color: var(--brand-dark); 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    text-decoration: none; 
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    
    /* Nuking the pill background and sliding effects */
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    transform: none !important; 
}

.ghost-accordion-link a:hover { 
    color: var(--brand-accent); 
}

.ghost-accordion-link a.active { 
    color: var(--brand-accent); 
    font-weight: 900;
}

/* A highly-refined, tiny geometric dot to indicate active state without heavy boxes */
.ghost-accordion-link a.active::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background-color: var(--brand-accent);
    border-radius: 50%;
}

/* --- EMPRESA PAGE --- */

.empresa-content { padding: 100px 5%; background: var(--white); }
.empresa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; max-width: 1200px; margin: 0 auto; align-items: center; }

.empresa-text h2 { font-size: 2.2rem; font-weight: 900; color: var(--brand-dark); margin-bottom: 25px; letter-spacing: -1px; text-transform: uppercase; line-height: 1.2; }
.empresa-text .content-block { font-size: 1.05rem; color: var(--text-gray); line-height: 1.8; text-align: left; max-width: 65ch; }
.empresa-text .content-block p { margin-bottom: 15px; }

.empresa-image { position: relative; z-index: 1; width: 100%; margin: 0; padding: 0; }
.empresa-image::before, .empresa-image::after { display: none !important; } 

.empresa-image img,
.empresa-image video { 
    width: 100%; height: auto;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    object-fit: cover;
    aspect-ratio: 4/3; display: block;
}

.mvv-section { padding: 100px 5% 120px; background: var(--bg-main); border-top: 1px solid rgba(0,0,0,0.04); }

.mvv-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; max-width: 1200px; margin: 0 auto; }

.mvv-section .mvv-grid:first-of-type > .mvv-card { 
    flex: 1 1 calc(50% - 30px); 
    max-width: 580px;
}

.mvv-section .mvv-grid:last-of-type > .mvv-card { 
    flex: 1 1 calc(33.333% - 30px); 
    max-width: 380px; 
}

.mvv-card {
    background: var(--white); padding: 50px 40px; border-radius: 4px; text-align: center;
    border: 1px solid rgba(0,0,0,0.05); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.mvv-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.06); border-color: rgba(15, 92, 89, 0.15); }

.mvv-icon {
    width: 60px; height: 60px; margin: 0 auto 20px;
    background: transparent; color: var(--brand-accent); 
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; transition: color 0.3s ease;
}
.mvv-card:hover .mvv-icon { color: var(--brand-dark); }

.mvv-card h3 { font-size: 1.3rem; font-weight: 800; color: var(--brand-dark); margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px; }
.mvv-card .content-block { font-size: 1rem; color: var(--text-gray); line-height: 1.6; }

@media (max-width: 992px) {
    .empresa-grid { grid-template-columns: 1fr; gap: 50px; }
    .empresa-image { order: -1; }
    .mvv-section .mvv-grid:first-of-type > .mvv-card,
    .mvv-section .mvv-grid:last-of-type > .mvv-card { flex: 1 1 calc(50% - 30px); max-width: 100%; }
}
@media (max-width: 768px) {
    .mvv-section .mvv-grid:first-of-type > .mvv-card,
    .mvv-section .mvv-grid:last-of-type > .mvv-card { flex: 1 1 100%; }
}

/* --- CATEGORIZED MASTER INDEX (UX UPGRADE) --- */
.catalog-group-section { margin-bottom: 60px; }
.catalog-group-section:last-child { margin-bottom: 0; }
.group-title { 
    font-size: 1.4rem; 
    font-weight: 800; 
    color: var(--brand-dark); 
    margin-bottom: 25px; 
    padding-bottom: 10px; 
    border-bottom: 2px solid rgba(0,0,0,0.06); 
    display: flex;
    align-items: center;
    gap: 15px;
}
/* Small visual accent for the category headers */
.group-title::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    background-color: var(--brand-accent);
    border-radius: 2px;
}

/* --- DEPARTMENT SHOWROOM (UX UPGRADE) --- */
.department-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
    gap: 25px; 
}
.department-card { 
    position: relative; 
    border-radius: 6px; 
    overflow: hidden; 
    aspect-ratio: 4/3; 
    text-decoration: none; 
    display: block; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}
.department-card img { 
    width: 100%; height: 100%; object-fit: cover; 
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1); 
}
.department-card::before { 
    content: ''; position: absolute; inset: 0; 
    background: linear-gradient(to top, rgba(4,32,31,0.95) 0%, rgba(4,32,31,0.5) 60%, transparent 100%); 
    z-index: 1; 
}
.department-card-content { 
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 25px; 
    z-index: 2; color: var(--white); 
}
.department-card:hover img { transform: scale(1.08); }
.department-card h3 { 
    font-size: 1.3rem; font-weight: 900; margin-bottom: 8px; text-transform: uppercase; letter-spacing: -0.5px; text-shadow: 0 4px 15px rgba(0,0,0,0.8);
}
.department-card span { 
    font-size: 0.65rem; font-weight: 700; color: rgba(255,255,255,0.6); background: transparent;
    text-transform: uppercase; letter-spacing: 1px; display: inline-flex; align-items: center; gap: 5px; 
    padding: 0; transition: all 0.3s ease; margin-top: 2px;
}
.department-card:hover span { 
    background: transparent; color: var(--white); gap: 10px;
}

/* Sidebar "View All" Button */
.sidebar-footer { 
    margin-top: 30px; padding-top: 25px; border-top: 1px solid rgba(0,0,0,0.06); 
}
.btn-view-all { 
    display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; 
    background: rgba(4, 32, 31, 0.04); color: var(--brand-dark); 
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; 
    border-radius: 6px; text-decoration: none; font-size: 0.85rem;
    transition: all 0.3s ease; 
}
.btn-view-all::after {
    content: '➔';
    font-family: inherit;
    font-size: 1.1em;
    transition: transform 0.3s ease;
}
.btn-view-all:hover, .btn-view-all.active { 
    background: var(--brand-dark); color: var(--white);
    box-shadow: 0 5px 15px rgba(4, 32, 31, 0.15);
}
.btn-view-all:hover::after {
    transform: translateX(4px);
}

/* ==========================================================================
   UNIVERSAL COMPONENT: AMBIENT GALLERY (JAVASCRIPT-POWERED)
   ========================================================================== */
.ambient-gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3; /* Standard B2B Industrial Ratio */
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    display: block;
}

/* Add a subtle, slow-moving "Ken Burns" effect */
@keyframes kenburns-pan {
    0% {
        transform: scale(1.1) translate(-2%, -2%);
    }
    50% {
        transform: scale(1.1) translate(2%, 2%);
    }
    100% {
        transform: scale(1.1) translate(-2%, -2%);
    }
}

/* Base state for all images inside the gallery */
.ambient-gallery img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; /* This will fill the container, restoring the original look */
    opacity: 0;
    transition: opacity 1.5s ease-in-out; /* Smooth crossfade */
    animation: kenburns-pan 25s linear infinite; /* Apply the slow pan to all images */
}

.ambient-gallery img:nth-child(even) {
    animation-direction: alternate-reverse; /* Vary the movement for a more dynamic feel */
}

/* The currently visible image */
.ambient-gallery img.active {
    opacity: 1;
}

/* INTELLIGENCE: If there is only 1 photo, it overrides the fade and stays static */
.ambient-gallery img:only-child {
    opacity: 1;
    position: relative; 
}