/**
 * Totem Integration - Modern Frontend Styles
 * Premium, card-based design with smooth animations
 */

:root {
    --totem-primary: #00A99D;
    --totem-primary-dark: #008C82;
    --totem-primary-light: #E6F7F6;
    --totem-text-main: #1A202C;
    --totem-text-secondary: #718096;
    --totem-bg-page: #F7FAFC;
    --totem-bg-card: #FFFFFF;
    --totem-border: #E2E8F0;
    --totem-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --totem-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --totem-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --totem-radius-lg: 16px;
    --totem-radius-md: 12px;
    --totem-radius-sm: 8px;
    --totem-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   RESET & LAYOUT
   =================================== */

.totem-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--totem-bg-page);
    padding: 40px 20px;
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.totem-wrapper::before,
.totem-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    opacity: 0.25;
    z-index: 0;
}

.totem-wrapper::before {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--totem-primary-light) 0%, var(--totem-primary) 100%);
    top: -300px;
    right: -200px;
    animation: wave1 20s ease-in-out infinite;
}

.totem-wrapper::after {
    width: 500px;
    height: 500px;
    background: linear-gradient(225deg, #E6F7F6 0%, var(--totem-primary-light) 100%);
    bottom: -250px;
    left: -150px;
    animation: wave2 18s ease-in-out infinite;
}

@keyframes wave1 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
    25% {
        transform: translate(30px, -20px) rotate(5deg);
        border-radius: 50% 50% 60% 40% / 50% 40% 60% 50%;
    }
    50% {
        transform: translate(-20px, 30px) rotate(-5deg);
        border-radius: 60% 40% 50% 50% / 40% 60% 50% 50%;
    }
    75% {
        transform: translate(20px, 20px) rotate(3deg);
        border-radius: 45% 55% 65% 35% / 55% 45% 55% 45%;
    }
}

@keyframes wave2 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%;
    }
    25% {
        transform: translate(-25px, 25px) rotate(-4deg);
        border-radius: 40% 60% 50% 50% / 50% 50% 40% 60%;
    }
    50% {
        transform: translate(25px, -25px) rotate(4deg);
        border-radius: 60% 40% 60% 40% / 40% 60% 50% 50%;
    }
    75% {
        transform: translate(-20px, -15px) rotate(-3deg);
        border-radius: 55% 45% 45% 55% / 50% 50% 50% 50%;
    }
}

@keyframes wave3 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        border-radius: 45% 55% 60% 40% / 50% 60% 40% 50%;
    }
    33% {
        transform: translate(20px, 30px) rotate(6deg) scale(1.05);
        border-radius: 55% 45% 50% 50% / 60% 40% 50% 50%;
    }
    66% {
        transform: translate(-25px, -20px) rotate(-6deg) scale(0.95);
        border-radius: 50% 50% 55% 45% / 45% 55% 45% 55%;
    }
}

/* Ondas decorativas extras */
.totem-wrapper .wave-decoration,
.totem-recomendacoes-modern .wave-decoration {
    content: '';
    position: absolute;
    border-radius: 45% 55% 60% 40% / 50% 60% 40% 50%;
    opacity: 0.18;
    z-index: 0;
    pointer-events: none;
}

.totem-wrapper .wave-decoration-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(180deg, var(--totem-primary) 0%, var(--totem-primary-light) 100%);
    top: 50%;
    left: -150px;
    animation: wave3 22s ease-in-out infinite;
    animation-delay: -5s;
}

.totem-wrapper .wave-decoration-2 {
    width: 350px;
    height: 350px;
    background: linear-gradient(90deg, #E6F7F6 0%, var(--totem-primary-light) 100%);
    bottom: 20%;
    right: -100px;
    animation: wave3 24s ease-in-out infinite;
    animation-delay: -10s;
}

.totem-recomendacoes-modern .wave-decoration-1 {
    width: 450px;
    height: 450px;
    background: linear-gradient(180deg, var(--totem-primary) 0%, var(--totem-primary-light) 100%);
    top: 30%;
    left: -180px;
    animation: wave3 22s ease-in-out infinite;
    animation-delay: -7s;
}

.totem-recomendacoes-modern .wave-decoration-2 {
    width: 380px;
    height: 380px;
    background: linear-gradient(90deg, #E6F7F6 0%, var(--totem-primary-light) 100%);
    bottom: 15%;
    right: -120px;
    animation: wave3 24s ease-in-out infinite;
    animation-delay: -12s;
}

/* Ondas extras apenas para recomendações */
.totem-recomendacoes-modern .wave-decoration-3 {
    width: 420px;
    height: 420px;
    background: linear-gradient(45deg, var(--totem-primary-light) 0%, #E6F7F6 100%);
    top: 50%;
    right: -160px;
    animation: wave1 26s ease-in-out infinite;
    animation-delay: -8s;
}

.totem-recomendacoes-modern .wave-decoration-4 {
    width: 360px;
    height: 360px;
    background: linear-gradient(135deg, #E6F7F6 0%, var(--totem-primary-light) 100%);
    top: 15%;
    right: 5%;
    animation: wave2 23s ease-in-out infinite;
    animation-delay: -15s;
}

.totem-recomendacoes-modern .wave-decoration-5 {
    width: 390px;
    height: 390px;
    background: linear-gradient(225deg, var(--totem-primary-light) 0%, var(--totem-primary) 50%, var(--totem-primary-light) 100%);
    bottom: 25%;
    left: 5%;
    animation: wave3 21s ease-in-out infinite;
    animation-delay: -6s;
}

.totem-recomendacoes-modern .wave-decoration-6 {
    width: 340px;
    height: 340px;
    background: linear-gradient(315deg, #E6F7F6 0%, var(--totem-primary-light) 100%);
    top: 65%;
    left: -130px;
    animation: wave1 25s ease-in-out infinite;
    animation-delay: -18s;
}

.totem-questionario-container {
    position: relative;
    z-index: 1;
}

.totem-questionario-container {
    width: 100%;
    max-width: 720px;
    background: var(--totem-bg-card);
    border-radius: var(--totem-radius-lg);
    box-shadow: var(--totem-shadow-lg);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ===================================
   HEADER & PROGRESS
   =================================== */

.totem-header-modern {
    padding: 32px 32px 24px;
    background: var(--totem-bg-card);
    border-bottom: 1px solid var(--totem-border);
}

.totem-progress-modern {
    display: flex;
    align-items: center;
    gap: 16px;
}

.totem-progress-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--totem-border);
    border-radius: 4px;
    overflow: hidden;
}

.totem-progress-fill {
    height: 100%;
    background: var(--totem-primary);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.totem-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--totem-text-secondary);
    white-space: nowrap;
}

#totem-step-current {
    color: var(--totem-primary);
}

/* ===================================
   CONTENT AREA
   =================================== */

.totem-content-area {
    padding: 32px;
    min-height: 400px;
    position: relative;
}

.totem-question-card {
    display: none;
    animation: slideUpFade 0.4s ease-out forwards;
}

.totem-question-card.active {
    display: block;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.totem-question-header {
    margin-bottom: 32px;
}

.totem-question-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--totem-text-main);
    line-height: 1.3;
    margin: 0 0 8px 0;
}

.totem-badge-multiple {
    display: inline-block;
    padding: 4px 12px;
    background: var(--totem-primary-light);
    color: var(--totem-primary-dark);
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================
   ANSWERS GRID
   =================================== */

.totem-answers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.totem-answers-grid.has-images {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.totem-answer-card {
    position: relative;
    cursor: pointer;
    display: block;
    margin: 0;
}

.totem-hidden-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.totem-card-content {
    background: var(--totem-bg-card);
    border: 2px solid var(--totem-border);
    border-radius: var(--totem-radius-md);
    padding: 16px;
    transition: var(--totem-transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.totem-answers-grid.has-images .totem-card-content {
    padding: 0;
    overflow: hidden;
}

/* Hover State */
.totem-answer-card:hover .totem-card-content {
    border-color: #CBD5E0;
    transform: translateY(-2px);
    box-shadow: var(--totem-shadow-md);
}

/* Selected State */
.totem-hidden-input:checked+.totem-card-content {
    border-color: var(--totem-primary);
    background: var(--totem-primary-light);
    box-shadow: 0 0 0 1px var(--totem-primary);
}

/* Image Styles */
.totem-card-image {
    width: 100%;
    height: 180px;
    background: #F8FAFC;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

.totem-card-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.totem-answer-card:hover .totem-card-image img {
    transform: scale(1.05);
}

/* Body Styles */
.totem-card-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.totem-answers-grid.has-images .totem-card-body {
    padding: 16px;
}

/* Checkbox Indicator */
.totem-checkbox-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid #CBD5E0;
    border-radius: 6px;
    /* Rounded square */
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
    background: #FFF;
}

.totem-hidden-input:checked+.totem-card-content .totem-checkbox-indicator {
    background: var(--totem-primary);
    border-color: var(--totem-primary);
}

.totem-hidden-input:checked+.totem-card-content .totem-checkbox-indicator::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.totem-card-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--totem-text-main);
    line-height: 1.4;
}

/* ===================================
   FOOTER NAVIGATION
   =================================== */

.totem-footer-nav {
    padding: 24px 32px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--totem-border);
    background: var(--totem-bg-card);
}

.totem-btn-modern {
    padding: 12px 24px;
    border-radius: var(--totem-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--totem-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    outline: none;
    text-decoration: none;
}

.totem-btn-primary {
    background: var(--totem-primary);
    color: #FFFFFF;
    box-shadow: 0 4px 6px rgba(0, 169, 157, 0.2);
}

.totem-btn-primary:hover {
    background: var(--totem-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0, 169, 157, 0.3);
    color: #FFFFFF;
}

.totem-btn-primary:active {
    transform: translateY(0);
}

.totem-btn-ghost {
    background: transparent;
    color: var(--totem-text-secondary);
}

.totem-btn-ghost:hover {
    background: #EDF2F7;
    color: var(--totem-text-main);
}

.totem-btn-ghost:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: transparent;
}

/* ===================================
   LOADING OVERLAY
   =================================== */

.totem-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.totem-loading-overlay.active {
    display: flex;
}

.totem-loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--totem-primary-light);
    border-top-color: var(--totem-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   TOAST NOTIFICATION
   =================================== */

.totem-toast-modern {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #2D3748;
    color: #FFF;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
}

.totem-toast-modern.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.totem-toast-modern.error {
    background: #E53E3E;
}

.totem-toast-modern.warning {
    background: #DD6B20;
}

/* ===================================
   RECOMMENDATIONS MODERN
   =================================== */

.totem-recomendacoes-modern {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--totem-bg-page);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.totem-recomendacoes-modern::before,
.totem-recomendacoes-modern::after {
    content: '';
    position: absolute;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    opacity: 0.25;
    z-index: 0;
}

.totem-recomendacoes-modern::before {
    width: 700px;
    height: 700px;
    background: linear-gradient(135deg, var(--totem-primary-light) 0%, var(--totem-primary) 100%);
    top: -350px;
    right: -250px;
    animation: wave1 20s ease-in-out infinite;
}

.totem-recomendacoes-modern::after {
    width: 600px;
    height: 600px;
    background: linear-gradient(225deg, #E6F7F6 0%, var(--totem-primary-light) 100%);
    bottom: -300px;
    left: -200px;
    animation: wave2 18s ease-in-out infinite;
}

.totem-recomendacoes-modern > * {
    position: relative;
    z-index: 1;
}

.recomendacoes-header-modern {
    text-align: center;
    margin-bottom: 60px;
}

.recomendacoes-header-modern h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--totem-text-main);
    margin: 0 0 12px 0;
}

.recomendacoes-header-modern p {
    font-size: 18px;
    color: var(--totem-text-secondary);
}

/* Category Section */
.categoria-section {
    margin-bottom: 80px;
}

.categoria-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.categoria-titulo {
    font-size: 24px;
    font-weight: 700;
    color: var(--totem-primary);
    white-space: nowrap;
    margin: 0;
}

.categoria-divider {
    flex: 1;
    height: 2px;
    background: var(--totem-border);
    border-radius: 2px;
}

/* Product Card Modern */
.produto-card-modern {
    display: flex;
    background: var(--totem-bg-card);
    border-radius: var(--totem-radius-lg);
    box-shadow: var(--totem-shadow-md);
    overflow: hidden;
    margin-bottom: 40px;
    transition: var(--totem-transition);
    border: 1px solid var(--totem-border);
}

.produto-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--totem-shadow-lg);
}

.produto-visual {
    width: 300px;
    background: #FFFFFF;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--totem-border);
    flex-shrink: 0;
    overflow: hidden;
}

.produto-img-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.produto-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.produto-nome-visual {
    font-size: 16px;
    font-weight: 600;
    color: var(--totem-text-main);
    text-align: center;
    margin: 0;
    display: none;
    /* Hidden by default, shown on mobile */
}

.produto-detalhes {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.produto-nome-detalhe {
    font-size: 24px;
    font-weight: 700;
    color: var(--totem-text-main);
    margin: 0 0 24px 0;
}

.produto-specs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.spec-item {
    font-size: 15px;
    line-height: 1.6;
    color: var(--totem-text-secondary);
}

.spec-item strong {
    color: var(--totem-primary-dark);
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.produto-actions {
    display: flex;
    gap: 16px;
    margin-top: auto;
}

/* Alternating Layout Logic */

/* Normal Layout (Image Left) - Default styles apply */

/* Inverted Layout (Image Right) */
.layout-inverted .produto-card-modern {
    flex-direction: row-reverse;
}

.layout-inverted .produto-visual {
    border-right: none;
    border-left: 1px solid var(--totem-border);
}

/* Footer */
.recomendacoes-footer-modern {
    text-align: center;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--totem-border);
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Modal Styles */
.totem-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

/* Desktop: Adicionar espaço no topo para não colar no header fixo */
@media (min-width: 769px) {
    .totem-modal {
        align-items: flex-start;
        padding-top: 100px;
    }
}

.totem-modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    color: #A0AEC0;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
    background: #FFF;
}

.modal-close:hover {
    background: #EDF2F7;
    color: #2D3748;
}

.modal-content h3 {
    margin: 0;
    padding: 24px 24px 20px;
    font-size: 20px;
    font-weight: 700;
    color: var(--totem-text-main);
    border-bottom: 1px solid var(--totem-border);
}

.modal-body-scroll {
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--totem-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-section p {
    margin: 0;
    font-size: 15px;
    color: var(--totem-text-secondary);
    line-height: 1.6;
}

.modal-dica {
    background: #FFFAF0;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #ED8936;
}

.modal-dica h4 {
    color: #ED8936;
}

/* ===================================
   EMAIL MODAL FORM
   =================================== */

.modal-email-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--totem-text-main);
    margin-bottom: 8px;
}

.form-group .required {
    color: #E53E3E;
}

.form-group .optional {
    color: var(--totem-text-secondary);
    font-weight: 400;
    font-size: 12px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--totem-border);
    border-radius: var(--totem-radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: var(--totem-transition);
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--totem-primary);
    box-shadow: 0 0 0 3px var(--totem-primary-light);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--totem-text-secondary);
    line-height: 1.4;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions .totem-btn-modern {
    flex: 1;
}

.form-loading {
    text-align: center;
    padding: 20px;
}

.form-loading .totem-loader {
    margin: 0 auto 12px;
}

.form-loading p {
    font-size: 14px;
    color: var(--totem-text-secondary);
    margin: 0;
}

.form-message {
    padding: 12px 16px;
    border-radius: var(--totem-radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

.form-message.success {
    background-color: #C6F6D5;
    color: #22543D;
    border: 2px solid #48BB78;
}

.form-message.error {
    background-color: #FED7D7;
    color: #742A2A;
    border: 2px solid #E53E3E;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .totem-recomendacoes-modern {
        padding: 16px;
    }

    .recomendacoes-header-modern h2 {
        font-size: 24px;
    }

    .recomendacoes-footer-modern {
        flex-direction: column;
    }

    .recomendacoes-footer-modern .totem-btn-modern {
        width: 100%;
    }

    .produto-card-modern,
    .layout-inverted .produto-card-modern {
        flex-direction: column;
    }

    .produto-visual,
    .layout-inverted .produto-visual {
        width: 100%;
        border-right: none;
        border-left: none;
        border-bottom: 1px solid var(--totem-border);
        padding: 0;
        min-height: 200px;
    }

    .produto-img-container {
        width: 100%;
        height: 100%;
        min-height: 200px;
    }

    .produto-nome-visual {
        display: block;
        margin-top: 12px;
    }

    .produto-nome-detalhe {
        display: none;
    }

    .produto-detalhes {
        padding: 20px;
    }

    .produto-actions {
        flex-direction: column;
    }

    .totem-btn-modern {
        width: 100%;
    }

    /* Respostas com imagens - ajuste para mobile */
    .totem-answers-grid.has-images {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .totem-answers-grid.has-images .totem-card-image {
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .totem-answers-grid.has-images .totem-card-image img {
        object-fit: contain;
        padding: 8px;
        background: #F8FAFC;
    }

    .totem-answers-grid.has-images .totem-card-body {
        padding: 10px;
    }

    .totem-answers-grid.has-images .totem-card-text {
        font-size: 13px;
        line-height: 1.3;
    }
}

@media (max-width: 640px) {
    .totem-wrapper {
        padding: 0;
        position: relative;
    }

    /* Adjust wave sizes for mobile */
    .totem-wrapper::before {
        width: 400px;
        height: 400px;
        top: -200px;
        right: -150px;
    }

    .totem-wrapper::after {
        width: 350px;
        height: 350px;
        bottom: -175px;
        left: -100px;
    }

    .totem-wrapper .wave-decoration-1 {
        width: 280px;
        height: 280px;
        left: -100px;
    }

    .totem-wrapper .wave-decoration-2 {
        width: 250px;
        height: 250px;
        right: -80px;
    }

    .totem-recomendacoes-modern::before {
        width: 450px;
        height: 450px;
        top: -225px;
        right: -180px;
    }

    .totem-recomendacoes-modern::after {
        width: 400px;
        height: 400px;
        bottom: -200px;
        left: -150px;
    }

    .totem-recomendacoes-modern .wave-decoration-1 {
        width: 300px;
        height: 300px;
        left: -120px;
    }

    .totem-recomendacoes-modern .wave-decoration-2 {
        width: 280px;
        height: 280px;
        right: -100px;
    }

    /* Ondas extras das recomendações no mobile */
    .totem-recomendacoes-modern .wave-decoration-3 {
        width: 300px;
        height: 300px;
        right: -120px;
    }

    .totem-recomendacoes-modern .wave-decoration-4 {
        width: 260px;
        height: 260px;
    }

    .totem-recomendacoes-modern .wave-decoration-5 {
        width: 280px;
        height: 280px;
    }

    .totem-recomendacoes-modern .wave-decoration-6 {
        width: 240px;
        height: 240px;
        left: -90px;
    }

    .totem-questionario-container {
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
        position: relative;
        padding-bottom: 80px;
    }

    .totem-header-modern {
        padding: 24px 20px;
    }

    .totem-content-area {
        padding: 24px 20px;
        padding-bottom: 100px;
    }

    .totem-footer-nav {
        padding: 20px;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #FFF;
        box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
        z-index: 999; /* High z-index to stay above floating buttons */
    }

    /* Estado quando os botões param de ser fixos */
    .totem-footer-nav.is-stuck {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
    }

    /* Respostas com imagens - celulares pequenos */
    .totem-answers-grid.has-images {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .totem-answers-grid.has-images .totem-card-image {
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .totem-answers-grid.has-images .totem-card-image img {
        object-fit: contain;
        padding: 6px;
        background: #F8FAFC;
    }

    .totem-answers-grid.has-images .totem-card-body {
        padding: 8px;
    }

    .totem-answers-grid.has-images .totem-card-text {
        font-size: 12px;
        line-height: 1.2;
    }

    .totem-answers-grid.has-images .totem-checkbox-indicator {
        width: 16px;
        height: 16px;
    }

    .totem-hidden-input:checked+.totem-card-content .totem-checkbox-indicator::after {
        left: 4px;
        top: 1px;
        width: 4px;
        height: 8px;
    }

    /* Hide common "back to top" floating buttons when questionnaire is active */
    body:has(.totem-questionario-container) a[href="#top"],
    body:has(.totem-questionario-container) a[href="#topo"],
    body:has(.totem-questionario-container) .back-to-top,
    body:has(.totem-questionario-container) .scroll-to-top,
    body:has(.totem-questionario-container) .scrolltop,
    body:has(.totem-questionario-container) .go-top,
    body:has(.totem-questionario-container) #back-to-top,
    body:has(.totem-questionario-container) #scroll-to-top,
    body:has(.totem-questionario-container) #wpfront-scroll-top-container {
        display: none !important;
    }
}

/* Fallback for browsers that don't support :has() */
@media (max-width: 640px) {
    .totem-questionario-container ~ #wpfront-scroll-top-container,
    #wpfront-scroll-top-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        z-index: -1 !important;
    }

    /* Extra specific selectors to override any inline styles */
    body #wpfront-scroll-top-container,
    html body #wpfront-scroll-top-container,
    div#wpfront-scroll-top-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}