/* =======================================
   ESTRUTURA GERAL DA PÁGINA
   ======================================= */
.products-page-main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* =======================================
   CARROSSEL DE BANNERS (HERO) - REFEITO
   ======================================= */
.hero-carousel-section {
    width: 100%;
    height: 90vh;
    min-height: 650px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    perspective: 2000px;
    /* Adicionado para efeito 3D */
}

.carousel-container {
    position: relative;
    width: 1000px;
    /* Largura base para o slide principal */
    height: 600px;
    /* Altura base */
    transform-style: preserve-3d;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    border-radius: 50px;
    width: 100%;
    height: 100%;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease, filter 0.6s ease;
    will-change: transform, opacity, filter;
}

.slide-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5%;
    width: 100%;
    max-width: 1400px;
}

.slide-text {
    flex: 1;
    max-width: 500px;
}

.slide-text span {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.slide-text h1 {
    font-family: var(--font-main);
    font-size: 5.5rem;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.slide-price {
    font-size: 3rem;
    font-weight: 700;

    margin-bottom: 30px;
}

.slide-text .cta-button {
    font-size: 1.3rem;
    padding: 16px 35px;
}

.slide-text .cta-button i {
    margin-left: 8px;
}

.slide-image {
    flex: 1;
    text-align: center;
}

.slide-image img {
    max-height: 550px;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.3));
    transform: scale(1) rotate(0deg);
    transition: transform 1s ease;
}

/* --- Estados dos Slides do Carrossel --- */
.carousel-slide.active {
    transform: translateX(0) scale(1);
    opacity: 1;
    z-index: 10;
    filter: blur(0);
}

.carousel-slide.prev {
    transform: translateX(-55%) scale(0.7);
    opacity: 0.4;
    z-index: 5;
    filter: blur(4px);
}

.carousel-slide.next {
    transform: translateX(55%) scale(0.7);
    opacity: 0.4;
    z-index: 5;
    filter: blur(4px);
}

/* Slides que estão fora de vista */
.carousel-slide:not(.active):not(.prev):not(.next) {
    transform: scale(0.5);
    opacity: 0;
    filter: blur(8px);
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--glasmorphism-bg);
    border: 1px solid var(--glasmorphism-border-color);
    color: var(--text-primary);
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.carousel-arrow:hover {
    transform: scale(1.1) translateY(-50%);
    background-color: var(--accent-color);
    color: white;
}

#arrowLeft {
    left: 3%;
}

#arrowRight {
    right: 3%;
}

/* =======================================
   GALERIA DE PRODUTOS
   ======================================= */
.gallery-wrapper {
    width: 100%;
    padding: 80px 5%;
    background-color: var(--products-background);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-title {
    text-align: center;
    margin-bottom: 60px;
}

.gallery-title h2 {
    font-family: var(--font-main);
    font-size: 3rem;
    color: var(--transition-color);
    margin-bottom: 15px;
}

.gallery-title p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.products-grid {
    max-width: 1280px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
}

.product-price {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--accent-color);
}

.cta-button-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cta-button-small:hover {
    background-color: var(--accent-hover);
    transform: scale(1.1);
}

.product-price-and-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

/* =======================================
   NOVO DIÁLOGO (MODAL) ANIMADO
   ======================================= */
#product-dialog,
#error-dialog {
    border: none;
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 800px;
    overflow: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    /* Estado inicial (invisível) */
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 2000;
    /* Garante que fique acima do overlay */
}

#product-dialog.open,
#error-dialog.open {
    /* Estado final (visível) */
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.dialog-content-inner {
    display: flex;
    align-items: center;
    padding: 40px;
    gap: 30px;
    position: relative;
}

#dialog-image {
    width: 300px;
    height: 300px;
    object-fit: contain;
    border-radius: 15px;
    flex-shrink: 0;
}

.dialog-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#dialog-name {
    font-family: var(--font-main);
    font-size: 2.8rem;
    margin-bottom: 10px;
}

#dialog-price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 15px;
}

#dialog-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

#dialog-link i {
    margin-left: 10px;
}


/* =======================================
   RESPONSIVIDADE
   ======================================= */
@media (max-width: 1200px) {
    .carousel-container {
        width: 80%;
    }
}


@media (max-width: 992px) {
    .hero-carousel-section {
        perspective: none;
    }

    .carousel-container {
        width: 100%;
        height: 100%;
        transform-style: flat;
    }

    /* Em telas menores, simplificamos para um slide por vez */
    .carousel-slide.prev,
    .carousel-slide.next {
        display: none;
    }

    .carousel-slide.active {
        transform: translateX(0) scale(1);
    }

    .slide-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        justify-content: center;
    }

    .slide-text {
        order: 2;
        align-items: center;
    }

    .slide-image {
        order: 1;
    }

    .slide-image img {
        max-height: 300px;
    }

    .slide-text h1 {
        font-size: 4rem;
    }

    .slide-price {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hero-carousel-section {
        height: auto;
        min-height: 90vh;
    }

    .slide-text h1 {
        font-size: 2.8rem;
    }

    .slide-price {
        font-size: 2rem;
    }

    .carousel-arrow {
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
    }

    #arrowLeft {
        left: 15px;
    }

    #arrowRight {
        right: 15px;
    }

    .dialog-content-inner {
        flex-direction: column;
        padding: 30px 20px;
        text-align: center;
    }

    .dialog-text {
        align-items: center;
    }

    #dialog-name {
        font-size: 2rem;
    }

    #dialog-price {
        font-size: 1.8rem;
    }
}