/* ================= RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================= THEME ================= */
:root{
    --bg: #0b1220;
    --brandbar: #0b1f2d; /* fondo del logo */
    --surface: rgba(15, 23, 42, 0.72);
    --surface-2: rgba(2, 6, 23, 0.70);
    --card: rgba(15, 23, 42, 0.85);
    --text: #e5e7eb;
    --muted: #a7b3c7;
    --line: rgba(148, 163, 184, 0.18);
    --accent: #fbbf24; /* dorado */
    --accent-2: #38bdf8; /* cyan existente */
    --shadow: 0 18px 45px rgba(0,0,0,0.45);
    --shadow-soft: 0 10px 25px rgba(0,0,0,0.28);
}

/* Evita desbordes horizontales por elementos posicionados fuera del viewport */
html {
    overflow-x: hidden;
}

/* ================= BODY ================= */
body {
    font-family: "Manrope", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
    background: radial-gradient(1200px 650px at 20% -10%, rgba(56, 189, 248, 0.10), transparent 55%),
                radial-gradient(900px 520px at 80% 10%, rgba(251, 191, 36, 0.10), transparent 55%),
                var(--bg);
    color: var(--text);
    overflow-x: hidden;
    max-width: 100%;
}

/* Links */
a{ color: inherit; }

/* Headings */
h1,h2,h3{
    font-family: "Playfair Display", Georgia, serif;
    letter-spacing: -0.02em;
}

/* ================= HEADER ================= */
.header {
    position: relative;
    background: var(--brandbar);
    border-bottom: 1px solid var(--line);
    padding: 16px 20px;
}

.logo-header {
    max-width: min(520px, 85vw);
    display: block;
    margin: 0 auto;
}

/* Header layout w/ navigation */
.header-inner{
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.logo-link{
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo-link .logo-header{
    margin: 0;
    max-width: 290px;
}

.nav{
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav a{
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: rgba(229, 231, 235, 0.82);
    padding: 10px 10px;
    border-radius: 12px;
    transition: 0.25s;
    border: 1px solid transparent;
}

.nav a:hover{
    color: rgba(229, 231, 235, 0.95);
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.35);
}

.header-cta{
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 13px;
    color: #0b1220;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.95), rgba(251, 191, 36, 0.75));
    border: 1px solid rgba(251, 191, 36, 0.35);
    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
    white-space: nowrap;
}

.header-cta:hover{ filter: brightness(1.04); transform: translateY(-1px); }

/* ================= HERO ================= */
.hero {
    position: relative;
    min-height: 88vh;
    background: url("img/proyecto3.jpeg") center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 520px at 18% 20%, rgba(251, 191, 36, 0.20), transparent 60%),
        radial-gradient(1000px 600px at 70% 15%, rgba(56, 189, 248, 0.18), transparent 55%),
        linear-gradient(to bottom, rgba(2,6,23,0.68), rgba(2,6,23,0.86));
}

.hero-content {
    position: relative;
    text-align: center;
    color: white;
    max-width: 980px;
    width: 100%;
    padding: 46px 34px;
    margin: 0 auto;
    border: 1px solid rgba(148, 163, 184, 0.20);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.55), rgba(2, 6, 23, 0.35));
    border-radius: 22px;
    box-shadow: var(--shadow);
    animation: fadeUp 1s ease forwards;
}

.hero-content h2 {
    font-size: clamp(34px, 5vw, 54px);
    margin-bottom: 14px;
    line-height: 1.05;
}

.hero-content p {
    font-size: 18px;
    margin: 0 auto 26px;
    line-height: 1.6;
    color: rgba(229, 231, 235, 0.88);
    max-width: 60ch;
}

/* ================= BOTÓN ================= */
.btn {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.95), rgba(251, 191, 36, 0.75));
    color: #0b1220;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: all 0.3s ease;
    box-shadow: 0 16px 35px rgba(0,0,0,0.35);
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.04);
}

/* ================= SERVICIOS (INDEX) ================= */
.servicios {
    padding: clamp(48px, 8vw, 70px) clamp(16px, 4vw, 24px);
    text-align: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.servicios h2 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(1.35rem, 4.5vw, 2rem);
    margin-bottom: clamp(28px, 5vw, 40px);
    color: var(--text);
    padding-inline: 8px;
}

/* Grid premium (misma lógica visual de page-box) */
.servicios .grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 3vw, 18px);
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Enlaces ocupan la celda sin desbordar */
.servicios .grid > a {
    display: block;
    min-width: 0;
    max-width: 100%;
}

.card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.62));
    padding: 26px 22px;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    min-height: 168px; /* alturas uniformes */
}

.card-icon{
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    color: rgba(251, 191, 36, 0.95);
    opacity: 0.98;
    filter: drop-shadow(0 12px 22px rgba(0,0,0,0.35));
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.95), rgba(56, 189, 248, 0.85));
}

.card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(251, 191, 36, 0.16), transparent 70%);
    opacity: 0;
    transition: 0.4s;
}

.card:hover::after {
    opacity: 1;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 55px rgba(0,0,0,0.45);
    border-color: rgba(251, 191, 36, 0.22);
}

.grid a {
    text-decoration: none;
    color: inherit;
}

.card h3{
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(1rem, 3.5vw, 1.25rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.15;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

@media (max-width: 980px){
    .servicios .grid{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px){
    .servicios .grid{
        grid-template-columns: 1fr;
    }
    .card{
        min-height: 156px;
        width: 100%;
        max-width: 100%;
    }
}

/* ================= NUEVO: PLANTILLA PARA PÁGINAS INTERNAS ================= */
/* Usa estas clases en TODAS tus páginas: mantenimiento, energia, etc */

.page-hero {
    position: relative;
    height: 55vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url("img/proyecto2.jpeg") center/cover no-repeat;
}

.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 520px at 18% 20%, rgba(251, 191, 36, 0.16), transparent 60%),
        linear-gradient(to bottom, rgba(2,6,23,0.62), rgba(2,6,23,0.85));
}

.page-hero-content {
    position: relative;
    color: white;
    text-align: center;
    max-width: 800px;
    padding: 20px;
}

.page-hero-content h1 {
    font-size: clamp(26px, 6vw, 42px);
    font-family: "Playfair Display", Georgia, serif;
    margin-bottom: 10px;
}

.page-hero-content p {
    font-size: 18px;
    opacity: 0.9;
}

/* CONTENIDO */
.page-content {
    padding: clamp(40px, 8vw, 70px) clamp(16px, 8%, 96px);
    max-width: 1200px;
    margin: auto;
}

.page-content h2 {
    font-family: "Playfair Display", Georgia, serif;
    margin-bottom: 20px;
    color: var(--text);
}

.page-content p {
    line-height: 1.7;
    margin-bottom: 20px;
    color: rgba(229, 231, 235, 0.86);
}

/* BLOQUES */
.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px,1fr));
    gap: 25px;
    margin-top: 40px;
}

.page-box {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.62));
    padding: 25px;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    transition: 0.3s;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.page-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 26px 55px rgba(0,0,0,0.45);
}

/* Premium blocks (páginas internas) */
.page-box{
    position: relative;
    overflow: hidden;
}

.page-box::before{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.95), rgba(56, 189, 248, 0.85));
    opacity: 0.9;
}

.page-box-icon{
    width: 46px;
    height: 46px;
    margin: 2px auto 12px;
    color: rgba(251, 191, 36, 0.95);
    filter: drop-shadow(0 12px 22px rgba(0,0,0,0.35));
    opacity: 0.98;
}

.page-box h3{
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.page-box p{
    color: rgba(229, 231, 235, 0.78);
    line-height: 1.7;
}

.page-box-feature{
    border-color: rgba(251, 191, 36, 0.22);
    box-shadow: 0 22px 55px rgba(0,0,0,0.42);
    background: radial-gradient(700px 420px at 20% 10%, rgba(251, 191, 36, 0.10), transparent 55%),
                linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.62));
}

.page-box-feature:hover{
    transform: translateY(-7px);
    border-color: rgba(251, 191, 36, 0.30);
}

/* IMAGEN DESTACADA */
.page-img {
    width: 100%;
    border-radius: 18px;
    margin-top: 30px;
    box-shadow: var(--shadow);
}

/* ================= EXPERIENCIA ================= */
.experiencia{
    padding: clamp(64px, 10vw, 92px) clamp(16px, 5vw, 48px);
    background:
        radial-gradient(900px 520px at 18% 20%, rgba(251, 191, 36, 0.10), transparent 60%),
        radial-gradient(1000px 600px at 70% 15%, rgba(56, 189, 248, 0.10), transparent 60%),
        #020617;
    color:#fff;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.exp-header{
    text-align:center;
    max-width: 980px;
    margin:auto;
}

.exp-header h2{
    font-size: clamp(30px, 4.2vw, 44px);
    margin-bottom: 12px;
    font-weight: 800;
}

.exp-header p{
    color: rgba(229, 231, 235, 0.76);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 70ch;
    margin: 0 auto;
}

.metrics{
    margin-top: 42px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metric{
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.62));
    padding: 28px 22px;
    border-radius: 18px;
    text-align:center;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.18);
    position: relative;
    overflow: hidden;
}

.metric::before{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.95), rgba(56, 189, 248, 0.85));
    opacity: 0.95;
}

.metric:hover{
    transform: translateY(-6px);
    box-shadow: 0 26px 55px rgba(0,0,0,0.45);
    border-color: rgba(251, 191, 36, 0.22);
}

.metric-number{
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 800;
    font-size: clamp(36px, 4.2vw, 52px);
    line-height: 1;
    margin-top: 10px;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    color: rgba(251, 191, 36, 0.96);
    text-shadow: 0 18px 45px rgba(0,0,0,0.45);
}

.metric span{
    font-size: 0.95rem;
    color: rgba(229, 231, 235, 0.72);
    font-weight: 700;
    letter-spacing: 0.01em;
    display: block;
}

@media (max-width: 980px){
    .metrics{
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (max-width: 520px){
    .experiencia{ padding: clamp(56px, 12vw, 80px) clamp(14px, 4vw, 18px); }
    .metrics{ grid-template-columns: 1fr; }
    .metric{ padding: 24px 18px; }
}

/* CARRUSEL — centrado en móvil, sin scroll horizontal en la página */

/* Variable de padding para calcular el ancho del slide de forma fiable */
:root {
    --carousel-pad: clamp(48px, 12vw, 64px);
}

.carousel-container{
    margin-top: clamp(48px, 8vw, 80px);
    position: relative;
    width: 100%;
    max-width: min(1200px, 100%);
    margin-left: auto;
    margin-right: auto;
    padding-inline: var(--carousel-pad);
    box-sizing: border-box;
    overflow: hidden;
}

.carousel{
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: clamp(8px, 2vw, 16px);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.carousel::-webkit-scrollbar{
    display: none;
}

.carousel-track{
    display: flex;
    align-items: stretch;
    gap: clamp(12px, 2.5vw, 20px);
    width: max-content;
    margin-inline: auto;
    min-height: 1px;
}

.slide{
    flex: 0 0 min(430px, calc(100vw - 2 * var(--carousel-pad)));
    scroll-snap-align: center;
    width: min(430px, calc(100vw - 2 * var(--carousel-pad)));
    max-width: 100%;
    height: clamp(180px, 42vw, 320px);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

.slide img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: 0.5s;
}

.slide:hover img{
    transform: scale(1.06);
}

.slide::after{
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.slide-text{
    position: absolute;
    bottom: clamp(10px, 3vw, 15px);
    left: clamp(10px, 3vw, 15px);
    right: clamp(10px, 3vw, 15px);
    font-size: clamp(0.8rem, 2.8vw, 0.9rem);
    color: #fff;
    line-height: 1.35;
}

.carousel-btn{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(15,23,42,0.92);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, transform 0.25s ease;
    box-shadow: 0 8px 22px rgba(0,0,0,0.35);
}

.carousel-btn:hover{
    background: rgba(30, 41, 59, 0.98);
}

.carousel-btn:active{
    transform: translateY(-50%) scale(0.96);
}

.prev{
    left: clamp(6px, 2vw, 12px);
}

.next{
    right: clamp(6px, 2vw, 12px);
}

@media (max-width: 768px) {
    :root {
        --carousel-pad: clamp(40px, 11vw, 52px);
    }

    .carousel-container{
        max-width: 100%;
    }

    .slide{
        height: clamp(168px, 46vw, 240px);
    }
}

/* ================= CONTACTO ================= */
.contacto {
    padding: 60px 20px;
    text-align: center;
}

.contacto h2 {
    font-family: Georgia, serif;
    margin-bottom: 20px;
}

.contacto p {
    margin: 8px 0;
}

/* ================= FOOTER ================= */
footer {
    background: rgba(2, 6, 23, 0.85);
    color: white;
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--line);
}

/* ================= ANIMACIÓN ================= */
@keyframes fadeUp {
    from { opacity:0; transform:translateY(30px); }
    to { opacity:1; transform:translateY(0); }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .header-inner{
        justify-content: center;
    }

    .nav{
        justify-content: center;
        gap: 8px;
    }

    .logo-link .logo-header{
        max-width: 240px;
    }

    .hero-content h2 {
        font-size: 30px;
    }

    .hero-content{
        padding: clamp(28px, 6vw, 46px) clamp(18px, 5vw, 34px);
    }

    /* page-hero-content h1 ya usa clamp(), no se necesita override aquí */

    /* Cards de servicios: ancho completo de la cuadrícula (sin max-width fijo) */
    .servicios .grid > a .card {
        width: 100%;
        max-width: 100%;
    }

    .exp-header h2{
        font-size:2rem;
    }
}
/* CENTRAR TEXTO EN TARJETAS DE PÁGINAS INTERNAS */
.page-box {
    text-align: center; /* 👈 CENTRA TODO */
}

.page-box h3 {
    margin-bottom: 10px;
    text-align: center;
}

.page-box p {
    text-align: center;
}

/* ================= CONTACTO PRO ================= */
.contacto-pro {
    padding: 80px 20px;
    background: radial-gradient(900px 520px at 18% 20%, rgba(251, 191, 36, 0.10), transparent 60%),
                #020617;
    color: white;
    text-align: center;
    border-top: 1px solid var(--line);
}

.contacto-pro h2 {
    font-size: 32px;
    margin-bottom: 10px;
    font-family: "Playfair Display", Georgia, serif;
}

.contacto-sub {
    color: #94a3b8;
    margin-bottom: 50px;
}

/* GRID */
.contacto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px,1fr));
    gap: 25px;
    max-width: 1000px;
    margin: auto;
}

/* CARDS */
.contacto-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.62));
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    transition: 0.3s;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.contacto-card:hover {
    transform: translateY(-6px);
}

.contacto-card h3 {
    margin: 15px 0 10px;
}

.contacto-card p {
    color: #cbd5f5;
    font-size: 14px;
}

/* ICONOS */
.icono {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
}

/* WHATSAPP */
.whatsapp-box {
    margin-top: 50px;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: #25D366;
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    transition: 0.3s;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.btn-whatsapp:hover {
    transform: scale(1.05);
    background: #1ebe5d;
}

.icono-wsp {
    width: 22px;
}
.icono {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
    opacity: 0.9;
}

/* Iconos en tarjetas de contacto */
.contacto-card .icono{
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    color: rgba(251, 191, 36, 0.95);
    filter: drop-shadow(0 12px 22px rgba(0,0,0,0.35));
}