/* ==========================================================================
   MEJORAS NACE MULTIMEDIAL - Versión completa y definitiva
   Uso: Linkear DESPUÉS de layout.css
   ========================================================================== */

/* ==========================================================================
   0. FIX BANDA NEGRA LATERAL + GLOBALES
   ========================================================================== */

html, body {
    background-color: #FFFFFF !important;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

.wrapper {
    width: 100%;
    max-width: 100%;
    display: block;
    position: relative;
}

.wrapper.bgded,
.wrapper.overlay {
    background-color: #141414;
}

.row2, .row3,
.fondoblancp {
    background-color: #FFFFFF !important;
}

html { scroll-behavior: smooth; }

*, *::before, *::after {
    transition:
        background-color .3s ease,
        color .3s ease,
        border-color .3s ease,
        opacity .3s ease;
}

/* ==========================================================================
   1. SCROLL REVEAL
   ========================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s cubic-bezier(0.2, 0, 0, 1),
                transform 0.9s cubic-bezier(0.2, 0, 0, 1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left  { transform: translateX(-50px); }
.reveal-right { transform: translateX(50px); }
.reveal-scale { transform: scale(0.92); }
.reveal-fade  { transform: none; }

.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-scale.is-visible,
.reveal-fade.is-visible {
    transform: none;
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal-left, .reveal-right, .reveal-scale {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    html { scroll-behavior: auto; }
}

/* ==========================================================================
   2. HERO - Ken Burns + entrada de texto
   ========================================================================== */

.bgded.overlay {
    position: relative;
    overflow: hidden;
}

.bgded.overlay::before {
    content: "";
    position: absolute;
    inset: -6%;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    animation: kenburns 28s ease-in-out infinite alternate;
    z-index: 0;
    will-change: transform;
    pointer-events: none;
}

.bgded.overlay::after { z-index: 1 !important; }

.bgded.overlay > * {
    position: relative;
    z-index: 2;
}

@keyframes kenburns {
    0%   { transform: scale(1)    translate(0, 0); }
    100% { transform: scale(1.10) translate(-1.5%, -1.5%); }
}

#pageintro .heading { animation: heroTitleIn 1.1s cubic-bezier(0.2, 0, 0, 1) both; }
#pageintro .subtitulo { animation: heroSubIn 1.1s cubic-bezier(0.2, 0, 0, 1) 0.25s both; }
#pageintro footer { animation: heroFooterIn 1.1s cubic-bezier(0.2, 0, 0, 1) 0.5s both; }

@keyframes heroTitleIn {
    from { opacity: 0; transform: translateY(35px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes heroSubIn {
    from { opacity: 0; transform: translateY(25px); letter-spacing: 14px; }
    to   { opacity: 1; transform: translateY(0);   letter-spacing: 6px; }
}
@keyframes heroFooterIn {
    from { opacity: 0; transform: translateY(25px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   3. MENÚ animado
   ========================================================================== */

.wrapper.row1 { animation: menuSlideDown 0.8s cubic-bezier(0.2, 0, 0, 1) both; }

@keyframes menuSlideDown {
    from { opacity: 0; transform: translateY(-25px); }
    to   { opacity: 1; transform: translateY(0); }
}

#mainav > ul.clear > li { animation: menuItemIn 0.6s cubic-bezier(0.2, 0, 0, 1) both; }
#mainav > ul.clear > li:nth-child(1) { animation-delay: 0.15s; }
#mainav > ul.clear > li:nth-child(2) { animation-delay: 0.20s; }
#mainav > ul.clear > li:nth-child(3) { animation-delay: 0.25s; }
#mainav > ul.clear > li:nth-child(4) { animation-delay: 0.30s; }
#mainav > ul.clear > li:nth-child(5) { animation-delay: 0.35s; }
#mainav > ul.clear > li:nth-child(6) { animation-delay: 0.40s; }

@keyframes menuItemIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

#mainav > ul.clear > li > ul {
    transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.28s ease;
    transform: translateY(-6px);
}

#mainav li:hover > ul,
#mainav li:focus-within > ul,
#mainav li.open > ul { transform: translateY(0); }

/* ==========================================================================
   4. BOTONES
   ========================================================================== */

.btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1),
                box-shadow 0.35s ease,
                background-color 0.3s ease,
                color 0.3s ease;
    will-change: transform;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    transition: left 0.7s ease;
    pointer-events: none;
}

.btn:hover::before { left: 100%; }

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -8px rgba(30, 183, 241, 0.55);
}

.btn:active { transform: translateY(-1px) scale(0.98); }

@keyframes rippleAnim { to { transform: scale(2.5); opacity: 0; } }

/* ==========================================================================
   5. ICONOS DE SERVICIOS
   ========================================================================== */

.nospace.group.center article .icon {
    animation: floatIcon 4.5s ease-in-out infinite;
    will-change: transform;
}

.nospace.group.center li:nth-child(1) article .icon { animation-delay: 0s; }
.nospace.group.center li:nth-child(2) article .icon { animation-delay: 0.6s; }
.nospace.group.center li:nth-child(3) article .icon { animation-delay: 1.2s; }
.nospace.group.center li:nth-child(4) article .icon { animation-delay: 1.8s; }

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

.nospace.group.center article:hover .icon { animation-play-state: paused; }

.nospace.group.center article p a {
    display: inline-block;
    font-weight: 700;
    transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1), color 0.3s ease;
}

.nospace.group.center article p a:hover {
    transform: translateX(6px);
    color: #1eb7f1;
}

/* ==========================================================================
   6. TÍTULOS DE SECCIÓN
   ========================================================================== */

.sectiontitle .heading::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    margin: 16px auto 0;
    background: linear-gradient(90deg, #1eb7f1, #316573);
    border-radius: 3px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.9s cubic-bezier(0.2, 0, 0, 1) 0.2s;
}

.sectiontitle.is-visible .heading::after { transform: scaleX(1); }

/* ==========================================================================
   7. PORTFOLIO - Overlay al hover
   ========================================================================== */

.group.latest article figure {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    isolation: isolate;
}

.group.latest article figure::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(30, 183, 241, 0.45) 0%,
        rgba(30, 183, 241, 0.10) 40%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
    border-radius: 16px;
    z-index: 2;
}

.group.latest article figure:hover::after { opacity: 1; }

.group.latest article figure img {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */

#ctdetails a,
#footer nav a {
    position: relative;
    text-decoration: none;
    transition: color 0.3s ease;
}

#ctdetails a::after,
#footer nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 2px;
    background: #1eb7f1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1);
}

#ctdetails a:hover::after,
#footer nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

#ctdetails li i {
    transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1), color 0.3s ease;
}

#ctdetails li:hover i {
    transform: scale(1.12) translateY(-2px);
    color: #1eb7f1;
}

/* ==========================================================================
   9. BOTÓN FLOTANTE WHATSAPP
   ========================================================================== */

a.whatsapp-float,
a.whatsapp-float:link,
a.whatsapp-float:visited,
a.whatsapp-float:hover,
a.whatsapp-float:active,
a.whatsapp-float:focus {
    position: fixed !important;
    bottom: 25px !important;
    right: 25px !important;
    top: auto !important;
    left: auto !important;
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    background: #25D366 !important;
    color: #FFFFFF !important;
    border-radius: 50% !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 32px !important;
    line-height: 1 !important;
    text-decoration: none !important;
    text-align: center !important;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.45) !important;
    z-index: 99999 !important;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1),
                box-shadow 0.3s ease,
                background-color 0.3s ease !important;
    animation: waPulse 3s ease-in-out infinite !important;
    overflow: visible !important;
}

a.whatsapp-float:hover {
    background: #1EBE5A !important;
    transform: scale(1.1) translateY(-3px) !important;
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.6) !important;
    color: #FFFFFF !important;
}

a.whatsapp-float i,
a.whatsapp-float i::before {
    font-size: 32px !important;
    line-height: 1 !important;
    color: #FFFFFF !important;
    background: transparent !important;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

a.whatsapp-float::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    border-radius: 50% !important;
    background: #25D366 !important;
    animation: waRing 2.5s ease-out infinite !important;
    z-index: -1 !important;
    pointer-events: none !important;
    display: block !important;
}

a.whatsapp-float::after {
    display: none !important;
    content: none !important;
}

@keyframes waPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

@keyframes waRing {
    0%   { transform: scale(1);   opacity: 0.6; }
    80%  { transform: scale(1.7); opacity: 0; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* ==========================================================================
   10. LISTAS DE CHECK
   ========================================================================== */

.split section .fa-ul > li {
    opacity: 0;
    transform: translateX(-15px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0, 0, 1);
}

.split section.is-visible .fa-ul > li {
    opacity: 1;
    transform: translateX(0);
}

.split section.is-visible .fa-ul > li:nth-child(1) { transition-delay: 0.15s; }
.split section.is-visible .fa-ul > li:nth-child(2) { transition-delay: 0.25s; }
.split section.is-visible .fa-ul > li:nth-child(3) { transition-delay: 0.35s; }
.split section.is-visible .fa-ul > li:nth-child(4) { transition-delay: 0.45s; }
.split section.is-visible .fa-ul > li:nth-child(5) { transition-delay: 0.55s; }
.split section.is-visible .fa-ul > li:nth-child(6) { transition-delay: 0.65s; }

/* ==========================================================================
   11. FIX BANDA NEGRA EN .split
   ========================================================================== */

.split section {
    position: relative;
    z-index: 2;
}

.split section::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    right: -100vw;
    width: 200vw;
    background-color: inherit;
    z-index: -1;
    pointer-events: none;
}

/* ==========================================================================
   12. RESPONSIVE
   ========================================================================== */

@media screen and (max-width: 768px) {
    #pageintro .heading { animation-duration: 0.8s; }
    .bgded.overlay::before { animation-duration: 40s; }
    .reveal { transform: translateY(20px); }
    .reveal-left  { transform: translateX(-25px); }
    .reveal-right { transform: translateX(25px); }
}

@media screen and (max-width: 480px) {
    a.whatsapp-float {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
        font-size: 28px !important;
        bottom: 18px !important;
        right: 18px !important;
    }
    a.whatsapp-float i,
    a.whatsapp-float i::before { font-size: 28px !important; }
}

/* ==========================================================================
   13. FIX - Evitar conflicto con el menú
   ========================================================================== */

#mainav form * { transition: none !important; }

#mainav a,
#mainav li {
    transition: background-color .3s ease, color .3s ease, transform .3s ease !important;
}

/* ==========================================================================
   14. FORMULARIO DE CONTACTO - Estilo MACMA (siempre visible)
   ========================================================================== */

.contacto-wrapper {
    background: linear-gradient(180deg, #FFFFFF 0%, #F7FAFD 100%) !important;
    padding: 70px 0 90px 0;
}

.contacto-form-wrap {
    max-width: 720px;
    margin: 0 auto;
    opacity: 1;
}

.contacto-form {
    background: #FFFFFF;
    padding: 45px 45px 35px 45px;
    border-radius: 24px;
    box-shadow: 0 25px 60px -25px rgba(30, 183, 241, 0.30),
                0 10px 25px -15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 183, 241, 0.10);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.form-group .req { color: #1eb7f1; font-weight: 700; }

.form-group .opcional {
    color: #999;
    font-weight: 400;
    font-size: 12px;
}

.contacto-form input[type="text"],
.contacto-form input[type="email"],
.contacto-form input[type="tel"],
.contacto-form input[type="number"],
.contacto-form select,
.contacto-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #E3E9EF;
    border-radius: 14px;
    background: #FAFCFE;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #2d2d2d;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    box-sizing: border-box;
}

.contacto-form input::placeholder,
.contacto-form textarea::placeholder {
    color: #A8B2BD;
}

.contacto-form input:focus,
.contacto-form select:focus,
.contacto-form textarea:focus {
    outline: none;
    border-color: #1eb7f1;
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(30, 183, 241, 0.12);
}

.contacto-form textarea {
    resize: vertical;
    min-height: 130px;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #e74c3c;
    background: #FFF6F5;
}

.form-group.has-error input:focus,
.form-group.has-error select:focus,
.form-group.has-error textarea:focus {
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.12);
}

.error-msg {
    display: block;
    font-size: 12.5px;
    color: #e74c3c;
    margin-top: 6px;
    min-height: 14px;
    font-weight: 500;
}

/* CAPTCHA */
.captcha-group .captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.captcha-question {
    background: linear-gradient(135deg, #E6F4FD 0%, #D6EDFB 100%);
    color: #1a5a7a;
    font-weight: 700;
    font-size: 18px;
    padding: 12px 22px;
    border-radius: 14px;
    letter-spacing: 1.5px;
    user-select: none;
    font-family: 'Inter', monospace;
    border: 1.5px solid rgba(30, 183, 241, 0.25);
    min-width: 100px;
    text-align: center;
}

.captcha-equal {
    font-size: 20px;
    color: #999;
    font-weight: 700;
}

.captcha-row input[type="number"] {
    width: 120px !important;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
}

.captcha-refresh {
    background: #FFFFFF;
    border: 1.5px solid #E3E9EF;
    color: #1eb7f1;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    padding: 0;
}

.captcha-refresh:hover {
    background: #1eb7f1;
    color: #FFFFFF;
    border-color: #1eb7f1;
    transform: rotate(180deg);
}

.captcha-refresh i { font-size: 16px; }

.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.form-actions .btn {
    cursor: pointer;
    border: none;
    font-size: 16px;
    padding: 15px 45px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 14px;
}

.form-status {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 14.5px;
    font-weight: 500;
    display: none;
    text-align: center;
}

.form-status.is-success {
    display: block;
    background: #E7F9EE;
    color: #1a7a3e;
    border: 1px solid #B8E6C8;
}

.form-status.is-error {
    display: block;
    background: #FDECEA;
    color: #c0392b;
    border: 1px solid #F5C6C0;
}

.btn.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn.is-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-left: 8px;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media screen and (max-width: 650px) {
    .contacto-form { padding: 28px 22px 22px 22px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .captcha-group .captcha-row { gap: 8px; }
    .captcha-row input[type="number"] { width: 90px !important; }
    .form-actions .btn { width: 100%; justify-content: center; }
}
/* Interior pages, footer and accessible motion */
#breadcrumb .heading { animation: heroTitleIn .85s ease both; }
#breadcrumb .subtitulo { animation: heroSubIn .85s ease .15s both; }
.contact-strip #footer.site-footer { display:block; padding:12px 0 18px; margin:0 auto; border-top:1px solid rgba(255,255,255,.22); background:transparent; text-align:center; }
.contact-strip #footer.site-footer small { color:#e8f1f6; font:400 12px/1.4 Inter,sans-serif; }
.contact-strip #ctdetails { padding-top:30px; padding-bottom:24px; }
.contact-strip #ctdetails li { overflow-wrap:anywhere; }
#mainav li.open > ul { visibility:visible; opacity:1; }
@media(prefers-reduced-motion:reduce) {
  .wrapper.row1, #mainav > ul.clear > li, #pageintro .heading, #pageintro .subtitulo,
  #pageintro footer, #breadcrumb .heading, #breadcrumb .subtitulo, .bgded.overlay::before,
  a.whatsapp-float, a.whatsapp-float::before { animation:none !important; }
}
