/* 
  MIP S.A. de C.V. - Modern Corporate Styles
  Unified CSS for Desktop & Mobile
*/

:root {
    /* Industrial Modern Palette */
    --primary-color: #1a2744;
    /* Deep Navy Industrial */
    --primary-hover: #24355a;
    --accent-color: #FF6B00;
    /* Safety Orange */
    --accent-hover: #e66000;

    /* Neutrals */
    --text-main: #2d2d2d;
    --text-light: #6b7280;
    /* Gray 500 */
    --text-inverse: #ffffff;
    --bg-body: #f3f4f6;
    /* Gray 100 */
    --bg-card: #ffffff;
    --bg-glass: rgba(26, 39, 68, 0.95);
    /* Navy transparent */

    /* Borders & Shadows */
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

    /* Typography */
    --font-main: 'Inter', 'Montserrat', system-ui, -apple-system, sans-serif;
    --radius-md: 6px;
    --radius-lg: 10px;
}

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary-color);
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-main);
    /* Override old white default */
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Utilities --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

/* --- Header & Navigation --- */
header {
    background-color: var(--primary-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-container img {
    height: 45px;
    width: auto;
    filter: brightness(1.2);
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-inverse);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: none;
}

@media (min-width: 992px) {
    .logo-text {
        display: block;
    }
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--text-inverse);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s;
}

nav a:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle (Simple approach, can improve later) */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* --- Hero Section --- */
#hero {
    position: relative;
    height: 90vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, rgba(26, 39, 68, 0.9) 30%, rgba(26, 39, 68, 0.4) 100%), url("../Images/Fondo.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-inverse);
    text-align: left;
}

#hero .container {
    z-index: 2;
    max-width: 900px;
    margin-left: 5%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
}

#hero h1 {
    color: var(--text-inverse);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -1px;
}

#hero p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    max-width: 600px;
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    line-height: 1.4;
}

#hero button {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    background-color: var(--accent-color);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

#hero button:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
}

@media (min-width: 768px) {
    #hero {
        text-align: left;
    }

    #hero .container {
        align-items: flex-start;
    }

    #hero h1 {
        font-size: 4rem;
    }
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-secondary {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    background-color: transparent;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid white;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--primary-color);
}

/* --- General Sections --- */
section {
    padding: 5rem 0;
}

section h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    position: relative;
    color: var(--primary-color);
}

.section-title {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.section-title p {
    color: var(--text-light);
    font-size: 1.1rem;
}

section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

/* --- Features / About Style --- */
#inicio {
    background: linear-gradient(rgba(248, 250, 252, 0.85), rgba(248, 250, 252, 0.95)), url("../Images/Fondo2.jpg");
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

#acerca {
    background: linear-gradient(rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0.9)), url("../Images/Fondo3.png");
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

#quienes-somos {
    background: linear-gradient(rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0.9)), url("../Images/Fondo4.png");
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

#inicio .texto,
#acerca .texto,
#quienes-somos .texto {
    background: transparent;
    color: var(--text-main);
    padding: 0;
}

/* Card Styles for 'Cartas' */
.carta,
.carta-acerca {
    background: rgba(255, 255, 255, 0.9);
    /* Slight transparency for glass effect */
    backdrop-filter: blur(5px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 400px;
    margin: 1rem auto;
}

.carta:hover,
.carta-acerca:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    background: white;
}

.carta h3,
.carta-acerca h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Carrusel container fixes */
.carrusel,
.carrusel-acerca {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.carrusel-content,
.carrusel-content-acerca {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Hide inactive items handled by JS .active class, 
   but we ensure the container holds space */
.carta,
.carta-acerca {
    display: none;
}

.carta.active,
.carta-acerca.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons for Carousel */
#prevBtn,
#nextBtn,
#prevBtn-acerca,
#nextBtn-acerca {
    background: rgba(255, 255, 255, 0.8);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

#prevBtn:hover,
#nextBtn:hover,
#prevBtn-acerca:hover,
#nextBtn-acerca:hover {
    background: var(--primary-color);
    color: white;
}

/* --- Services (Trabajos) --- */
#trabajos-section {
    background: linear-gradient(rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0.9)), url("../Images/Fondo5.png");
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

#trabajos-section h2,
#trabajos-section h3 {
    color: var(--primary-color);
}

#trabajos-section .container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Service List Grid */
#trabajos-section ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

#trabajos-section li {
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Carousel (Photos - Works Section) */
.carousel-container {
    position: relative;
    max-width: 1000px;
    margin: 2rem auto;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.9);
    /* Semi-transparent */
    backdrop-filter: blur(5px);
    /* Flex row for Button - Content - Button */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    /* Space for buttons */
    box-shadow: var(--shadow-lg);
}

/* The actual carousel wrapper inside the container */
.carousel {
    flex: 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
    height: 100%;
}

.carousel-item {
    display: none;
    flex-direction: column;
    background: transparent;
    /* allow container bg to show */
    width: 100%;
    /* Allow height to grow with content */
    min-height: 400px;
    height: auto;
}

@media (min-width: 768px) {
    .carousel-item {
        flex-direction: row;
        align-items: stretch;
        /* Stretch to fill height */
    }
}

.carousel-item.active {
    display: flex;
}

.carousel-item img {
    width: 100%;
    height: 300px;
    /* Fixed height for mobile */
    object-fit: cover;
}

@media (min-width: 768px) {
    .carousel-item img {
        width: 50%;
        height: auto;
        /* Let image fill the height */
        min-height: 400px;
        object-fit: cover;
    }
}

.carousel-item .text-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    /* Scroll if content is too long */
}

.carousel-item .text-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: left;
}

.carousel-item .text-content p {
    font-size: 1rem;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* Fix for Works Section List Grid inside Carousel */
.carousel-item .text-content ul {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .carousel-item .text-content ul {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Clients Section Fix --- */
#clientes {
    background: linear-gradient(rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0.9)), url("../Images/Fondo9.png");
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    text-align: center;
}

#carousel-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* Wrapper for Image + Text in Clients */
/* We need to restructure HTML slightly or use order */
/* Since we can't easily change HTML structure to wrap div+div without breaking things, 
   let's try to manage with existing structure or assume we update HTML */

#carousel-image {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#carousel-image img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-height: 400px;
    width: auto;
}

#pie-texto {
    margin-top: 1rem;
    font-style: italic;
    color: var(--text-light);
    width: 100%;
}


/* --- Quote / Form Section (Solicita Cotiza) --- */
#solicita-cotiza {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(rgba(248, 250, 252, 0.85), rgba(248, 250, 252, 0.92)), url("../Images/Fondo8.png");
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

#solicita-cotiza h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
    text-align: center;
}

form {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

form label {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: -0.5rem;
    display: block;
}

form input,
form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

form input:focus,
form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 39, 68, 0.1);
}

form button[type="submit"] {
    margin-top: 1rem;
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

form button[type="submit"]:hover {
    background: var(--primary-hover);
}

/* --- Visitanos (Map) --- */
#visitanos {
    padding: 0;
}

#visitanos .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

iframe {
    display: block;
    filter: grayscale(100%) contrast(1.2);
    /* Corporate look for map */
    transition: filter 0.3s;
}

iframe:hover {
    filter: none;
}

/* --- Contacto --- */
#contacto {
    text-align: center;
    padding: 80px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: linear-gradient(rgba(248, 250, 252, 0.85), rgba(248, 250, 252, 0.92)), url("../Images/Fondo6.png");
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    margin-top: 0;
}

#contacto .container {
    max-width: 900px;
    width: 100%;
}

#contacto h2 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.contacto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    text-align: left;
}

.direccion,
.contacto-info {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    padding: 2rem;
    color: var(--text-main);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.direccion h3,
.contacto-info h3 {
    color: var(--accent-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

#contacto p,
.contacto-info p {
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 0.4rem;
}

.contacto-info ul {
    list-style: none;
    padding: 0;
}

.contacto-info li {
    color: var(--text-main);
    padding: 0.3rem 0;
}

@media (max-width: 640px) {
    .contacto-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Floating Social Buttons --- */
.floating-social {
    position: fixed;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 15px;
    bottom: 20px;
}

.social-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.social-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.social-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.facebook-btn-pos {
    bottom: 95px;
}

/* Legacy anchor */

/* --- Card Grid for Services --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: white;
    border-top: 5px solid var(--accent-color);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.service-card .icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.service-card h3 {
    margin: 0;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-card p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* --- Footer --- */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 5rem;
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

footer a {
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

footer a:hover {
    color: white;
}

/* --- Social Buttons --- */

.whatsapp-sec {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 99999;
    /* Max z-index */
}

.facebook-sec {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    z-index: 99999;
    /* Max z-index */
}

/* Ensure container has size */
.whatsapp-btn,
.facebook-btn {
    /* Position handled inline for robustness */
    width: 60px;
    height: 60px;
}

.whatsapp-btn a,
.facebook-btn a {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.2s;
    user-select: none;
    cursor: pointer;
    -webkit-user-drag: none;
}

/* Apply hover effect to the image when anchor is hovered */
.whatsapp-btn a:hover img,
.facebook-btn a:hover img {
    transform: scale(1.1);
}

.whatsapp-btn img,
.facebook-btn img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
    background: white;
    /* Ensure visibility if transparent img */
    pointer-events: none;
    /* Let clicks pass through to anchor */
}



.whatsapp-btn img,
.facebook-btn img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    background: white;
    /* Ensure visibility if transparent img */
    display: block;
    /* Remove inline gap */
}