/* =========================================
   1. VARIABLES Y RESET BÁSICO
   ========================================= */
:root {
    /* Colores basados en el esquema de la plantilla (primary, accent, background, secondary) */
    --color-primary: #690809;
    /* Azul oscuro para header/fondo */
    --color-primary-foreground: #ffffff;
    /* Texto sobre primary */
    --color-secondary: #CBCAC7;
    /* Gris claro para secciones alternas */
    --color-background: #ffffff;
    /* Fondo principal */
    --color-card: #ffffff;
    /* Fondo de tarjetas */
    --color-muted-foreground: black;
    /* Texto secundario/descripciones */
    --color-accent: #252523;
    /* Naranja/Amarillo para botones y énfasis */
    --color-accent-foreground: white;
    /* Texto sobre accent */
    --color-border: #e5e7eb;

    /* Fuentes */
    --font-body: sans-serif;
    --font-headline: 'Space Grotesk', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: white;
    /* Color de texto oscuro por defecto */
    background-color: var(--color-background);
    line-height: 1.6;
    width: 100%;
    max-width: 100%;
}
#about, #whyus {
    overflow-x: hidden;
}

h1 {
    margin: 20px 0;
    font-size: 3.5em !important;
}

h2 {
    margin: 20px 0;
    font-size: 2.5em !important;
}

h3 {
    font-size: 2em;
}

h4 {
    font-size: 1.3em;
    text-align: center;
}

body p {
    text-align: justify;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

/* =========================================
   2. UTILIDADES DE MAQUETACIÓN (GRID, FLEX, CONTAINER)
   ========================================= */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.space-x-2>*+* {
    margin-left: 0.5rem;
}

.space-x-6>*+* {
    margin-left: 1.3rem;
}

.space-y-6>*+* {
    margin-top: 1.5rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

/* Contenedor central (simula la clase .container de la plantilla) */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 1200px;
}

.max-w-3xl {
    max-width: 48rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
    padding-top: 20px;
    padding-bottom: 20px;
}

.text-center {
    text-align: center;
}

/* Grid de 3 columnas para secciones de servicios y valores */
.grid {
    display: grid;
}

.gap-8 {
    gap: 2rem;
}

.md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lg\:col-span-1 {
    grid-column: span 1 / span 1;
}

/* Ocultar elementos en versión móvil (simula md:hidden, hidden) */
.hidden {
    display: none;
}

@media (min-width: 768px) {

    /* md */
    .md\:flex {
        display: flex;
    }

    .md\:inline-flex {
        display: inline-flex;
    }

    .md\:block {
        display: block;
    }

    .md\:hidden {
        display: none;
    }
}

/* =========================================
   3. TIPOGRAFÍA
   ========================================= */
.font-headline {
    font-family: var(--font-headline);
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.text-6xl {
    font-size: 3.75rem;
    line-height: 1;
}

.text-lg {
    font-size: 1.3rem;
    line-height: 1.75rem;
}

.font-bold {
    font-weight: 700;
}

.text-muted-foreground {
    color: var(--color-muted-foreground);
}

.text-primary-foreground {
    color: var(--color-primary-foreground);
}

.text-accent {
    color: var(--color-accent);
}

.text-primary {
    color: var(--color-primary);
}

@media (min-width: 640px) {

    /* sm */
    .sm\:text-4xl {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }
}

/* =========================================
   4. COMPONENTES PRINCIPALES
   ========================================= */

/* --- Header / Navegación --- */
header {
    background-color: var(--color-primary);
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

header .h-14 {
    height: 5.5rem;
}

.header-container {
    gap: 100px;
}

a {
    text-align: center;
}

header nav a {
    color: var(--color-primary);
    transition: color 0.15s;
    font-weight: 800;
    transition: 0.3s ease-in;
}

header nav a:hover {
    border-radius: 2em;
    border: 2px solid var(--color-primary);
    padding: 0 4px;
    transition: 0.3s ease-in-out;
}

#logo {
    width: 100px;
    height: auto;
}

/* --- Botones --- */
.inline-flex {
    display: inline-flex;
}

.rounded-md {
    border-radius: 0.375rem;
}

.h-10 {
    height: 2.5rem;
}

.h-11 {
    height: 2.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.bg-accent {
    background-color: var(--color-accent);
    color: var(--color-accent-foreground);
    transition: 0.3s ease;
    color: var(--color-secondary);
}

.hover\:bg-accent\/90:hover {
    transition: 0.3s ease;
    color: white;
    font-weight: 400;
    background-color: #3b3b39;
}

.bg-primary {
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
}

.hover\:bg-primary\/90:hover {
    background-color: rgba(30, 58, 138, 0.9);
}

.border {
    border: 1px solid var(--color-border);
}

/* --- Secciones --- */
.py-16 {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.md\:py-24 {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.bg-background {
    background-color: var(--color-primary);
}

.bg-secondary {
    background-color: var(--color-primary);
}

/* --- Tarjetas (Misión, Visión, Servicios) --- */
.rounded-lg {
    border-radius: 0.5rem;
}

.border {
    border: 3px solid var(--color-border);
}

.shadow-sm {
    box-shadow: 0 5px 20px var(--color-primary);
}

.bg-card {
    background-color: #E07726;
}

.text-card-foreground {
    color: white;
}

.p-6 {
    padding: 1.5rem;
}

.pt-0 {
    padding-top: 0;
}

.mt-12 {
    margin-top: 3rem;
}

.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.hover\:scale-105:hover {
    transform: scale(1.05);
}

.hover\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Íconos dentro de tarjetas de servicio */
.bg-primary {
    background-color: white;
}

.p-3 {
    padding: 0.5rem;
}

/* --- Hero --- */
.relative {
    position: relative;
}

.h-\[60vh\] {
    height: 90vh;
}

.min-h-\[400px\] {
    min-height: 400px;
}

.object-cover {
    object-fit: cover;
}

.absolute {
    position: absolute;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.bg-primary\/70 {
    background-color: rgba(30, 58, 138, 0.7);
}

/* Degradado oscuro en hero (para legibilidad del texto) */
.bg-gradient-to-t {
    background-image: url("public/imagenes/hero.png");
    background-size: cover;

    /* 3. Opcional, pero recomendado: Centrar la imagen y evitar la repetición */
    background-position: center;
}

.from-primary\/90 {
    --tw-gradient-from: rgba(30, 58, 138, 0.9);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(30, 58, 138, 0));
}

.to-transparent {
    --tw-gradient-to: transparent;
}

.relative.z-10 {
    z-index: 10;
}

.drop-shadow-lg {
    filter: drop-shadow(0 10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1));
}


/* --- Contacto / Formulario --- */
.input,
textarea {
    display: flex;
    height: 2.5rem;
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid var(--color-border);
    background-color: var(--color-background);
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5rem;
    color: #1f2937;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
    min-height: 5rem;
    height: auto;
}

.input:focus-visible,
textarea:focus-visible {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary);
}

.hero-buttons {
    gap: 30px;
    margin: 30px 0;
}

.valores {
    gap: 10px;
}

.valores span {
    font-size: 1.2em;
}

.valores svg {
    color: white;
    flex-shrink: 0
}

.valores p {
    font-size: 1.2em;
}


.introduction {
    font-size: 1.5em !important;
}



.hero-titulo,
.hero-subtitulo {
    color: white;
    -webkit-text-stroke: 2px black;
    paint-order: stroke fill;
}

.hero-subtitulo {
    font-weight: 600;
    font-size: 2em;
}



/* =========================================
   6. AJUSTES RESPONSIVOS PARA ESCRITORIO (LG - MD)
   ========================================= */

@media (min-width: 768px) {

    /* md */
    .md\:flex {
        display: flex;
    }

    .md\:inline-flex {
        display: inline-flex;
    }

    .md\:block {
        display: block;
    }

    .md\:hidden {
        display: none !important;
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {

    /* lg - Pantallas grandes */
    .lg\:grid-cols-2 {
        /* Aplica la cuadrícula de dos columnas */
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #about-content {
        flex-direction: row;
    }

    #whyus-container {
        flex-direction: row;
    }

    #about-content img {
        width: 17vw;
        height: 17vw;
    }

    #whyus img {
        width:17vw;
        height: 17vw;
    }

    #valores{
          margin-left: 100px;
    }

    #valores-container{
        width: 85vw;
    }

    #about-content p{
        text-align: justify;
        margin-right:5vw;
    }



}


@media (max-width:1200px){
    .products-images:hover .stacked-image.back-image.image-1{
        transform:translate(-50%, 40%) rotate(10deg);
    }
}

 #about-content img{
    border-radius: 1rem;
    border: white solid 3px;
 }

  #whyus img{
    border-radius: 1rem;
    border: white solid 3px;
 }


.grid {
    display: grid;
}

.gap-12 {
    gap: 3rem;
}

.formulario {
    font-size: 1.2em;
}

.formulario input {
    width: 70%;
    color: white;
    padding: 10px;
}

.formulario textarea {
    color: white;
}

.info-item {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 20px;
}

.info-item svg {
    color: white
}

#contact p {
    color: white;
}

#contact a {
    color: white;
}

.info-section-container {
    flex-wrap: wrap;
}

.info-section-container a {
    margin-left: 85px;
}

footer {
    padding: 20px;
}

footer p {
    color: black;
    margin: 10px;
}

.social-icons {
    gap: 30px;
}

#about {
    background: url("public/imagenes/fondo.jpg");
}

.icons-cards {
    background-color: #690809;
}

.first-text {
    margin-top: 150px;
}

.second-text {
    color: white;
    -webkit-text-stroke: 2px black;
    paint-order: stroke fill;
    font-weight: 800;
}

#whyus {
    background-color: #E07726;
    position: relative;
}

#whyus .bg-card {
    background-color: var(--color-primary);
}

#whyus p {
    color: white;
}

.bg-effect-1 {
    top: 0px;
    position: absolute;
    width: 100%;
    height: 200px;
    background-image: url("public/imagenes/b.png");
    background-position: top;


}

.bg-effect-2 {
    bottom: 0px;
    position: absolute;
    width: 100%;
    height: 200px;
    background-image: url("public/imagenes/b.png");
    background-position: bottom;
}

#services p {
    font-size: 1.2em;
}

.tercer-texto {
    font-weight: 800;
    color: white;
}



/* =========================================
   7. AJUSTES ESPECÍFICOS PARA MÓVIL (Menos de 768px)
   ========================================= */
@media (max-width: 767px) {

    /* Ajuste del Hero para que la imagen no corte caras o productos importantes */
    section.h-\[60vh\] {
        height: auto;
        min-height: 60vh;
        /* Ocupar casi toda la pantalla en móvil */
        padding-top: 80px;
        /* Espacio para el header fijo */
        padding-bottom: 40px;
    }

    .first-text {
        margin-top: 100px;
    }

    .mx-auto {
        padding-top: 50px;
        padding-bottom: 60px;
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Forzar colapso de grids y flex que no tengan la clase específica */
    /* Forzar colapso de grids y flex que no tengan la clase específica */
    .grid {
        grid-template-columns: 1fr !important;
        /* Una sola columna */
    }

    /* Ajuste de padding en secciones */
    .py-16 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    /* Formulario ocupa todo el ancho */
    .formulario input {
        width: 100%;
    }

    /* Alinear iconos de contacto y texto */
    .info-item {
        flex-direction: row;
        align-items: center;
    }

    /* Footer en columna */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .social-icons {
        justify-content: center;
        margin-top: 15px;
    }

    /* Reducir tamaño del logo en móvil si es necesario */
    #logo {
        width: 80px;
    }

    .header-container {
        gap: 1rem !important;
        /* Reducir gap masivo de 100px */
    }

    h1 {
        font-size: 2.2em !important;
    }

    h2 {
        font-size: 1.8em !important;
    }

    h3 {
        font-size: 1.4em !important;
    }

    p,
    .introduction {
        font-size: 1em !important;
    }

    .valores {
        width: 100%;
        max-width: 100%;
    }

    .valores div {
        overflow-wrap: break-word;
        /* Ensure long words don't overflow */
        word-break: break-word;
    }

    #whyus img {
        margin-left: 0px;
        width: 100%;
        margin-top:0;
    }

    #about-content img{
        width: 100%;
    }

}

#mobile-menu-btn {
    width: 30px;
    height: 30px;
}



#mobile-menu a {
    font-weight: 600;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.object-contain {
    object-fit: contain;
}

#about-content {
    display: flex;
    gap: 80px;
    align-items: center;
    justify-content: center;
    margin-bottom: 60px;
}

#about h2 {
    text-align: center;
    margin-bottom: 40px;
}


#about-content p {
    color: white;
}

#valores {
    margin-bottom: 30px;
    gap: 10px
}

#compromiso {
    border-radius: 1rem;

}

#compromiso p {
    text-align: justify;

}

#whyus .container p {
    margin-bottom: 20px;
}

/* =========================================
   8. EFECTO IMAGENES EN PILA (STACKED IMAGES)
   ========================================= */

:root {
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --light-color: #f8f9fa;
}

.products-images {
    position: relative;
    width: 100%;
    /* Ajuste de altura dinámica o fija según necesidad, 
       pero para que absolute funcione bien dentro, necesitamos altura min.
       Usaremos la misma altura que tenían las imágenes aproximadamente. */
    min-height: 400px;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width:768px){

    .image-stack {
    position: relative;
    }

}

.image-stack {
    height: 100%;
    min-height: 400px;
    /* Asegurar espacio */
}

.stacked-image {
    position: absolute;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    object-fit: cover;
}

.stacked-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stacked-image.main-image {
    top: 50%;
    left: 90%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.stacked-image.back-image {

    z-index: 1;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-primary);
    /* Usando var existente */
}

/* Posiciones iniciales (más juntas o escondidas) */
.stacked-image.back-image.image-1 {
    top: 50%;
    left: 90%;
    transform: translate(-50%, -50%) rotate(-5deg);
    z-index: 5;
}

.products-images:hover .stacked-image.main-image {
  transform: translate(-95%, -50%) rotate(10deg);
    /* Se mueve arriba-derecha */
}


@media(min-width:1200px){
    /* Efecto HOVER: Se expanden */
    .products-images:hover .stacked-image.back-image.image-1 {
        transform: translate(5%, -50%) rotate(-10deg);
        /* Se mueve arriba-izquierda */
    }

}


/* Ajustes Mobile */
@media (max-width: 768px) {
    .products-images {
        min-height: 300px;
    }

    .stacked-image.main-image {
        width: 90%;
        height: 90%;
        left:50%;
    }

    .stacked-image.back-image {
        width: 70%;
        height: 70%;
    }

    .stacked-image.back-image.image-1{
        display: none;
    }

}

/* =========================================
   9. MODALES DE NOTIFICACIÓN
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    padding: 1rem;
}

.modal-box {
    background-color: var(--color-background);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 450px;
    width: 100%;
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--color-border);
}

.modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
}

.modal-icon svg {
    width: 40px;
    height: 40px;
}

.modal-icon.success {
    background-color: #d1fae5; /* Verde muy claro */
    color: #059669; /* Verde oscuro */
}

.modal-icon.error {
    background-color: #fee2e2; /* Rojo muy claro */
    color: #dc2626; /* Rojo oscuro */
}

.modal-title {
    font-family: var(--font-headline);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary-foreground);
    margin-bottom: 0.5rem;
}

.modal-text {
    color: var(--color-muted-foreground);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 3rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s;
}

.modal-btn.success {
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
}

.modal-btn.success:hover {
    background-color: #4a0506; /* Un tono más oscuro que tu primary */
}

.modal-btn.error {
    background-color: var(--color-accent);
    color: var(--color-accent-foreground);
}

.modal-btn.error:hover {
    background-color: #3b3b39;
}