/* --- Variables de Color y Estilos Globales --- */
:root {
    --color-dark: #121212;
    --color-dark-secondary: #1a1a1a;
    --color-dark-border: #2a2a2a;
    --color-light: #ffffff;
    --color-gray: #a0a0a0;
    --color-primary: #34d399;
    /* Verde principal */
    --color-accent-red: #ef4444;
    /* Rojo para acentos */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-dark);
    color: var(--color-light);
    line-height: 1.7;
    padding-top: 61px;
    /* Altura aproximada del navbar */
}

/* --- Componentes Reutilizables --- */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 6rem 0;
}

main section:first-of-type {
    padding-top: 6rem;
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 .highlight {
    color: var(--color-primary);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* NUEVO: Título para categoría de servicio */
h3.service-category-title {
    font-size: 2rem;
    margin-top: 4rem;
    /* Espacio antes de una nueva categoría */
    margin-bottom: 2rem;
    color: var(--color-light);
    text-align: center;
    border-bottom: 1px solid var(--color-dark-border);
    padding-bottom: 1rem;
}

h3.service-category-title:first-of-type {
    margin-top: 0;
    /* Sin margen superior para la primera categoría */
}

h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

p {
    color: var(--color-gray);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    /* Asegura que los botones no tengan borde por defecto */
}

.btn-primary {
    background-color: var(--color-primary);
    color: #111;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: scale(1.03);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-light);
    border: 1px solid var(--color-dark-border);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* --- Navbar --- */
.navbar {
    background-color: #121212f0;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-dark-border);
    padding: 0.8rem 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.navbar-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.navbar-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.navbar-links a {
    color: var(--color-gray);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.navbar-links a:hover,
.navbar-links a.active {
    color: var(--color-primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-light);
    cursor: pointer;
}

.menu-toggle svg {
    width: 30px;
    height: 30px;
}

/* --- Sección Hero --- */
.hero {
    height: 100vh;
    min-height: 700px;
    background-color: var(--color-dark);
    display: flex;
    align-items: center;
    position: relative;
    margin-top: -61px;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    width: 100%;
}

.hero-content {
    text-align: left;
    z-index: 2;
}

.hero h1 {
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-buttons .btn {
    margin: 0 0.5rem 0 0;
}

.hero-image {
    width: 100%;
    height: 72vh;
    max-height: 600px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid var(--color-primary);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
    z-index: 1;
}

.scroll-indicator::after {
    content: '';
    position: absolute;
    top: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 50%;
    animation: scrollDown 2s infinite ease-in-out;
}

@keyframes scrollDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateY(20px);
        opacity: 0.5;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- Sección Servicios --- */
.services-section {
    text-align: center;
}

.services-section .section-intro,
.gallery-section .section-intro,
.why-us-section .section-intro {
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

/* Grid layout */
.services-grid-pyramid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Estilos para la segunda fila (con 2 elementos centrados) */
.services-grid-pyramid-row2 {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.services-grid-pyramid-row2>.service-card {
    width: calc(33.333% - 1rem);
    max-width: 400px;
}

/* Grid standard para Autos */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    /* Especifica 2 filas */
    gap: 2rem;
    margin-bottom: 2rem;
}

.service-card {
    background-color: var(--color-dark-secondary);
    padding: 2.5rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--color-dark-border);
    text-align: left;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.service-card>*:last-child:not(.service-card-footer) {
    margin-bottom: 0;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-primary);
}

/* Footer de la card con flexbox */
.service-card-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Botón Ver Más (derecha) */
.service-details-btn {
    font-size: 0.85rem;
    padding: 0.6rem 1.2rem;
    /* Tamaño ajustado */
    background-color: rgba(52, 211, 153, 0.1);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.service-details-btn:hover {
    background-color: rgba(52, 211, 153, 0.2);
    transform: scale(1.03);
}

/* Botón Cotizar (izquierda) */
.service-quote-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    /* Estilo primario por defecto */
}

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.service-icon svg {
    width: 28px;
    height: 28px;
}

.service-icon.green {
    background-color: rgba(52, 211, 153, 0.1);
    color: var(--color-primary);
}

.service-icon.red {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-accent-red);
}

/* --- Sección Sobre Nosotros --- */
.about-section .container {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 4rem;
    align-items: center;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.about-content .highlight {
    color: var(--color-light);
    font-weight: 600;
}

.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-box {
    background-color: var(--color-dark-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--color-dark-border);
    text-align: center;
}

.stat-box span {
    display: block;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-gray);
}

/* --- Sección Galería (Trabajos) --- */
.gallery-section {
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--color-dark-border);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(18, 18, 18, 0.9), transparent);
    padding: 2.5rem 1.5rem 1.5rem 1.5rem;
    text-align: left;
}

.gallery-overlay h3 {
    font-size: 1.5rem;
    color: var(--color-light);
    margin: 0;
}

.project-title-green {
    color: var(--color-primary);
}

.project-title-red {
    color: var(--color-accent-red);
}

.gallery-cta {
    text-align: center;
    margin-top: 3rem;
}

/* --- Sección Por qué Elegirnos --- */
.why-us-section {
    text-align: center;
    border-top: 1px solid var(--color-dark-border);
}

.why-us-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.why-us-item {
    padding: 2rem 1.5rem;
}

.why-us-item h3 {
    color: var(--color-light);
    font-size: 1.4rem;
}

.why-us-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem auto;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.why-us-icon svg {
    width: 36px;
    height: 36px;
}

.why-us-item:hover .why-us-icon {
    background-color: var(--color-primary);
    color: var(--color-dark);
    transform: scale(1.1);
}

/* --- Modals --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--color-dark-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--color-dark-border);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: zoomIn 0.3s ease;
    overflow-y: auto;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--color-light);
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--color-primary);
}

/* Estilos específicos Modal Galería */
#gallery-modal #modal-image {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
}

#gallery-modal #modal-description {
    text-align: left;
}

#gallery-modal #modal-title {
    color: var(--color-primary);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

#gallery-modal #modal-text {
    color: var(--color-gray);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Estilos específicos Modal Servicios */
#service-modal .modal-content {
    padding-top: 3rem;
}

#service-modal-title {
    color: var(--color-primary);
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.modal-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.modal-details-grid h4 {
    color: var(--color-light);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-dark-border);
}

.modal-process ul,
.modal-benefits ul {
    list-style: none;
    padding-left: 0;
}

.modal-process li,
.modal-benefits li {
    color: var(--color-gray);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    line-height: 1.6;
}

.modal-process li span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--color-accent-red);
    color: var(--color-light);
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.modal-benefits li svg {
    width: 24px;
    height: 24px;
    color: var(--color-primary);
    margin-top: 2px;
    flex-shrink: 0;
}

/* --- Footer --- */
footer {
    padding: 5rem 0 2rem 0;
    border-top: 1px solid var(--color-dark-border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: var(--color-light);
}

.footer-brand h4 {
    font-size: 1.8rem;
}

.footer-col p,
.footer-col a {
    color: var(--color-gray);
    text-decoration: none;
    display: flex;
    align-items: start;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.footer-col a:hover {
    color: var(--color-primary);
}

.footer-col svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--color-primary);
}

.footer-services a {
    display: block;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--color-dark-border);
}

.footer-bottom p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* --- Media Queries (Diseño Responsivo) --- */

@media (max-width: 992px) {
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    section {
        padding: 4rem 0;
    }

    .hero {
        height: auto;
        min-height: 0;
        padding-top: 8rem;
        padding-bottom: 6rem;
        margin-top: -61px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero-content {
        text-align: center;
    }

    .hero-buttons .btn {
        margin: 0 0.5rem;
    }

    .hero-image {
        height: auto;
        max-height: 500px;
    }

    /* Servicios responsive */
    .services-grid {
        grid-template-columns: 1fr 1fr;
    }

    .services-grid-pyramid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        margin-bottom: 0;
    }

    /* Asegura que el 5to item se centre en la última fila */
    .services-grid-pyramid>*:nth-child(5) {
        grid-column: 1 / span 2;
        justify-self: center;
        max-width: calc(50% - 0.75rem);
    }

    .services-grid-pyramid-row2 {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .why-us-grid {
        grid-template-columns: 1fr 1fr;
    }

    .about-section .container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-image {
        text-align: center;
    }

    .about-image img {
        max-width: 500px;
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Modal Servicios en Tablet */
    .modal-details-grid {
        grid-template-columns: 1fr;
        /* Apila columnas */
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 61px;
    }

    .hero {
        margin-top: -61px;
        padding-bottom: 6rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .navbar-content {
        justify-content: flex-end;
    }

    .navbar-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--color-dark-secondary);
        flex-direction: column;
        text-align: center;
        padding: 0;
        gap: 0;
        border-bottom: 1px solid var(--color-dark-border);
    }

    .navbar-links.active {
        display: flex;
    }

    .navbar-links li {
        padding: 1rem 0;
        border-top: 1px solid var(--color-dark-border);
        width: 100%;
    }

    .navbar-links a {
        font-size: 1.1rem;
    }

    .menu-toggle {
        display: block;
    }

    /* Servicios responsive móvil */
    .services-grid,
    .services-grid-pyramid {
        grid-template-columns: 1fr;
        /* 1 columna */
    }

    .services-grid-pyramid>*:nth-child(6) {
        grid-column: auto;
        /* Resetea span */
        justify-self: auto;
        /* Resetea centrado */
        max-width: none;
        /* Ancho completo */
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .why-us-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item img {
        height: 250px;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col p,
    .footer-col a {
        justify-content: center;
        text-align: left;
    }

    .footer-services a {
        text-align: center;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .service-card {
        padding: 2rem 1.5rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .modal-close {
        right: 1rem;
        top: 0.5rem;
    }
}

/* --- Dropdown Tienda --- */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background-color: var(--color-dark-secondary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    z-index: 1;
    border-radius: 8px;
    border: 1px solid var(--color-dark-border);
    padding: 1rem;
    color: var(--color-light);
    font-weight: 600;
    margin-top: 0.5rem;
    animation: fadeIn 0.2s ease;
    text-align: center;
}

.dropdown-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    section {
        padding: 3rem 0;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    /* Forzar 1 columna en grillas */
    .services-grid,
    .services-grid-pyramid,
    .why-us-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Reset para la fila 2 de pirámide (ya no es necesaria la lógica de centrado) */
    .services-grid-pyramid-row2 {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .services-grid-pyramid-row2>.service-card {
        width: 100%;
        max-width: none;
    }

    /* Reset del item 5 centrado */
    .services-grid-pyramid>*:nth-child(5) {
        grid-column: auto;
        justify-self: stretch;
        max-width: none;
    }

    /* Service Cards Mejoradas para Mobile */
    .service-card {
        padding: 1.5rem;
        min-height: auto;
        /* Dejar que crezca según contenido */
    }

    .service-card-footer {
        flex-direction: row;
        /* Mantener en fila */
        gap: 1rem;
        margin-top: 2rem;
    }

    .service-card-footer .btn {
        flex: 1;
        /* Botones ocupan ancho disponible equitativo */
        text-align: center;
        padding: 0.8rem 0.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Hero adjustments */
    .hero {
        padding-top: 6rem;
        padding-bottom: 4rem;
        height: auto;
        min-height: 100svh;
        /* Usar svh para mejor soporte móvil */
    }

    .scroll-indicator {
        bottom: 5px;
        z-index: 10;
    }

    /* Footer en 1 columna */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }

    .footer-col p,
    .footer-col a {
        justify-content: center;
    }

    .footer-brand h4 {
        margin-bottom: 1rem;
    }

    /* Modal ajustes */
    .modal-content {
        padding: 1.5rem;
        width: 95%;
        margin: 0 auto;
    }

    .modal-details-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Stats en fila o columna? 2 columnas está bien para stats */
    .stats-container {
        gap: 1rem;
    }

    .stat-box {
        padding: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}
