/**
 * Margeton Hero Slider — inspirado em Slider Revolution, mas leve e nativo
 * Animações suaves tipo "layer reveal" com controles
 */

.mg-hero-slider {
    position: relative;
    width: 100%;
    min-height: min(90vh, 750px);
    overflow: hidden;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 99px,
            rgba(16, 185, 129, 0.05) 99px,
            rgba(16, 185, 129, 0.05) 100px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 99px,
            rgba(16, 185, 129, 0.05) 99px,
            rgba(16, 185, 129, 0.05) 100px
        ),
        linear-gradient(135deg, #0a0e0d 0%, #000000 100%);
    margin-bottom: 0;
    box-shadow: inset 0 -1px 0 rgba(16, 185, 129, 0.3);
}

.mg-hero-slider::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    top: 10%;
    left: 15%;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.mg-hero-slider::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(5, 150, 105, 0.1) 0%, transparent 70%);
    bottom: 15%;
    right: 10%;
    animation: float 25s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: 1;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.mg-hero-slider__track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
    will-change: transform;
}

.mg-hero-slider__slide {
    flex: 0 0 100%;
    width: 100%;
    min-height: min(90vh, 750px);
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    background: linear-gradient(135deg, #0a0e0d 0%, #000000 100%);
}

.mg-hero-slider__slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 30% 40%, rgba(16, 185, 129, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 70% 60%, rgba(5, 150, 105, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.mg-hero-slider__slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(45deg, transparent 0%, rgba(16, 185, 129, 0.03) 50%, transparent 100%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(16, 185, 129, 0.02) 2px,
            rgba(16, 185, 129, 0.02) 4px
        );
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.mg-hero-slider__slide.active::after {
    opacity: 1;
}

.mg-hero-slider__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: 
        radial-gradient(ellipse 100% 100% at 50% 0%, rgba(16, 185, 129, 0.12) 0%, transparent 60%),
        linear-gradient(135deg, #0a0e0d 0%, #000000 100%);
}

.mg-hero-slider__bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 15% 25%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(5, 150, 105, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
    animation: shimmerEmerald 12s ease-in-out infinite;
}

@keyframes shimmerEmerald {
    0%, 100% { 
        opacity: 0.6;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.05);
    }
}

.mg-hero-slider__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.25;
    filter: grayscale(0.3) brightness(0.7) contrast(1.2) saturate(1.1);
    mix-blend-mode: luminosity;
}

/* Fallback: gradientes verde esmeralda vibrante por slide */
.mg-hero-slider__slide:nth-child(1) .mg-hero-slider__bg {
    background: 
        radial-gradient(ellipse 100% 100% at 30% 0%, rgba(16, 185, 129, 0.15) 0%, transparent 60%),
        linear-gradient(135deg, #0a0e0d 0%, #000000 100%);
}

.mg-hero-slider__slide:nth-child(2) .mg-hero-slider__bg {
    background: 
        radial-gradient(ellipse 100% 100% at 70% 0%, rgba(5, 150, 105, 0.15) 0%, transparent 60%),
        linear-gradient(135deg, #000000 0%, #0a0e0d 100%);
}

.mg-hero-slider__slide:nth-child(3) .mg-hero-slider__bg {
    background: 
        radial-gradient(ellipse 100% 100% at 50% 0%, rgba(16, 185, 129, 0.18) 0%, transparent 60%),
        linear-gradient(135deg, #0a0e0d 0%, #000000 50%, #0a0e0d 100%);
}

.mg-hero-slider__content {
    position: relative;
    z-index: 2;
    padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    color: #fff;
}

.mg-hero-slider__eyebrow {
    font-family: 'Oswald', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #10b981;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.mg-hero-slider__title {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(2.5rem, 5.5vw, 4.25rem);
    font-weight: 700;
    line-height: 1.05;
    margin: 0;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #d1fae5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 4px 20px rgba(16, 185, 129, 0.3));
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.9s ease forwards;
    animation-delay: 0.4s;
}

.mg-hero-slider__lead {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    max-width: 42ch;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.8s ease forwards;
    animation-delay: 0.7s;
}

.mg-hero-slider__lead strong {
    font-weight: 500;
    color: #10b981;
}

.mg-hero-slider__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 0.75rem;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.8s ease forwards;
    animation-delay: 1s;
}

.mg-hero-slider__actions .mg-btn {
    position: relative;
    z-index: 1;
}

.mg-hero-slider__actions .mg-btn i {
    transition: transform 0.3s;
}

.mg-hero-slider__actions .mg-btn:hover i {
    transform: translateX(3px);
}

.mg-hero-slider__visual {
    position: relative;
    min-height: 320px;
    background: 
        radial-gradient(ellipse 120% 100% at 50% 0%, rgba(16, 185, 129, 0.15) 0%, transparent 70%),
        linear-gradient(160deg, #0a0e0d 0%, #000000 100%);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 2.5rem;
    overflow: hidden;
}

.mg-hero-slider__visual-img {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.mg-hero-slider__visual-img > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    filter: grayscale(0.3) brightness(0.7) contrast(1.2);
    z-index: 0;
    mix-blend-mode: luminosity;
}

.mg-hero-slider__visual-img::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(90deg, 
            transparent 0%, 
            rgba(16, 185, 129, 0.1) 50%, 
            transparent 100%
        );
    animation: scanline 8s linear infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes scanline {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.mg-hero-slider__visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 70% 40%, rgba(16, 185, 129, 0.12) 0%, transparent 55%),
        linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(16, 185, 129, 0.03) 1px,
            rgba(16, 185, 129, 0.03) 2px
        );
    pointer-events: none;
    z-index: 1;
}

.mg-hero-slider__angle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    background: 
        linear-gradient(105deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.08) 40%, transparent 100%);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    z-index: 1;
}

.mg-hero-slider__angle::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #10b981 0%, transparent 100%);
}

.mg-hero-slider__badge,
.mg-hero-slider__images {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateX(40px);
    animation: slideInRight 1s ease forwards;
    animation-delay: 1.3s;
}

.mg-hero-slider__badge {
    padding: 1.35rem 1.65rem;
    background: 
        linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(0, 0, 0, 0.85) 100%);
    border: 1px solid rgba(16, 185, 129, 0.5);
    border-radius: 16px;
    backdrop-filter: blur(24px);
    max-width: 320px;
    position: relative;
    z-index: 2;
    box-shadow: 
        0 0 40px rgba(16, 185, 129, 0.2),
        0 10px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(16, 185, 129, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mg-hero-slider__badge::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.5), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
}

.mg-hero-slider__badge:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 0 50px rgba(16, 185, 129, 0.3),
        0 15px 50px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(16, 185, 129, 0.3);
}

.mg-hero-slider__badge strong {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #10b981;
    margin-bottom: 0.5rem;
}

.mg-hero-slider__badge span {
    font-family: 'Roboto', sans-serif;
    font-size: 0.925rem;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Imagens empilhadas (alternativa ao badge) */
.mg-hero-slider__images {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 420px;
}

.mg-hero-slider__img-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.3s, background 0.3s;
}

.mg-hero-slider__img-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(-4px);
}

.mg-hero-slider__img-card img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.35rem;
}

.mg-hero-slider__img-card span {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

/* Controles */
.mg-hero-slider__controls {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: 
        linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(0, 0, 0, 0.85) 100%);
    padding: 0.9rem 1.6rem;
    border-radius: 60px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 
        0 0 40px rgba(16, 185, 129, 0.15),
        0 10px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(16, 185, 129, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mg-hero-slider__controls:hover {
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 
        0 0 50px rgba(16, 185, 129, 0.25),
        0 15px 50px rgba(0, 0, 0, 0.7);
}

.mg-hero-slider__dots {
    display: flex;
    gap: 0.5rem;
}

.mg-hero-slider__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
    position: relative;
}

.mg-hero-slider__dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(90, 140, 115, 0.2);
    opacity: 0;
    transition: opacity 0.3s;
}

.mg-hero-slider__dot:hover {
    background: rgba(255, 255, 255, 0.65);
}

.mg-hero-slider__dot:hover::before {
    opacity: 1;
}

.mg-hero-slider__dot.active {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    width: 34px;
    border-radius: 6px;
    box-shadow: 
        0 0 20px rgba(16, 185, 129, 0.6),
        0 2px 12px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.mg-hero-slider__arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 0.95rem;
}

.mg-hero-slider__arrow:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: #000;
    transform: scale(1.15);
    box-shadow: 
        0 0 25px rgba(16, 185, 129, 0.5),
        0 6px 20px rgba(16, 185, 129, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mg-hero-slider__arrow:active {
    transform: scale(1.05);
}

/* Animações */
@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide inativo: reset animações */
.mg-hero-slider__slide:not(.active) .mg-hero-slider__eyebrow,
.mg-hero-slider__slide:not(.active) .mg-hero-slider__title,
.mg-hero-slider__slide:not(.active) .mg-hero-slider__lead,
.mg-hero-slider__slide:not(.active) .mg-hero-slider__actions,
.mg-hero-slider__slide:not(.active) .mg-hero-slider__badge,
.mg-hero-slider__slide:not(.active) .mg-hero-slider__images {
    opacity: 0;
    animation: none;
}

/* Slide ativo: trigger animações */
.mg-hero-slider__slide.active .mg-hero-slider__eyebrow {
    animation: slideInUp 0.8s ease forwards;
    animation-delay: 0.3s;
}

.mg-hero-slider__slide.active .mg-hero-slider__title {
    animation: slideInUp 0.9s ease forwards;
    animation-delay: 0.5s;
}

.mg-hero-slider__slide.active .mg-hero-slider__lead {
    animation: slideInUp 0.8s ease forwards;
    animation-delay: 0.8s;
}

.mg-hero-slider__slide.active .mg-hero-slider__actions {
    animation: slideInUp 0.8s ease forwards;
    animation-delay: 1.1s;
}

.mg-hero-slider__slide.active .mg-hero-slider__badge,
.mg-hero-slider__slide.active .mg-hero-slider__images {
    animation: slideInRight 1s ease forwards;
    animation-delay: 1.3s;
}

/* Responsivo */
@media (max-width: 900px) {
    .mg-hero-slider__slide {
        grid-template-columns: 1fr;
    }

    .mg-hero-slider__visual {
        min-height: 220px;
    }

    .mg-hero-slider__angle {
        display: none;
    }

    .mg-hero-slider__badge,
    .mg-hero-slider__images {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .mg-hero-slider__controls {
        bottom: 1rem;
        padding: 0.5rem 1rem;
    }

    .mg-hero-slider__arrow {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}
