/* Hero Image Rotation System - CSS Isolado */

/* Container principal */
#heroImageContainer {
    perspective: 1200px;
    transform-style: preserve-3d;
    max-width: 420px;
    margin: 0 auto;
}

/* Card container - proporção mais vertical */
#imageCardContainer {
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 
        0 20px 40px rgba(30, 59, 125, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1);
    transform: rotate(-6deg);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    animation: heroFloat 6s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

#imageCardContainer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(30, 59, 125, 0.03) 0%, 
        transparent 50%, 
        rgba(30, 59, 125, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

#imageCardContainer:hover::before {
    opacity: 1;
}

#imageCardContainer:hover {
    transform: translateY(-8px) rotateX(3deg) rotateY(-3deg) scale(1.02) rotate(-6deg);
    box-shadow: 
        0 30px 60px rgba(30, 59, 125, 0.2),
        0 20px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Wrapper da imagem - proporção mais vertical */
#imageWrapper {
    position: relative;
    width: 100%;
    height: 360px; /* Aumentado para mais altura */
    border-radius: 16px;
    overflow: hidden;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

/* Imagem principal */
#heroImage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 16px;
    backface-visibility: hidden;
    transform-origin: center center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

#heroImage:hover {
    transform: scale(1.05) rotate(2deg);
}

/* Animação de flutuação */
@keyframes heroFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(-6deg); 
    }
    50% { 
        transform: translateY(-12px) rotate(-6deg); 
    }
}

/* Estados de transição da imagem */
.hero-image-transitioning {
    pointer-events: none;
}

.hero-image-fade-out {
    opacity: 0.2;
    transform: translateX(-30px) scale(0.9) rotateY(-12deg);
}

.hero-image-fade-in {
    opacity: 1;
    transform: translateX(0) scale(1) rotateY(0deg);
}

/* Indicadores */
#imageIndicators {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 30;
}

.image-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    outline: none;
    background: #C3D1FF;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    position: relative;
}

.image-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(30, 59, 125, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
}

.image-indicator:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

.image-indicator.active {
    background: #1E3B7D;
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(30, 59, 125, 0.2);
}

/* Nome do produto */
#heroProductName {
    position: absolute;
    bottom: -60px;
    right: -20px;
    transform: none;
    text-align: right;
    z-index: 30;
    transition: all 0.4s ease;
}

#heroProductName span {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    color: #1E3B7D;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 4px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(30, 59, 125, 0.1);
    white-space: nowrap;
}

/* Efeito shimmer durante transição */
.hero-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: heroShimmer 1s ease-in-out;
    pointer-events: none;
    z-index: 10;
    border-radius: 24px;
}

@keyframes heroShimmer {
    0% { 
        background-position: -200% 0; 
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% { 
        background-position: 200% 0; 
        opacity: 0;
    }
}

/* Background decorativo */
.hero-bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: rotate(6deg);
    background: linear-gradient(135deg, #E1E8FF 0%, #C3D1FF 100%);
    border-radius: 24px;
    box-shadow: 0 15px 30px rgba(30, 59, 125, 0.1);
    z-index: -1;
}

/* Responsividade aprimorada para mobile */

/* Tablet */
@media (max-width: 768px) {
    #heroImageContainer {
        max-width: 90vw;
        max-width: min(350px, 90vw);
    }
    
    #imageCardContainer {
        padding: 20px;
        border-radius: 20px;
    }
    
    #imageWrapper {
        height: 280px;
        border-radius: 12px;
    }
    
    #heroProductName span {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .image-indicator {
        width: 10px;
        height: 10px;
    }
}

/* Mobile grande */
@media (max-width: 640px) {
    #heroImageContainer {
        max-width: min(320px, 85vw);
    }
    
    #imageCardContainer {
        padding: 18px;
        animation: heroFloat 7s ease-in-out infinite; /* Mais lento */
    }
    
    #imageWrapper {
        height: 240px;
    }
    
    #imageIndicators {
        bottom: -32px;
        gap: 10px;
    }
    
    #heroProductName {
        bottom: -50px;
        right: -15px;
    }
}

/* Mobile médio */
@media (max-width: 480px) {
    #heroImageContainer {
        max-width: min(280px, 80vw);
        margin: 0 auto;
    }
    
    #imageCardContainer {
        padding: 16px;
        border-radius: 16px;
    }
    
    #imageCardContainer:hover {
        transform: translateY(-4px) scale(1.01) rotate(-6deg);
    }
    
    #imageWrapper {
        height: 220px;
        border-radius: 10px;
    }
    
    #heroImage:hover {
        transform: scale(1.02) rotate(1deg);
    }
    
    #heroProductName span {
        font-size: 12px;
        padding: 5px 10px;
        border-radius: 16px;
    }
    
    .image-indicator {
        width: 9px;
        height: 9px;
    }
    
    .image-indicator::before {
        width: 14px;
        height: 14px;
    }
}

/* Mobile pequeno */
@media (max-width: 375px) {
    #heroImageContainer {
        max-width: min(260px, 75vw);
    }
    
    #imageCardContainer {
        padding: 14px;
        border-radius: 14px;
    }
    
    #imageWrapper {
        height: 200px;
        border-radius: 8px;
    }
    
    #imageIndicators {
        bottom: -28px;
        gap: 8px;
    }
    
    #heroProductName {
        bottom: -45px;
        right: -12px;
    }
    
    #heroProductName span {
        font-size: 11px;
        padding: 4px 8px;
        white-space: nowrap;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
    }
    
    .image-indicator {
        width: 8px;
        height: 8px;
    }
}

/* Mobile extra pequeno */
@media (max-width: 320px) {
    #heroImageContainer {
        max-width: 95vw;
        max-width: min(240px, 95vw);
    }
    
    #imageCardContainer {
        padding: 12px;
        border-radius: 12px;
        animation: heroFloat 8s ease-in-out infinite; /* Ainda mais lento */
    }
    
    #imageWrapper {
        height: 180px;
    }
    
    #imageIndicators {
        bottom: -24px;
        gap: 6px;
    }
    
    #heroProductName {
        bottom: -40px;
        right: -10px;
    }
    
    #heroProductName span {
        font-size: 10px;
        padding: 3px 6px;
        max-width: 180px;
    }
    
    .image-indicator {
        width: 7px;
        height: 7px;
    }
    
    .image-indicator::before {
        width: 12px;
        height: 12px;
    }
    
    .image-indicator.active {
        transform: scale(1.2);
        box-shadow: 0 0 0 2px rgba(30, 59, 125, 0.2);
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    #heroImageContainer {
        max-width: min(280px, 40vw);
    }
    
    #imageWrapper {
        height: 200px;
    }
    
    #imageCardContainer {
        animation: none; /* Remove animação em landscape */
    }
}

/* ========== CORREÇÃO SOBREPOSIÇÃO TEXTO FLUTUANTE MOBILE ========== */

/* Ocultar o nome do produto no mobile para evitar sobreposições */
@media (max-width: 768px) {
    #heroProductName {
        display: none;
    }
}

/* Para quem quiser mostrar o nome em mobile, use esta alternativa: */
/*
@media (max-width: 768px) {
    #heroProductName {
        position: static;
        text-align: center;
        margin-top: 1rem;
        right: auto;
        bottom: auto;
        z-index: 1;
    }
    
    #heroProductName span {
        font-size: 12px;
        padding: 6px 12px;
        border-radius: 20px;
        display: inline-block;
        max-width: 200px;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }
}
*/