/* ==========================================================================
   Variables de Diseño (Basadas en las reglas del proyecto)
   ========================================================================== */
   :root {
    /* Brand Colors (Basados en el logo de Baumaster) */
    --brand-red: #800020;
    --brand-red-dark: #630018;
    --brand-gold: #D4AF37;
    --brand-gold-hover: #F1C40F;
    --brand-silver: #C0C0C0;
    
    /* Neutral Colors */
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --text-color: #333333;
    --text-light: #666666;
    
    /* Reglas Globales UI/UX */
    --radius-main: 40px;
    --font-main: 'Plus Jakarta Sans', sans-serif;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--brand-red);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--brand-gold);
}

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

/* ==========================================================================
   Componentes (Botones)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-weight: 700;
    border-radius: var(--radius-main);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase; /* Regla Obligatoria */
    border: none;
}

.btn-primary {
    background-color: var(--brand-gold);
    color: var(--text-color);
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    background-color: var(--brand-gold-hover);
    transform: translateY(-2px);
    color: var(--text-color);
}

.btn-secondary {
    background-color: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-secondary:hover {
    background-color: #fff;
    color: var(--brand-red);
}

.btn-outline {
    background-color: transparent;
    color: var(--brand-red);
    border: 2px solid var(--brand-red);
}

.btn-outline:hover {
    background-color: var(--brand-red);
    color: #fff;
}

/* ==========================================================================
   Header / Navbar
   ========================================================================== */
.main-header {
    background-color: var(--bg-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--brand-red);
    letter-spacing: 1px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--brand-red);
    cursor: pointer;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.main-nav a {
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    font-size: 14px;
}

.main-nav a:hover {
    color: var(--brand-red);
}

/* ==========================================================================
   Hero Section (Swiper)
   ========================================================================== */
.hero-section {
    height: calc(100vh - 80px); /* 100vh menos el header */
    min-height: 500px;
}

.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.45); /* Capa oscura del 45% para dar legibilidad al texto */
    z-index: 1;
}

.project-caption {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

.slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    max-width: 800px;
    padding: 0 20px;
}

.slide-content h2 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.slide-content p {
    font-size: 20px;
    margin-bottom: 30px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Swiper Customization */
.swiper-button-next,
.swiper-button-prev {
    color: var(--brand-gold) !important;
}

.swiper-pagination-bullet-active {
    background: var(--brand-gold) !important;
}

/* Hero Metrics */
.hero-metrics {
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    padding: 20px 0;
    border-top: 2px solid var(--brand-gold);
}

.hero-metrics-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    text-align: center;
    color: #fff;
}

.metric-item {
    margin: 10px;
    flex: 1 1 auto;
}

.metric-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--brand-gold);
}

.metric-text {
    font-size: 14px;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .hero-section {
        height: auto;
        min-height: auto;
        display: block;
    }
    
    .swiper {
        height: 70vh; /* Altura explícita para que Swiper funcione correctamente */
        min-height: 480px; 
    }

    .hero-metrics {
        position: relative; 
        bottom: auto;
        background: #111; 
        padding: 30px 0;
    }
    
    .hero-metrics-container {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2 columnas en móvil */
        gap: 15px;
    }
    
    .metric-item {
        margin: 5px;
    }
}

/* ==========================================================================
   Content Sections
   ========================================================================== */
.content-section {
    padding: 80px 0;
    text-align: center;
}

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

.section-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--brand-red);
    margin-bottom: 20px;
    text-transform: uppercase;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.lead-text {
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 18px;
    color: var(--text-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background-color: var(--bg-light);
    padding: 40px 30px;
    border-radius: var(--radius-main);
    border: 2px solid var(--brand-red);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2), 0 6px 10px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bg-light .feature-card {
    background-color: var(--bg-color);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 35px rgba(0,0,0,0.25), 0 8px 15px rgba(0,0,0,0.15);
}

.feature-card i {
    font-size: 48px;
    color: #F5C242;
    display: inline-block;
    margin-bottom: 20px;
}

.feature-card h3 {
    color: var(--brand-red);
    font-size: 22px;
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-light);
    font-size: 16px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.main-footer {
    background-color: var(--brand-red);
    color: #fff;
    padding: 40px 0;
    text-align: center;
}

.main-footer a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

.main-footer a:hover {
    color: var(--brand-gold);
    text-decoration: none;
}

/* ==========================================================================
   Banner de Cookies (Protección de Datos Chile)
   ========================================================================== */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background-color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: var(--radius-main);
    z-index: 9999;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 2px solid var(--brand-silver);
}

.cookie-banner.hidden {
    display: none;
}

.cookie-content h3 {
    color: var(--brand-red);
    font-weight: 700;
    margin-bottom: 10px;
}

.cookie-content p {
    font-size: 14px;
    color: var(--text-light);
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-end;
}

/* Modal de Configuración de Cookies */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.cookie-settings-modal.hidden {
    display: none;
}

.cookie-settings-content {
    background-color: var(--bg-color);
    border-radius: var(--radius-main);
    padding: 40px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.cookie-settings-content h3 {
    color: var(--brand-red);
    font-weight: 700;
    margin-bottom: 10px;
}

.cookie-settings-content p {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.cookie-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--brand-silver);
}

.cookie-setting-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.cookie-setting-info p {
    font-size: 13px;
    margin-bottom: 0;
}

.cookie-settings-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Toggle Switch Styles (iOS style) */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
    margin-left: 15px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--brand-red);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--brand-red);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

input:disabled + .slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ==========================================================================
   Sección Contacto
   ========================================================================== */
.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: var(--bg-light);
    padding: 30px;
    border-radius: var(--radius-main);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: left;
    min-width: 300px;
}

.contact-item i {
    font-size: 40px;
    color: #F5C242;
}

.contact-details h3 {
    color: var(--brand-red);
    margin-bottom: 5px;
    font-size: 20px;
}

.contact-details p {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 10px;
}

.contact-details p a {
    color: var(--text-color);
}

.contact-details p a:hover {
    color: var(--brand-red);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 10px;
    gap: 4px;
}

.btn-copied {
    background-color: #10B981 !important; /* emerald-500 */
    color: #fff !important;
    border-color: #10B981 !important;
}

/* ==========================================================================
   Botón de Galería y Badge
   ========================================================================== */
.btn-gallery {
    position: relative;
    padding-right: 20px;
    margin-bottom: 20px;
    background-color: var(--brand-red);
    color: #fff;
    box-shadow: 0 4px 15px rgba(128, 0, 32, 0.4);
}

.btn-gallery:hover {
    background-color: var(--brand-red-dark);
    color: #fff;
    box-shadow: 0 6px 20px rgba(128, 0, 32, 0.6);
}

.gallery-badge {
    position: absolute;
    top: -12px;
    right: -10px;
    background-color: var(--brand-red);
    color: #fff;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 1px solid var(--brand-gold);
}

/* ==========================================================================
   Lightbox Gallery Modal
   ========================================================================== */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.lightbox-modal.hidden {
    opacity: 0;
    pointer-events: none;
    display: flex; /* keep flex for transitions */
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
}
.lightbox-close:hover { color: var(--brand-gold); }

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 40px;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
}
.lightbox-prev:hover, .lightbox-next:hover {
    background: var(--brand-gold);
    color: #000;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.lightbox-caption {
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    color: #fff;
    text-align: left;
}

.lightbox-tag {
    background-color: var(--brand-gold);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 5px;
    text-transform: uppercase;
}

#lightbox-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.lightbox-thumbnails-wrapper {
    position: absolute;
    bottom: 20px;
    width: 90vw;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none; /* Firefox */
}
.lightbox-thumbnails-wrapper::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.lightbox-thumbnails {
    display: flex;
    gap: 15px;
    justify-content: center;
    min-width: max-content;
}

.thumb-img {
    height: 60px;
    width: 90px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease, border 0.3s ease;
    border: 2px solid transparent;
}
.thumb-img:hover { opacity: 0.8; }
.thumb-img.active {
    opacity: 1;
    border-color: var(--brand-gold);
}

/* ==========================================================================
   Media Queries (Responsive)
   ========================================================================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 25px;
    }
    
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        height: 80px;
        padding: 0;
    }
    
    .logo {
        padding-left: 20px;
    }

    .main-nav {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--bg-color);
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
        display: none;
        flex-direction: column;
        padding: 20px 0;
        z-index: 999;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .slide-content h2 {
        font-size: 32px;
    }
    
    .section-title {
        font-size: 26px;
    }
    
    .slide-content p {
        font-size: 16px;
    }
    
    .cookie-banner {
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 40px 40px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }
    
    .cookie-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
