/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

/* Global Styles */
:root {
    /* Main brand colors from provided palette */
    --primary-color: #1a3d36;    /* Dark teal - primary brand color */
    --secondary-color: #3b3e44;  /* Dark gray - secondary color */
    --accent-color: #697272;     /* Medium gray - accent color */
    --light-color: #dedede;      /* Light gray - background/light elements */
    --dark-color: #1a1a1a;       /* Dark gray for text */
    
    /* Additional colors from palette */
    --light-gray: #dedede;       /* Light gray */
    --medium-gray: #9fa6a7;      /* Light gray-blue */
    --dark-teal: #1a3d36;        /* Dark teal */
    --dark-gray: #3b3e44;        /* Dark gray */
    --muted-gray: #697272;       /* Muted gray */
    
    /* Utility colors */
    --text-color: #333;          /* Main text color */
    --text-light: #666;          /* Lighter text */
    --border-color: #e0e0e0;     /* Border color */
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    background-color: #f9f9f9;
    overflow-x: hidden;
    padding-top: 76px; /* For fixed navbar */
    line-height: 1.6;
}

/* Preloader */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 3000; /* above all UI */
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9f8 100%);
    color: var(--dark-color);
    opacity: 1;
    visibility: visible;
    transition: opacity 420ms ease, visibility 420ms ease;
}

.preloader__inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.preloader__logo {
    opacity: 0;
    transform: translateY(4px) scale(0.985);
    animation: preloaderLogoIn 600ms ease-out forwards, preloaderSpinPulse 12000ms linear 800ms infinite;
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.preloader__text {
    font-weight: 300;
    color: var(--secondary-color);
    letter-spacing: 0.4px;
    opacity: 0.7;
    animation: preloaderBlink 1.6s ease-in-out 400ms infinite alternate;
}

.preloader--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes preloaderLogoIn {
    0% { opacity: 0; transform: translateY(4px) scale(0.985); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes preloaderPulse {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(0) scale(1.02); }
}

@keyframes preloaderSpinPulse {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.02); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes preloaderBlink {
    0% { opacity: 0.35; }
    100% { opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
    .preloader__logo, .preloader__text { animation: none !important; }
    .preloader { transition: none !important; }
}

/* Download Preloader (progress bar) */
.preloader.preloader--download .preloader__inner {
    gap: 0.6rem;
}
.preloader.preloader--download .preloader__text {
    margin-top: 2px;
}

.download-preloader__progress {
    width: min(340px, 78vw);
    height: 8px;
    border-radius: 999px;
    background: rgba(0,0,0,0.08);
    overflow: hidden;
    margin-top: 6px;
}

.download-preloader__progress-bar {
    height: 100%;
    width: 0%;
    background: var(--dark-teal);
    transition: width 200ms ease;
}

.preloader--indeterminate .download-preloader__progress-bar {
    width: 40% !important;
    animation: preloaderIndeterminate 1.4s ease-in-out infinite;
}

.download-preloader__percent {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 8px;
    opacity: 0.8;
}

@keyframes preloaderIndeterminate {
    0% { transform: translateX(-60%); }
    50% { transform: translateX(10%); }
    100% { transform: translateX(120%); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--dark-teal);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    bottom: -10px;
    left: 0;
    border-radius: 2px;
}

.lead {
    font-weight: 400;
    color: #6c757d;
    margin-bottom: 2rem;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    padding: 1rem 0;
    background-color: var(--primary-color) !important;
    z-index: 1100; /* ensure above other elements */
}

.navbar.scrolled {
    padding: 0.5rem 0;
    background-color: rgba(26, 61, 54, 0.85) !important; /* var(--dark-teal) with alpha */
    -webkit-backdrop-filter: saturate(160%) blur(6px);
    backdrop-filter: saturate(160%) blur(6px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

/* Mobile menu button minimal layering */
.navbar-toggler {
    position: relative;
    z-index: 1120; /* above navbar content */
}

.logo {
    height: 80px;
    width: auto;
    margin-right: 10px;
    border-radius: 4px;
    transition: height 0.25s ease;
}

/* Shrink logo on scroll */
.navbar.scrolled .logo {
    height: 48px;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    position: relative;
    margin: 0 0.25rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 0;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Hero Section */
.hero {
    position: relative;
    height: 90vh;
    min-height: 600px;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)), 
                url('../img/imgi_31_main-slider-two.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    color: var(--light-gray);
    text-align: center;
    margin-top: -76px; /* Offset fixed navbar */
    background-attachment: scroll;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Responsive background image */
@media (max-width: 768px) {
    .hero {
        background-attachment: scroll;
        background-position: top center;
    }
}

/* Ensure content is always visible */
.hero .container {
    position: relative;
    z-index: 2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: none; /* prevent overlay from blocking clicks */
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
}

/* Sections */
section {
    padding: 5rem 0;
}

/* About Section */
#nosotros {
    padding: 5rem 0;
    background-color: #fff;
}

/* Services Section */
#servicios {
    padding: 5rem 0;
    background-color: #f9f9f9;
}

/* Services */
.icon-box {
    width: 80px;
    height: 80px;
    background-color: #fff;
    color: var(--dark-teal);
    border: 2px solid currentColor;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    transition: all 0.3s ease;
}

.icon-box i {
    color: currentColor;
}

.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    overflow: hidden;
    height: 100%;
    border-top: 3px solid var(--muted-gray) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    background: white;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
    border-top-color: var(--icon-color, var(--dark-teal)) !important;
}
/* Video spotlight (Servicios) */
.video-spotlight {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    background: #000; /* in case poster/video fails */
}

.video-spotlight video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-spotlight .video-overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 12%, rgba(0,0,0,0.2) 55%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    transition: background 0.3s ease;
}

.video-spotlight:hover .video-overlay-gradient {
    background: linear-gradient(to top, rgba(0,0,0,0.7) 16%, rgba(0,0,0,0.25) 55%, rgba(0,0,0,0) 100%);
}

.video-spotlight .video-overlay-text {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    color: #fff;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    pointer-events: none; /* do not block video controls */
}

.video-spotlight .overlay-title {
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.2px;
}

@media (max-width: 575.98px) {
    .video-spotlight .overlay-title {
        font-size: 1rem; /* ensure readability on small screens */
    }
}
/* Play button overlay for mobile fallback */
.video-spotlight .video-play-button {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    outline: none;
    background: rgba(26, 61, 54, 0.92); /* var(--dark-teal) with alpha */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    z-index: 3;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.video-spotlight .video-play-button:hover,
.video-spotlight .video-play-button:focus {
    transform: translate(-50%, -50%) scale(1.06);
    box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}

.video-spotlight.playing .video-play-button {
    opacity: 0;
    pointer-events: none;
}
/* Top accent strip for Servicios y Catálogo */
#servicios .card,
#catalogo .card {
    position: relative;
}

#servicios .card::before,
#catalogo .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--muted-gray);
    transition: background-color 0.3s ease;
    pointer-events: none;
}

#servicios .card:hover::before,
#catalogo .card:hover::before {
    background-color: var(--icon-color, var(--dark-teal));
}

/* Mobile (no hover): simulate hover on tap/focus */
@media (hover: none) {
    /* top accent */
    #servicios .card:active::before,
    #servicios .card:focus-within::before,
    #catalogo .card:active::before,
    #catalogo .card:focus-within::before {
        background-color: var(--icon-color, var(--dark-teal));
    }
    /* elevation + border color */
    #servicios .card:active,
    #servicios .card:focus-within,
    #catalogo .card:active,
    #catalogo .card:focus-within {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
        border-top-color: var(--icon-color, var(--dark-teal)) !important;
    }
    /* fill icon circle */
    #servicios .card:active .icon-box,
    #servicios .card:focus-within .icon-box,
    #catalogo .card:active .icon-box,
    #catalogo .card:focus-within .icon-box {
        background-color: currentColor;
        color: #fff;
        border-color: currentColor;
    }
}

/* Respect Bootstrap's border-0 on cards despite our custom important borders */
.card.border-0 {
    border: 0 !important;
    border-top: 0 !important;
}

.card:hover .icon-box {
    background-color: currentColor;
    color: #fff;
    border-color: currentColor;
}

/* Catalog-specific icon color variants */
#catalogo .icon-box {
    background-color: #fff;
    color: var(--dark-teal);
    border: 2px solid currentColor;
}

#catalogo .icon-box i {
    color: currentColor;
}

/* Catalog: support image thumbnails inside circular icon box */
#catalogo .icon-box {
    overflow: hidden; /* ensure circular crop */
}

#catalogo .icon-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    transition: transform 0.35s ease;
    will-change: transform;
}

#catalogo .card:hover .icon-box img,
#catalogo .icon-box:hover img {
    transform: scale(1.12);
}

/* Catalog rectangular thumbnails replacing icon circles */
#catalogo .catalog-img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3; /* desktop/tablet */
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

#catalogo .catalog-card { 
    overflow: hidden; 
}

#catalogo .catalog-card:hover .catalog-img {
    transform: scale(1.05);
}

/* Make cards more square and compact */
#catalogo .catalog-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1rem 1.25rem;
    align-items: flex-start; /* left align content */
}

@media (max-width: 767.98px) {
    #catalogo .catalog-img {
        aspect-ratio: 1 / 1; /* more square on mobile */
    }
}

#catalogo .row .col-md-4:nth-of-type(1) .icon-box { color: #0ea5a5; } /* teal */
#catalogo .row .col-md-4:nth-of-type(2) .icon-box { color: #3b82f6; } /* blue */
#catalogo .row .col-md-4:nth-of-type(3) .icon-box { color: #ef4444; } /* red */
#catalogo .row .col-md-4:nth-of-type(4) .icon-box { color: #22c55e; } /* green */
#catalogo .row .col-md-4:nth-of-type(5) .icon-box { color: #f59e0b; } /* amber */
#catalogo .row .col-md-4:nth-of-type(6) .icon-box { color: #8b5cf6; } /* purple */
#catalogo .row .col-md-4:nth-of-type(7) .icon-box { color: #06b6d4; } /* cyan (optional) */

/* Catalog: define per-card color variable for card hover border */
#catalogo .row .col-md-4:nth-of-type(1) { --icon-color: #0ea5a5; }
#catalogo .row .col-md-4:nth-of-type(2) { --icon-color: #3b82f6; }
#catalogo .row .col-md-4:nth-of-type(3) { --icon-color: #ef4444; }
#catalogo .row .col-md-4:nth-of-type(4) { --icon-color: #22c55e; }
#catalogo .row .col-md-4:nth-of-type(5) { --icon-color: #f59e0b; }
#catalogo .row .col-md-4:nth-of-type(6) { --icon-color: #8b5cf6; }
#catalogo .row .col-md-4:nth-of-type(7) { --icon-color: #06b6d4; }

/* Hover: fill the circle with its own color and keep icon white */
#catalogo .card:hover .icon-box {
    background-color: currentColor;
    color: #fff;
    border-color: currentColor;
}

/* Servicios-specific icon color variants (updated palette) */
#servicios .row.g-4:not(.mt-2) .col-md-4:nth-child(1) .icon-box { color: #3b82f6; } /* blue */
#servicios .row.g-4:not(.mt-2) .col-md-4:nth-child(2) .icon-box { color: #10b981; } /* emerald */
#servicios .row.g-4:not(.mt-2) .col-md-4:nth-child(3) .icon-box { color: #f59e0b; } /* amber */
#servicios .row.g-4.mt-2 .col-md-4:nth-child(1) .icon-box { color: #8b5cf6; } /* violet */
#servicios .row.g-4.mt-2 .col-md-4:nth-child(2) .icon-box { color: #ef4444; } /* red */
#servicios .row.g-4.mt-2 .col-md-4:nth-child(3) .icon-box { color: #06b6d4; } /* cyan */

/* Servicios: define per-card color variable used by .card:hover border */
#servicios .row.g-4:not(.mt-2) .col-md-4:nth-child(1) { --icon-color: #3b82f6; }
#servicios .row.g-4:not(.mt-2) .col-md-4:nth-child(2) { --icon-color: #10b981; }
#servicios .row.g-4:not(.mt-2) .col-md-4:nth-child(3) { --icon-color: #f59e0b; }
#servicios .row.g-4.mt-2 .col-md-4:nth-child(1) { --icon-color: #8b5cf6; }
#servicios .row.g-4.mt-2 .col-md-4:nth-child(2) { --icon-color: #ef4444; }
#servicios .row.g-4.mt-2 .col-md-4:nth-child(3) { --icon-color: #06b6d4; }

/* Contact Form */
.form-control {
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--dark-teal);
    border-color: var(--dark-teal);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    color: white;
}

.btn-primary:hover {
    background-color: #0f2c26;
    border-color: #0a1f1b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 61, 54, 0.3);
    color: white;
}

/* Outline button using brand colors */
.btn-outline-primary {
    color: var(--dark-teal);
    border-color: var(--dark-teal);
    border-width: 2px;
    background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--dark-teal);
    border-color: var(--dark-teal);
    color: #fff;
}

/* Pill + compact modifiers for small oval buttons */
.btn-pill {
    border-radius: 999px !important;
}

.btn-compact {
    padding: 0.35rem 0.9rem;
    font-size: 0.875rem;
    letter-spacing: 0.3px;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
}

/* Map */
.map-container {
    height: 300px;
    width: 100%;
    overflow: hidden;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Back to top button */
.back-to-top {
    display: none; /* This will be toggled by JavaScript */
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    bottom: 30px;
    right: 30px;
    z-index: 2001; /* above WhatsApp and navbar */
    font-size: 30px; /* Match WhatsApp icon size */
    border: 2px solid white;
    outline: none;
    background-color: var(--dark-teal); /* Match .btn-primary */
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none; /* Remove shadow to avoid any transparency effect */
    padding: 0;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .back-to-top {
        width: 50px; /* Match WhatsApp */
        height: 50px; /* Match WhatsApp */
        font-size: 25px; /* Match WhatsApp */
        bottom: 20px;
        right: 20px;
    }
}

.back-to-top:hover {
    background-color: #0f2c26; /* Match .btn-primary:hover */
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 100px;
    right: 30px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white !important;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 2000; /* below back-to-top, above navbar */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    text-decoration: none !important;
    border: none;
    outline: none;
    border: 2px solid white;
}

.whatsapp-float:hover {
    background-color: #128c7e;
    color: #fff;
    transform: scale(1.1);
    text-decoration: none;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Social Links */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f8f9fa;
    color: var(--dark-color);
    margin-right: 10px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Footer-specific: change Instagram icon color on hover */
footer .social-links a:hover {
    color: #E4405F;
    background-color: transparent;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: #fff;
    padding: 2rem 0;
}

footer a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #fff;
    text-decoration: none;
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.25rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .navbar-collapse {
        background-color: var(--secondary-color);
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 1rem;
    }
    
    .nav-link {
        padding: 0.5rem 0 !important;
        margin: 0.25rem 0;
    }
}

@media (max-width: 767.98px) {
    .hero {
        height: 80vh;
        min-height: 500px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 25px;
    }
}
