/*
  --------------------------------------------------------------
  # Table of Contents
  --------------------------------------------------------------
  1.  General & Root Variables
  2.  Typography
  3.  Preloader
  4.  Header & Navigation
      - Horizontal Navbar (Mobile)
      - Vertical Navbar (Desktop)
  5.  Hero Section
  6.  General Sections & Titles
  7.  Cards (Services, Value Prop, Pricing)
  8.  Specific Sections
      - El Sistema (#sistema)
      - Cases (#cases) - Note: This ID is in your CSS but not in index.html
      - FAQ (#faq)
      - CTA (#cta)
  9.  Modals (CTA, Login)
  10. Footer
  11. Responsive Media Queries
  --------------------------------------------------------------
*/


/*--------------------------------------------------------------
## 1. General & Root Variables
--------------------------------------------------------------*/
:root {
    --primary-color: #2487ce;
    /* Azul profundo */
    --secondary-color: #124265;
    /* Azul oscuro (Comment updated from Cobre/Tierra) */
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
}

body {
    font-family: 'Poppins', sans-serif;
    position: relative;
}

/*--------------------------------------------------------------
## 2. Typography
--------------------------------------------------------------*/
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
}

/*--------------------------------------------------------------
## 3. Preloader
--------------------------------------------------------------*/
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.75s, visibility 0.75s;
}

.loader {
    border: 16px solid #f3f3f3;
    /* Light grey */
    border-top: 16px solid var(--secondary-color);
    /* Dark Blue */
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

body.loaded #loader-wrapper {
    opacity: 0;
    visibility: hidden;
}


/*--------------------------------------------------------------
## 4. Header & Navigation
--------------------------------------------------------------*/

/* General Navbar styles for all screen sizes */
.navbar {
    background-color: var(--secondary-color);
}

.navbar-brand,
.nav-link {
    color: white !important;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Vertical Navbar for Desktop (lg screens and up) */
@media (min-width: 992px) {
    .navbar-vertical {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        width: 280px;
        height: 100vh;
        /* Use a variable for consistency */
        background-color: var(--dark-gray);
        transition: right 0.4s ease-in-out;
        z-index: 1030;
    }

    /* Collapsed state for vertical navbar */
    .navbar-vertical.collapsed {
        right: -280px;
        /* Hide the navbar */
    }

    .navbar-vertical .navbar {
        flex-direction: column;
        align-items: flex-start;
        height: 100%;
        padding: 1.5rem;
    }

    .navbar-vertical .container {
        width: 100%;
        padding: 0;
        margin: 0;
        flex-direction: column;
        align-items: flex-start;
        height: 100%;
        display: flex;
    }

    .navbar-vertical .navbar-brand {
        margin-bottom: 1.5rem;
    }

    /* This is the key for the button at the bottom */
    .navbar-vertical .navbar-collapse {
        display: flex !important;
        flex-direction: column;
        flex-grow: 1;
        align-items: flex-start;
        width: 100%;
    }

    .navbar-vertical .navbar-nav {
        flex-direction: column !important;
        width: 100%;
    }

    .navbar-vertical .navbar-nav .ms-auto {
        margin-left: 0 !important;
    }

    .navbar-vertical .nav-item {
        width: 100%;
    }

    .navbar-vertical .nav-link {
        padding: 0.5rem 0;
    }

    /* Pushes the button to the bottom */
    .navbar-vertical .ms-lg-3 {
        margin-top: auto;
        margin-left: 0 !important;
        width: 100%;
    }

    /* Adjust main content to avoid overlap */
    #main,
    #hero {
        margin-right: 280px;
        transition: margin-right 0.4s ease-in-out;
    }

    /* Adjust main content when navbar is collapsed */
    .navbar-vertical.collapsed~#main,
    .navbar-vertical.collapsed~#hero {
        margin-right: 0;
    }

    /* --- Navbar Toggle Button --- */
    .navbar-toggle-icon-wrapper {
        position: absolute;
        top: 1.5rem;
        left: -48px;
        z-index: 10;
    }

    #navbar-toggle-btn {
        background-color: var(--secondary-color);
        border: none;
        color: white;
        padding: 0.5rem 0.85rem;
        border-radius: 5px 0 0 5px;
        box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.2);
    }

    #navbar-toggle-btn:hover {
        background-color: var(--primary-color);
    }
}


/*--------------------------------------------------------------
## 5. Hero Section
--------------------------------------------------------------*/
#hero {
    position: relative;
    color: white;
    background: url('../img/background.png') no-repeat center center;
    background-size: cover;
    /* This line positions the background image, not the logo */
    background-position: top;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Removed background overlay, as it was transparent. Can be re-added if needed. */
}

.hero-logo {
    /* Mobile First: In-flow, centered */
    position: relative; /* Changed from absolute for mobile */
    z-index: 10;
    width: 80%;
    max-width: 250px; /* Prevent logo from being too large on small screens */
    text-align: center;
    margin: 0 auto 2rem auto; /* Center horizontally and add space below */
}

.hero-logo img {
    max-height: 90px; /* Mobile size */
}

.hero-container {
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5); /* Softened shadow */
}

.hero-spacer {
    flex-grow: 1;
}

/*--------------------------------------------------------------
## 6. General Sections & Titles
--------------------------------------------------------------*/
.section-title {
    text-align: center;
    padding-bottom: 30px;
}

.section-title h2 {
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 20px;
    padding-bottom: 20px;
    position: relative;
}

.section-title h2::after {
    content: '';
    position: absolute;
    display: block;
    width: 50px;
    height: 3px;
    background: var(--secondary-color);
    bottom: 0;
    left: calc(50% - 25px);
}

/*--------------------------------------------------------------
## 7. Cards (Services, Value Prop, Pricing)
--------------------------------------------------------------*/
.service-card {
    background-color: #fff;
    border: 1px solid #dee2e6; /* Lighter border */
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
}

.service-icon,
.value-prop-icon {
    font-size: 3rem;
    color: var(--secondary-color);
}

/*--------------------------------------------------------------
## 8. Specific Sections
--------------------------------------------------------------*/

/* Section: El Sistema */
#sistema {
    background-color: var(--primary-color);
}

#sistema .section-title h2,
#sistema .section-title p {
    color: #fff;
}

#sistema .section-title h2::after {
    background: #fff;
}

#sistema .service-card {
    background-color: var(--secondary-color);
    border-color: var(--primary-color);
    color: #fff;
}

#sistema .service-card .card-title,
#sistema .service-card .service-icon {
    color: #fff;
}

/* Section: Presentacion de Proyecto - Vision Card */
#presentacion .vision-card {
    background-color: var(--secondary-color);
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#presentacion .vision-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

#presentacion .vision-card p {
    color: #fff;
}

/* Section: CTA */
#cta {
    background-color: var(--primary-color);
    color: white;
}

#cta h3 {
    color: white;
}

/*--------------------------------------------------------------
## 9. Modals (CTA, Login)
--------------------------------------------------------------*/
.cta-modal .modal-content {
    border-radius: 10px;
    border: none;
    overflow: hidden;
}

.cta-modal .modal-header {
    background-color: var(--primary-color);
    color: white;
    border-bottom: none;
}

.cta-modal .modal-title {
    color: white;
}

.cta-modal .modal-body {
    padding: 1.5rem;
}

.cta-modal .form-control {
    border-radius: 5px;
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
}

.cta-modal .form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(18, 66, 101, 0.25);
}

.cta-modal .modal-footer {
    background-color: var(--secondary-color);
    border-top: none;
}

.cta-modal .modal-footer .btn-primary:hover {
    background-color: #0a2242;
}

/*--------------------------------------------------------------
## 10. Footer
--------------------------------------------------------------*/
footer {
    background-color: var(--dark-gray);
    color: #ccc;
}

footer h5 {
    color: white;
}

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

footer a:hover {
    color: white;
}

.social-links a {
    font-size: 1.5rem;
    margin-right: 15px;
    display: inline-block;
}

.social-links .nav-social-icon {
    height: 4rem; /* Reduced from an assumed 1.5rem to be one-third */
    width: auto;
}

.social-links a i {
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-links a:hover i {
    transform: scale(1.2);
    color: var(--primary-color);
}

/*--------------------------------------------------------------
## 11. Responsive Media Queries (Mobile-First)
--------------------------------------------------------------*/

/* Base (Extra small devices, <576px) */
#hero {
    height: auto;
    padding: 120px 0 5px;
    flex-direction: column;
}
.hero-container {
    padding-top: 0; /* Adjusted as logo is now in flow */
}
.section-title h2 {
    font-size: 22px;
}
.service-icon,
.value-prop-icon {
    font-size: 2rem;
}
.social-links a {
    font-size: 1.2rem;
}


/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    #hero {
        padding: 100px 0 80px;
    }
    .hero-container {
        padding-top: 0; /* Adjusted as logo is now in flow */
    }
    .section-title h2 {
        font-size: 24px;
    }
    .service-icon,
    .value-prop-icon {
        font-size: 2.5rem;
    }
    .social-links a {
        font-size: 1.3rem;
    }
    .hero-logo img {
        max-height: 105px; /* Slightly larger for small landscape */
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .hero-logo {
        width: auto; /* Reset width for medium devices */
    }
    #hero {
        padding: 120px 0 100px;
    }
    .hero-container {
        padding-top: 0; /* Adjusted as logo is now in flow */
    }
    .section-title h2 {
        font-size: 28px;
    }
    .value-prop-icon {
        font-size: 2.8rem;
    }
    .social-links a {
        font-size: 1.4rem;
    }
    .hero-logo img {
        max-height: 120px; /* Tablet size */
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .hero-logo {
        position: absolute; /* Re-apply absolute for desktop */
        /* Desktop: Top-left position */
        top: 3rem;
        left: 3rem;
        transform: none;
        text-align: left;
        margin: 0; /* Reset margin */
        max-width: 300px;
    }
    #hero {
        height: 100vh;
        padding: 0; /* Reset padding for vh unit to work correctly */
        flex-direction: row;
    }
    .hero-container {
        padding-top: 0; /* Reset for desktop, spacer div will handle it */
    }
    .section-title h2 {
        font-size: 32px;
    }
    .hero-logo img {
        max-height: 150px; /* Desktop size */
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .hero-container {
        padding-top: 150px;
    }
}
