/* ============================================
Estilos CSS Centralizados para Mandrinados Anaid
Autor: Luis - Mandrinados Anaid
Versión: 6.0 (Fusión Completa - Sin errores)
============================================
*/

/* --- Importación de la fuente y variables de color --- */
/* Font loaded via <link> in HTML with preconnect for better performance */

:root {
    --color-primary: #f97316;
    /* Naranja corporativo */
    --color-primary-dark: #ea580c;
    --color-corporate-blue: #0F172A;
    --color-dark: #111827;
    --color-light: #ffffff;
    --color-gray-text: #4b5563;
    --color-gray-light: #f9fafb;
    --color-gray-medium: #e5e7eb;
    --color-gray-dark: #374151;
}

/* --- Estilos base y reseteo --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-light);
    color: var(--color-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* --- Accesibilidad --- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
    text-decoration: none;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Clases de utilidad generales --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.section-tag {
    color: var(--color-primary-dark);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--color-dark);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--color-gray-text);
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

/* --- Estilos para Banners de Página --- */
/* Fusionado: Incluye tus ajustes de padding reducidos */
.page-banner {
    position: relative;
    background-color: var(--color-gray-dark);
    color: var(--color-light);
    text-align: center;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../imagenes/excavadoras-de-demolicion-cat.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.page-banner .container {
    position: relative;
    z-index: 2;
}

.page-banner .hero-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.page-banner h1 {
    font-size: 3rem;
    font-weight: 800;
}

.page-banner p {
    font-size: 1.35rem;
    color: var(--color-gray-medium);
    margin-top: 0.5rem;
}

/* Ajuste de separación específico (preservado de tu archivo) */
.page-banner+.section {
    padding-top: 3rem;
}

/* --- Cabecera y Navegación --- */
.header {
    background-color: var(--color-corporate-blue);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.navbar-logo-icon {
    height: 40px;
    width: auto;
}

.navbar-logo-text {
    font-size: 1.5rem;
    font-weight: 800;
}

.navbar-logo-text .anaid {
    color: var(--color-primary);
}

.navbar-logo-text .mandrinados {
    color: var(--color-light);
}

/* New helpers for swapped logo */
.navbar-logo-text .text-primary {
    color: var(--color-primary);
}

.navbar-logo-text .text-light {
    color: var(--color-light);
}

.nav-links {
    display: none;
}

.nav-links a {
    color: var(--color-light);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 0.5rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary);
}

.nav-menu-button {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-light);
}

/* Menú Móvil */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-corporate-blue);
    padding: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    color: var(--color-light);
    font-weight: 600;
    padding: 1rem 1.5rem;
    text-align: center;
    text-decoration: none;
    border-bottom: 1px solid var(--color-gray-dark);
}

.mobile-menu a:last-child {
    border-bottom: none;
}

.mobile-menu a.btn {
    margin: 1rem 1.5rem;
}

/* --- Botones --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
}

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

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

.btn-outline-white {
    background-color: transparent;
    color: var(--color-light);
    border-color: var(--color-light);
}

.btn-outline-white:hover {
    background-color: var(--color-light);
    color: var(--color-corporate-blue);
}

.btn-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 90vh;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--color-light);
    background-size: cover;
    background-position: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-bg-home {
    background-image: url('../imagenes/pala-volvo-l220g-cantera.webp');
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 48rem;
    margin: 0 auto 2rem;
}

/* --- Secciones y Tarjetas --- */
.grid-4-cols,
.grid-2-cols {
    display: grid;
    gap: 2rem;
}

.grid-4-cols {
    grid-template-columns: 1fr;
}

.grid-2-cols {
    grid-template-columns: 1fr;
    align-items: center;
}

.service-card {
    background-color: var(--color-gray-light);
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 1rem 0 0.5rem;
}

.service-icon {
    width: 48px;
    height: 48px;
    color: var(--color-primary);
}

.service-detail-image {
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
}

/* --- Clase Específica para Imagen de Historia (Preservada de tu archivo) --- */
.history-image {
    width: 100%;
    max-height: 450px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
}

/* --- Página de Contacto (Formularios y Mapa) --- */
.contact-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.contact-info-icon {
    flex-shrink: 0;
    margin-right: 1rem;
    padding: 0.75rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-icon-phone {
    background-color: #FFF7ED;
    color: #F97316;
}

.contact-icon-whatsapp {
    background-color: #F0FFF4;
    color: #22C55E;
}

.contact-icon-email {
    background-color: #EFF6FF;
    color: #3B82F6;
}

.contact-info-text h3 {
    font-size: 1.125rem;
    font-weight: 700;
}

.contact-info-text a {
    font-size: 1.125rem;
    color: var(--color-gray-text);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-info-text a:hover {
    color: var(--color-primary);
}

.contact-form-container {
    background-color: var(--color-gray-dark);
    padding: 2.5rem;
    border-radius: 0.5rem;
    height: 100%;
    /* Fill the column */
    display: flex;
    flex-direction: column;
}

.contact-form-title {
    color: var(--color-light);
    text-align: left;
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.contact-form {
    display: flex;
    /* Changed from grid to flex to allow growing */
    flex-direction: column;
    gap: 1.5rem;
    flex-grow: 1;
    /* Take up remaining space */
}

.w-full {
    width: 100%;
}

.pt-0 {
    padding-top: 0 !important;
}

.iframe-map {
    width: 100%;
    height: 450px;
    border: 0;
}

/* Chat status tweaks */
.chat-status-container {
    margin-top: 4px;
}

.text-light {
    color: var(--color-light);
}

.text-white {
    color: white;
}

.grid-responsive {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.form-fields-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-input-dark {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #4A5568;
    border: 1px solid #718096;
    border-radius: 0.375rem;
    color: var(--color-light);
    transition: box-shadow 0.2s ease;
}

.form-input-dark::placeholder {
    color: #A0AEC0;
}

.form-input-dark:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.4);
}

textarea.form-input-dark {
    min-height: 150px;
    /* Increased min-height */
    flex-grow: 1;
    /* Expand to fill space */
    resize: vertical;
}

.map-container {
    width: 100%;
    max-width: 100%;
    margin: 3rem auto 0 auto;
    aspect-ratio: 16 / 9;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
}

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

.chatbot-promo {
    margin-top: 3rem;
    padding: 2.5rem;
    background-color: var(--color-gray-dark);
    border: 1px solid #4B5563;
    border-radius: 0.5rem;
    text-align: center;
    color: var(--color-light);
}

.chatbot-promo h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-light);
}

.chatbot-icon {
    width: 48px;
    height: 48px;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

/* --- Página Servicios (Imágenes Uniformes) --- */
.service-section:nth-child(even) {
    background-color: var(--color-gray-light);
}

.service-image {
    width: 100%;
    height: 350px;
    /* Altura fija para uniformidad */
    object-fit: cover;
    /* Recorta la imagen para llenar el espacio sin deformarse */
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
}

/* --- Página Galería --- */
.gallery-comparison-grid,
.gallery-grid {
    display: grid;
    gap: 2rem;
}

.gallery-grid {
    grid-template-columns: 1fr;
}

.gallery-grid .gallery-item {
    aspect-ratio: 1 / 1;
}

.gallery-grid .gallery-item img {
    height: 100%;
    object-fit: cover;
}

.gallery-comparison-item h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.before-after-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.before-after-container .gallery-item img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
}

.gallery-item img {
    width: 100%;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    color: var(--color-light);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* --- Estilos Páginas Legales --- */
.legal-content {
    padding: 2rem;
    background-color: var(--color-light);
    border-radius: 0.5rem;
    margin-top: -2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.legal-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--color-gray-medium);
    padding-bottom: 0.5rem;
}

.legal-content h2:first-of-type {
    margin-top: 0;
}

.legal-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-content p,
.legal-content li {
    color: var(--color-gray-text);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.legal-content ul {
    list-style-type: disc;
    list-style-position: inside;
    padding-left: 1rem;
}

.legal-content a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-content strong {
    color: var(--color-dark);
}

/* --- Footer --- */
.footer {
    background-color: var(--color-corporate-blue);
    color: #A0AEC0;
    padding: 4rem 0 2rem 0;
    text-align: center;
}

.footer-logo-container {
    margin-bottom: 1.5rem;
}

.footer .navbar-logo {
    justify-content: center;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.footer-socials a {
    color: var(--color-light);
    transition: color 0.3s;
}

.footer-socials a:hover {
    color: var(--color-primary);
}

.footer-legal {
    border-top: 1px solid #4A5568;
    padding-top: 1.5rem;
    font-size: 0.875rem;
}

.footer-legal a {
    color: #A0AEC0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-legal a:hover {
    color: var(--color-light);
}

/* --- Media Queries (Responsive) --- */
@media (min-width: 768px) {
    .nav-links {
        display: flex;
        gap: 1.5rem;
        align-items: center;
    }

    .nav-menu-button {
        display: none;
    }

    .hero-content h1 {
        font-size: 3.75rem;
    }

    .grid-2-cols {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4-cols {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .before-after-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-4-cols {
        grid-template-columns: repeat(4, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Alineación Página Contacto --- */
.contact-grid {
    align-items: stretch;
    /* Override center alignment to make columns equal height */
}

.contact-info-column {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.contact-form-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.contact-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.contact-form>div:last-child {
    margin-top: auto;
    padding-top: 1rem;
}

.chatbot-promo {
    margin-top: auto;
    /* Push to the bottom of the flex container */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.chatbot-promo .btn {
    margin-top: auto;
}

/* Botones alineados */
.btn.w-full,
.chatbot-promo .btn {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    background: var(--color-primary);
    border-color: var(--color-primary);
}

/* --- Nuevas Clases de Utilidad (Limpieza HTML) --- */
.mb-2 {
    margin-bottom: 0.5rem;
}

.text-gray {
    color: var(--color-gray-text);
}

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

/* Fondos específicos para banners */
.bg-hero-quienes {
    background-image: url('../imagenes/dumper_articulado_volvo.webp');
}

.bg-hero-galeria {
    background-image: url('../imagenes/bulldocer-carterpillar-d9.webp');
}

/* Fondo específico para chat input footer */
.chat-footer-note {
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mt-3 {
    margin-top: 3rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.video-responsive {
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
}

.icon-inline-small {
    width: 14px;
    height: 14px;
    display: inline;
    vertical-align: middle;
}

/* --- Créditos Footer --- */
.footer-credits {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-gray-text);
}

.footer-credits .credit-name {
    font-weight: 700;
    color: var(--color-primary);
    /* Destaca la marca con el naranja corporativo */
    letter-spacing: 0.5px;
}