/* ============================================================
   🎛️ COMPONENTES DE FORMULÁRIO
   ============================================================ */
.control-group { 
    margin-bottom: 18px; 
}

.control-label { 
    display: block; 
    margin-bottom: 8px; 
    font-size: 0.9rem; 
    color: #555; 
    font-weight: 600; 
}

.control-label small {
    font-weight: normal;
    color: var(--gray-color);
    font-size: 0.85rem;
}

.form-control {
    width: 100%; 
    padding: 10px 12px; 
    border: 1px solid #ced4da; 
    border-radius: var(--border-radius-sm);
    font-family: inherit; 
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
}

.form-control:focus { 
    border-color: var(--primary-color); 
    outline: none; 
    box-shadow: 0 0 0 3px rgba(58,134,255,0.1); 
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-sm);
    background: white;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(58,134,255,0.1);
}

/* ============================================================
   🎚️ CONTROLES DE RANGE (SLIDERS)
   ============================================================ */
.range-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 5px;
}

.range-control input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.range-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.range-value {
    min-width: 50px;
    text-align: right;
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* ============================================================
   🎨 CONTROLES DE COR
   ============================================================ */
.color-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.color-option:hover {
    background: #f0f2f5;
}

.color-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    transition: var(--transition);
}

.color-preview.active {
    border-color: var(--dark-color);
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.color-name {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.color-picker-wrapper {
    width: 100%;
    height: 40px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    padding: 5px;
    background: white;
}

.color-picker-wrapper input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    cursor: pointer;
    background: transparent;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

/* Melhor compatibilidade (Chrome/Safari/Edge) */
.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

/* Firefox */
.color-picker-wrapper input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}

/* ============================================================
   📐 GRID DE POSIÇÃO
   ============================================================ */
.position-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 8px; 
    margin-top: 8px;
}

.position-btn {
    padding: 12px 8px; 
    border: 1px solid #dee2e6; 
    background: white; 
    border-radius: var(--border-radius-sm); 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.position-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

.position-btn.active { 
    background: var(--primary-color); 
    color: white; 
    border-color: var(--primary-color); 
    box-shadow: 0 3px 8px rgba(58, 134, 255, 0.3);
}

/* ============================================================
   🎭 CONTROLES DE ANIMAÇÃO
   ============================================================ */
.animation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.animation-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.animation-option:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.animation-option.active {
    background: #e7f1ff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(58, 134, 255, 0.2);
}

.animation-icon {
    font-size: 1.2rem;
    margin-bottom: 6px;
    color: var(--primary-color);
}

.animation-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
}

/* ============================================================
   📋 LISTA DE HOTSPOTS
   ============================================================ */
.hotspot-item { 
    padding: 12px 15px; 
    border: 1px solid #eee; 
    margin-bottom: 8px; 
    border-radius: var(--border-radius-sm); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    background: white; 
    transition: var(--transition);
}

.hotspot-item:hover { 
    background: #f8f9fa; 
    transform: translateX(3px);
    border-color: #dee2e6;
}

.hotspot-item.active { 
    border-color: var(--primary-color); 
    background: #f0f7ff; 
    box-shadow: 0 2px 8px rgba(58, 134, 255, 0.15);
}

.item-color { 
    width: 14px; 
    height: 14px; 
    border-radius: 50%; 
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    gap: 8px;
}

/* 🔗 Vínculo Hotspot -> Marcador (somente na lista de camadas) */
.layer-link-row {
    margin-top: 8px;
}

.layer-link-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    font-size: 0.82rem;
    color: #333;
    outline: none;
}

.layer-link-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ============================================================
   🎨 CONTROLES DE BORDA
   ============================================================ */
.border-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.border-style-control {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.border-style-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    font-size: 0.85rem;
    transition: var(--transition);
}

.border-style-btn:hover {
    background: #f8f9fa;
}

.border-style-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ============================================================
   🔘 BOTÕES DE AÇÃO RÁPIDA
   ============================================================ */
.quick-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ============================================================
   🎨 GRID DE TIPO DE HOTSPOT
   ============================================================ */
.hotspot-type-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 10px; 
    margin-bottom: 20px; 
}

.hotspot-option { 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
    background: #f8f9fa; 
    border: 2px solid #e9ecef; 
    border-radius: var(--border-radius-sm); 
    cursor: pointer; 
    height: 70px; 
    transition: var(--transition);
    font-size: 1.4rem;
    padding: 8px;
}


/* ✅ Ajuste fino: tamanho visual consistente dos ícones na grade de tipos */
.hotspot-option i{
    font-size: 1.55rem;
    line-height: 1;
}
.hotspot-option[data-type="polygon"] i{
    font-size: 1.35rem;
}

.hotspot-option:hover { 
    background: #e9ecef; 
    transform: translateY(-3px); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.hotspot-option.active { 
    background: #e7f1ff; 
    border-color: var(--primary-color); 
    color: var(--primary-color); 
    box-shadow: 0 4px 12px rgba(58, 134, 255, 0.25); 
}

.hotspot-option-label {
    font-size: 0.7rem;
    margin-top: 4px;
    font-weight: 600;
}

/* ============================================================
   🎪 ÁREA DO CANVAS
   ============================================================ */
.canvas-area {

    flex: 1; 
    min-width: 0; /* ✅ permite o centro encolher sem esmagar as sidebars */
    background: #eef2f6; 
    display: flex; 
    flex-direction: column; 
    position: relative;
    background-image: 
        linear-gradient(45deg, #e0e0e0 25%, transparent 25%), 
        linear-gradient(-45deg, #e0e0e0 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #e0e0e0 75%), 
        linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.canvas-header { 
    height: 60px; 
    background: white; 
    border-bottom: 1px solid #e0e0e0; 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    padding: 0 25px;
}

.canvas-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    padding: 8px 18px;
    border-radius: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/*
   ✅ Scroll/zoom do canvas deve ficar restrito ao viewport interno do canvas,
   mantendo as sidebars fixas (estilo Figma/Canva).
   Então o wrapper central NÃO deve rolar; quem rola é o viewport interno criado
   no #canvas-container (ex.: #canvas-viewport).
*/
.canvas-wrapper {
 
    flex: 1; 
    min-width: 0; /* ✅ permite o centro encolher sem esmagar as sidebars */
    /* ✅ Scroll do canvas (barra embaixo e na direita) */
    overflow: auto; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 30px; 
}

/* Evita “scroll chaining” para outras áreas ao usar trackpad/mouse */
#canvas-container {
    overscroll-behavior: contain;
}

.canvas-container {
    position: relative; 
    background: white; 
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease;
    /* ✅ não deixe o flex "espremer" o canvas — senão não há overflow e o scrollbar não aparece */
    flex-shrink: 0;
}

.canvas-footer {
    height: 35px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    font-size: 0.85rem;
    color: #666;
}

.coordinates {
    display: flex;
    gap: 20px;
}

/* ============================================================
   🔴 ELEMENTOS HOTSPOT
   ============================================================ */
.hotspot-element {
    position: absolute; 
    transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg)); 
    cursor: grab; 
    z-index: 100;
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: 
        transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    user-select: none;
}

.hotspot-element:active {
    cursor: grabbing;
}

.hotspot-element:hover { 
    transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg)) scale(1.15); 
    z-index: 200; 
}

.hotspot-element.selected { 
    outline: 3px solid white; 
    box-shadow: 
        0 0 0 3px var(--primary-color),
        0 8px 25px rgba(58, 134, 255, 0.4); 
    z-index: 300; 
}

/* Formas de Hotspot */
.hotspot-element.circle { 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    background: var(--primary-color); 
}

.hotspot-element.rectangle { 
    border-radius: 8px; 
    width: 45px; 
    height: 35px; 
    background: var(--primary-color); 
}



.hotspot-element.custom {
    border-radius: 12px;
    padding: 10px 15px;
    min-width: 60px;
    height: auto;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-align: center;
    line-height: 1.2;
}


/* ============================================================
   🏷️ MARCADOR (SEM HINT)
   ============================================================ */
.hotspot-element.marker{
    border-radius: 999px;
    padding: 8px 12px;
    min-width: 60px;
    height: auto;
    font-size: 13px;
    font-weight: 700;
    color: white;
    text-align: center;
    line-height: 1.2;
}
.hotspot-element.marker:hover{
    /* Sem animação por padrão: respeita o toggle do marcador */
    transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg));
}
.hotspot-element.marker.marker-hover-anim:hover{
    transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg)) scale(1.08);
}
.hotspot-element.marker .marker-text{
    pointer-events: none;
    white-space: nowrap;
}

.hotspot-element.marker .marker-content{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* espaço entre ícone e texto */
}
.hotspot-element.marker .marker-icon{
    flex: 0 0 auto;
    pointer-events: none;
    line-height: 1;
}
.hotspot-element.marker.marker-icon-right .marker-content{
    flex-direction: row-reverse;
}


/* ============================================================
   💡 HINTS / TOOLTIPS
   ============================================================ */
.hotspot-hint {
    position: absolute;
    /* ✅ Variáveis (setadas via JS): --hint-bg, --hint-opacity, --hint-font-size, --hint-arrow-color */
    background: var(--hint-bg, linear-gradient(135deg, #2b303b, #1a1d24));
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: var(--hint-font-size, 13px);
    line-height: 1.5;
    width: 220px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    backdrop-filter: blur(10px);
}

/* ✅ Hint com imagem (imagem em cima, texto em baixo) */
.hotspot-hint .hint-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 0 auto 10px auto;
    max-height: 180px;
    object-fit: cover;
}

.hotspot-hint.only-image {
    padding: 10px;
}

.hotspot-hint.only-image .hint-image {
    margin-bottom: 0;
}

.hotspot-hint .hint-text {
    width: 100%;
    word-break: break-word;
}

.hotspot-element:hover .hotspot-hint {
    opacity: var(--hint-opacity, 1);
    visibility: visible;
}

/* 🔗 Forçar hint visível quando o hotspot estiver sendo controlado por um Marcador */
.hotspot-element.force-hint .hotspot-hint {
    opacity: var(--hint-opacity, 1);
    visibility: visible;
}

.hotspot-element.force-hint .hotspot-hint.top {
    transform: translateX(-50%) translateY(0);
}
.hotspot-element.force-hint .hotspot-hint.right {
    transform: translateY(-50%) translateX(0);
}
.hotspot-element.force-hint .hotspot-hint.bottom {
    transform: translateX(-50%) translateY(0);
}
.hotspot-element.force-hint .hotspot-hint.left {
    transform: translateY(-50%) translateX(0);
}


/* Posições da Setinha do Hint */
.hotspot-hint.top { 
    bottom: 130%; 
    left: 50%; 
    transform: translateX(-50%) translateY(15px); 
}

.hotspot-element:hover .hotspot-hint.top { 
    transform: translateX(-50%) translateY(0); 
}

.hotspot-hint.top::after { 
    content:''; 
    position: absolute; 
    top: 100%; 
    left: 50%; 
    margin-left: -8px; 
    border-width: 8px; 
    border-style: solid; 
    border-color: var(--hint-arrow-color, #2b303b) transparent transparent transparent; 
}

.hotspot-hint.right { 
    left: 130%; 
    top: 50%; 
    transform: translateY(-50%) translateX(-15px); 
}

.hotspot-element:hover .hotspot-hint.right { 
    transform: translateY(-50%) translateX(0); 
}

.hotspot-hint.right::after { 
    content:''; 
    position: absolute; 
    right: 100%; 
    top: 50%; 
    margin-top: -8px; 
    border-width: 8px; 
    border-style: solid; 
    border-color: transparent var(--hint-arrow-color, #2b303b) transparent transparent; 
}

.hotspot-hint.bottom { 
    top: 130%; 
    left: 50%; 
    transform: translateX(-50%) translateY(-15px); 
}

.hotspot-element:hover .hotspot-hint.bottom { 
    transform: translateX(-50%) translateY(0); 
}

.hotspot-hint.bottom::after { 
    content:''; 
    position: absolute; 
    bottom: 100%; 
    left: 50%; 
    margin-left: -8px; 
    border-width: 8px; 
    border-style: solid; 
    border-color: transparent transparent var(--hint-arrow-color, #2b303b) transparent; 
}

.hotspot-hint.left { 
    right: 130%; 
    top: 50%; 
    transform: translateY(-50%) translateX(15px); 
}

.hotspot-element:hover .hotspot-hint.left { 
    transform: translateY(-50%) translateX(0); 
}

.hotspot-hint.left::after { 
    content:''; 
    position: absolute; 
    left: 100%; 
    top: 50%; 
    margin-top: -8px; 
    border-width: 8px; 
    border-style: solid; 
    border-color: transparent transparent transparent var(--hint-arrow-color, #2b303b); 
}

/* ============================================================
   🎭 ANIMAÇÕES CSS PARA HOTSPOTS
   ============================================================ */
@keyframes pulse {
    0% { transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg)) scale(1); }
    50% { transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg)) scale(1.1); }
    100% { transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg)) scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg)); }
    50% { transform: translate(-50%, -60%) rotate(var(--spot-rotate, 0deg)); }
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg)); }
    to { transform: translate(-50%, -50%) rotate(calc(var(--spot-rotate, 0deg) + 360deg)); }
}
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg)); }
    25% { transform: translate(-55%, -50%); }
    75% { transform: translate(-45%, -50%); }
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg)); }
    50% { transform: translate(-50%, -55%) rotate(var(--spot-rotate, 0deg)); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 5px 15px rgba(0,0,0,0.15); }
    50% { box-shadow: 0 5px 25px var(--primary-color); }
}

/* Classes de animação aplicáveis */
.hotspot-pulse { animation: pulse 2s infinite; }
.hotspot-bounce { animation: bounce 1s infinite; }
.hotspot-spin { animation: spin 3s linear infinite; }
.hotspot-shake { animation: shake 0.5s infinite; }
.hotspot-float { animation: float 3s ease-in-out infinite; }
.hotspot-glow { animation: glow 2s infinite; }

/* ============================================================
   POLÍGONO - OVERLAY DE DESENHO (UX)
   - Linhas, preenchimento e pontos (bolinhas)
   ============================================================ */
.polygon-draft {
  overflow: visible;
}

/* nada aqui mexe no design geral; só no overlay de desenho */
#polygon-draft-line {
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.25));
}

#polygon-draft-fill {
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.18));
}

/* ============================================================
   CUSTOM - ÍCONE CENTRALIZADO (sem alterar layout global)
   ============================================================ */
.hotspot-element.custom i {
  font-size: calc(16px * var(--hs-custom-scale, 1));
  line-height: 1;
  pointer-events: none;
}




/* ============================================================
   ✅ PRO: IMAGEM NO HOTSPOT CUSTOM (fundo com drop-in)
   - Não altera estrutura do elemento
   - Não usa box-shadow (evita sombra quadrada)
   - Respeita border-radius via inherit
   ============================================================ */
.hotspot-element.custom::before{
  content:"";
  position:absolute;
  inset:0;
  background-image: var(--hs-custom-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--hs-custom-bg-opacity, 1);
  border-radius: inherit;
  pointer-events: none;
}

/* Preview do upload na aba Estilo (somente UI) */
.custom-image-preview{
  display:none;
  width:100%;
  max-height:120px;
  margin-top:10px;
  border-radius:8px;
  border:1px solid #e9ecef;
  object-fit:cover;
}
.custom-image-preview.is-visible{ display:block; }

/* ============================================================
   ✅ PRO: Handle de redimensionamento (aparece só quando selecionado)
   ============================================================ */
.hotspot-element { position: absolute; }
.hotspot-resize-handle{
  position:absolute;
  right:-6px;
  bottom:-6px;
  width:12px;
  height:12px;
  border:2px solid rgba(255,255,255,0.95);
  background: rgba(0,0,0,0.35);
  border-radius:3px;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.15);
  display:none;
  cursor:nwse-resize;
  z-index: 10;
}
.hotspot-element.selected .hotspot-resize-handle{
  display:block;
}


/* ============================================================
   POLÍGONO: Hint só quando mouse está sobre o polígono (não no bbox)
   ============================================================ */
.hotspot-element.polygon:hover .hotspot-hint {
    opacity: 0;
    visibility: hidden;
}

.hotspot-element.polygon.poly-hover .hotspot-hint {
    opacity: var(--hint-opacity, 1);
    visibility: visible;
}

/* Faz o SVG responder só na área pintada */
.hotspot-element.polygon svg {
    pointer-events: none;
}
.hotspot-element.polygon polygon {
    pointer-events: visiblePainted;
}


/* ✅ Polígono: não mostrar "frame" do container (bbox) */
.hotspot-element.polygon {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* ============================================================
   ✨ HOVER VINCULADO: realce/anim entre Marcador <-> Hotspot
   (não altera estrutura; só feedback visual)
   ============================================================ */
.hotspot-element.linked-hover {
  box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.45), 0 10px 22px rgba(0,0,0,0.18);
  transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg));
  transition: none;
}

.hotspot-element.marker.linked-hover {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55), 0 0 0 6px rgba(58, 134, 255, 0.45), 0 10px 22px rgba(0,0,0,0.18);
}

.hotspot-element.polygon.linked-hover polygon {
  filter: drop-shadow(0 0 10px rgba(58, 134, 255, 0.45));
}

/* Respeita quem já tem animação: a classe só realça, a animação é re-triggada via JS */

/* ===========================
   📍 Hotspot: PIN (pin)
   =========================== */
.hotspot-element.pin{
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3a86ff;
    transform: translate(-50%, -50%);
}

.hotspot-element.pin:hover{
    transform: translate(-50%, -50%) scale(1.15);
}

.hotspot-element.pin .pin-body{
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hotspot-element.pin .pin-body .pin-svg{
    width: 100%;
    height: 100%;
    display: block;
}

.hotspot-element.pin .pin-body .pin-shape{
    fill: var(--pin-fill, currentColor);
    stroke: var(--pin-stroke, #ffffff);
    stroke-width: var(--pin-stroke-w, 0px);
    stroke-linejoin: round;
    stroke-linecap: round;
}

.hotspot-element.pin .pin-body .pin-hole{
    fill: transparent;
    stroke: var(--pin-stroke, #ffffff);
    stroke-width: var(--pin-hole-stroke-w, var(--pin-stroke-w, 0px));
}


/* ===========================
   ➤ Hotspot: SETA (arrow)
   =========================== */
.hotspot-element.arrow{
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: #3a86ff;
    /* Garantir que a rotação seja aplicada */
    transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg));
}

.hotspot-element.arrow:hover {
    /* Manter rotação no hover */
    transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg)) scale(1.15);
}

.hotspot-element.arrow .arrow-body{
    width: 100%;
    height: 100%;
    display: flex;
    pointer-events: none;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
}

/* ✅ Seta em 1 bloco (SVG) com contorno */
.hotspot-element.arrow .arrow-body .arrow-svg{
    width: 100%;
    height: 100%;
    display: block;
}

.hotspot-element.arrow .arrow-body .arrow-svg .arrow-shape{
    fill: var(--arrow-fill, currentColor);
    stroke: var(--arrow-stroke, #ffffff);
    /* se borderWidth = 0, mantém sem contorno */
    stroke-width: var(--arrow-stroke-w, 0px);
    stroke-linejoin: miter;
    stroke-miterlimit: 2;
}

.hotspot-element.arrow .arrow-shaft{
    flex: 1;
    height: 40%;
    background: currentColor;
    border-radius: 999px;
    min-width: 20px;
}

.hotspot-element.arrow .arrow-head{
    width: 0;
    height: 0;
    border-top: calc(var(--arrow-h, 26px) * 0.5) solid transparent;
    border-bottom: calc(var(--arrow-h, 26px) * 0.5) solid transparent;
    border-left: calc(var(--arrow-head, 20px)) solid currentColor;
    flex-shrink: 0;
}

/* ===========================
   🔄 Handle de rotação (somente SETA)
   =========================== */
.hotspot-rotate-handle{
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.95);
  background: rgba(0,0,0,0.35);
  border-radius: 999px;
  pointer-events: auto;
  cursor: grab;
  display: none;
  z-index: 6;
}

.hotspot-element.selected .hotspot-rotate-handle{
  display: block;
}

.hotspot-rotate-handle::after{
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 2px;
  height: 10px;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.75);
  border-radius: 2px;
}

/* ============================================================
   ✏️ Edição inline de nomes (hotspots e marcadores) + Duplicar marcador
   (adições mínimas, sem quebrar o design existente)
   ============================================================ */

#duplicate-marker-btn {
    margin-top: 8px;
}

/* Nome editável (vira input no mesmo lugar) */
.item-name-editable {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: text;

    /* não esconder o ícone; a elipse fica no span */
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.item-name-editable .item-name-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-name-edit-icon {
    flex: 0 0 auto;
    font-size: 13px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: translateY(-1px);
    user-select: none;
}

.hotspot-item:hover .item-name-edit-icon {
    opacity: 0.85;
}

.item-name-editable.is-editing {
    background: rgba(58, 134, 255, 0.08);
    border-radius: 8px;
    padding: 4px 6px;
    margin-left: -6px;
    margin-right: -6px;
}

.item-name-input {
    width: 100%;
    font: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(58, 134, 255, 0.45);
    outline: none;
    box-shadow: 0 4px 12px rgba(58, 134, 255, 0.12);
    transition: all 0.15s ease;
    background: #fff;
}

.item-name-input:focus {
    border-color: rgba(58, 134, 255, 0.75);
    box-shadow: 0 6px 16px rgba(58, 134, 255, 0.18);
}

.item-name-input.name-error {
    border-color: rgba(255, 0, 84, 0.65);
    box-shadow: 0 6px 16px rgba(255, 0, 84, 0.14);
    animation: hs-name-shake 0.18s linear 0s 2;
}

@keyframes hs-name-shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}


/* ============================================================
   BOOTSTRAP-LIKE MODAL (HOTSPOT PRO)
   - Estilo inspirado no Bootstrap 5 (sem depender da lib)
   - Preserva z-index/layers do projeto
   ============================================================ */

.hs-bs-modal-root {
  position: relative;
  z-index: 99990;
}

.modal.hs-bs-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  display: block;
  padding: 1rem;
  z-index: 99992;
}

.modal.hs-bs-modal .modal-dialog {
  max-width: 520px;
  margin: 1.75rem auto;
}

.modal.hs-bs-modal .modal-content {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(20,20,22,0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.92);
}

.modal.hs-bs-modal .modal-header,
.modal.hs-bs-modal .modal-footer {
  padding: 0.9rem 1rem;
  border-color: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal.hs-bs-modal .modal-header {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.modal.hs-bs-modal .modal-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  justify-content: flex-end;
  gap: 0.6rem;
}

.modal.hs-bs-modal .modal-body {
  padding: 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.modal.hs-bs-modal .modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal.hs-bs-modal .modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.modal.hs-bs-modal .modal-title-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  font-size: 0.95rem;
}

.modal.hs-bs-modal .btn-close.hs-bs-btn-close {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal.hs-bs-modal .btn-close.hs-bs-btn-close:hover {
  background: rgba(255,255,255,0.10);
}

.modal.hs-bs-modal .btn {
  border-radius: 12px;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.modal.hs-bs-modal .btn:hover {
  background: rgba(255,255,255,0.10);
}

.modal.hs-bs-modal .btn.btn-primary {
  background: rgba(58,134,255,0.22);
  border-color: rgba(58,134,255,0.40);
}

.modal.hs-bs-modal .btn.btn-danger {
  background: rgba(255,0,84,0.18);
  border-color: rgba(255,0,84,0.38);
}

.modal.hs-bs-modal .btn.btn-secondary {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
}

.modal-backdrop.hs-bs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99991;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
}

.hs-bs-modal-message {
  white-space: pre-wrap;
}

/* ============================================================
   FIM: BOOTSTRAP-LIKE MODAL
   ============================================================ */


/* ============================================================
   BOOTSTRAP-LIKE MODAL (HOTSPOT PRO) - AJUSTE MINIMALISTA
   - Alinha com a paleta do app (tema claro)
   - Remove desfoque/embassado (backdrop-filter)
   - Mantém estrutura Bootstrap-like e z-index
   ============================================================ */

.modal-backdrop.hs-bs-backdrop {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: none;
}

.modal.hs-bs-modal .modal-content {
  background: var(--panel-bg);
  color: var(--dark-color);
  border: 1px solid var(--sidebar-border);
  box-shadow: var(--shadow-md);
  backdrop-filter: none;
}

.modal.hs-bs-modal .modal-header,
.modal.hs-bs-modal .modal-footer {
  border-color: var(--sidebar-border);
}

.modal.hs-bs-modal .modal-header {
  padding: 0.8rem 0.9rem;
  background: transparent;
}

.modal.hs-bs-modal .modal-body {
  padding: 0.9rem;
  color: var(--dark-color);
}

.modal.hs-bs-modal .modal-footer {
  padding: 0.8rem 0.9rem;
  background: transparent;
}

.modal.hs-bs-modal .modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark-color);
}

.modal.hs-bs-modal .modal-title-icon {
  background: transparent;
  box-shadow: none;
  width: 24px;
  height: 24px;
  border-radius: var(--border-radius-sm);
  font-size: 0.95rem;
}

.modal.hs-bs-modal .btn-close.hs-bs-btn-close {
  background: transparent;
  border: 1px solid var(--sidebar-border);
  color: var(--gray-color);
  width: 34px;
  height: 34px;
  border-radius: var(--border-radius-sm);
}

.modal.hs-bs-modal .btn-close.hs-bs-btn-close:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--dark-color);
}

.modal.hs-bs-modal .btn {
  background: #ffffff;
  color: var(--dark-color);
  border: 1px solid var(--sidebar-border);
  box-shadow: none;
  border-radius: var(--border-radius-sm);
  padding: 0.52rem 0.85rem;
}

.modal.hs-bs-modal .btn:hover {
  background: rgba(0, 0, 0, 0.03);
}

.modal.hs-bs-modal .btn.btn-primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
}

.modal.hs-bs-modal .btn.btn-primary:hover {
  filter: brightness(0.97);
}

.modal.hs-bs-modal .btn.btn-danger {
  background: var(--danger-color);
  border-color: var(--danger-color);
  color: #ffffff;
}

.modal.hs-bs-modal .btn.btn-danger:hover {
  filter: brightness(0.97);
}

.modal.hs-bs-modal .btn.btn-secondary {
  background: #ffffff;
  color: var(--dark-color);
  border-color: var(--sidebar-border);
}

.modal.hs-bs-modal .btn.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* ============================================================
   FIM: AJUSTE MINIMALISTA
   ============================================================ */


/* ============================================================
   FIX: MODAL NA FRENTE / CLIQUES BLOQUEADOS
   Causa provável: stacking context do .hs-bs-modal-root com z-index menor
   que o backdrop (inserido no body). Resultado: modal fica atrás do cinza.
   Solução: elevar z-index do root e do modal acima do backdrop.
   ============================================================ */

.hs-bs-modal-root {
  z-index: 100000;
}

.modal-backdrop.hs-bs-backdrop {
  z-index: 100001;
}

.modal.hs-bs-modal {
  z-index: 100002;
  pointer-events: auto;
}

.modal.hs-bs-modal .modal-dialog,
.modal.hs-bs-modal .modal-content {
  pointer-events: auto;
}

/* ============================================================
   FIM FIX: MODAL NA FRENTE / CLIQUES BLOQUEADOS
   ============================================================ */


/* ============================================================
   FIX 2: BACKDROP NÃO BLOQUEAR CLIQUES
   - Alguns navegadores/contexts podem deixar o backdrop capturando clique
     mesmo quando o modal parece estar por cima.
   - Solução: backdrop com pointer-events: none; (clique fora fecha via JS)
   ============================================================ */

.modal-backdrop.hs-bs-backdrop {
  pointer-events: none;
}

/* ============================================================
   FIM FIX 2
   ============================================================ */


/* ============================================================
   AJUSTE: OVERLAY (BACKDROP) POR TRÁS DO MODAL
   - Garante que o backdrop fique abaixo do modal no stacking
   - Mantém o modal clicável
   ============================================================ */

.hs-bs-modal-root {
  z-index: 100020;
}

.modal-backdrop.hs-bs-backdrop {
  z-index: 100000;
}

.modal.hs-bs-modal {
  z-index: 100010;
}

/* ============================================================
   FIM: OVERLAY POR TRÁS DO MODAL
   ============================================================ */


/* ============================================================
   ✅ PATCH EVOLUTIVO: HINT DO POLÍGONO MAIS PRÓXIMO (SEM DISTÂNCIA)
   Motivo:
   - Para hotspots normais, o hint usa offsets em % (ex: 130%) e funciona bem.
   - Para polígonos grandes (bbox alto/largo), 130% afasta o hint demais.
   Solução:
   - Para .hotspot-element.polygon, usar offsets fixos via calc(100% + gap)
   - Garantir animação/posição tanto em .poly-hover quanto em .force-hint
   ============================================================ */

:root {
  --poly-hint-gap: 14px;
  --poly-hint-slide: 10px;
}

/* TOP */
.hotspot-element.polygon .hotspot-hint.top {
  bottom: calc(100% + var(--poly-hint-gap));
  left: 50%;
  transform: translateX(-50%) translateY(var(--poly-hint-slide));
}
.hotspot-element.polygon.poly-hover .hotspot-hint.top,
.hotspot-element.polygon.force-hint .hotspot-hint.top {
  transform: translateX(-50%) translateY(0);
}

/* RIGHT */
.hotspot-element.polygon .hotspot-hint.right {
  left: calc(100% + var(--poly-hint-gap));
  top: 50%;
  transform: translateY(-50%) translateX(calc(var(--poly-hint-slide) * -1));
}
.hotspot-element.polygon.poly-hover .hotspot-hint.right,
.hotspot-element.polygon.force-hint .hotspot-hint.right {
  transform: translateY(-50%) translateX(0);
}

/* BOTTOM */
.hotspot-element.polygon .hotspot-hint.bottom {
  top: calc(100% + var(--poly-hint-gap));
  left: 50%;
  transform: translateX(-50%) translateY(calc(var(--poly-hint-slide) * -1));
}
.hotspot-element.polygon.poly-hover .hotspot-hint.bottom,
.hotspot-element.polygon.force-hint .hotspot-hint.bottom {
  transform: translateX(-50%) translateY(0);
}

/* LEFT */
.hotspot-element.polygon .hotspot-hint.left {
  right: calc(100% + var(--poly-hint-gap));
  top: 50%;
  transform: translateY(-50%) translateX(var(--poly-hint-slide));
}
.hotspot-element.polygon.poly-hover .hotspot-hint.left,
.hotspot-element.polygon.force-hint .hotspot-hint.left {
  transform: translateY(-50%) translateX(0);
}

/* ============================================================
   FIM DO PATCH HINT POLÍGONO
   ============================================================ */


/* ============================================================
   ✅ FIX: "Tremer" (shake) com deslocamento VISÍVEL em px
   Motivo: o shake antigo usava % (muito sutil em hotspots pequenos)
   e em alguns casos parecia "não funcionar".
   - Mantém rotação (var --spot-rotate) em TODOS os frames
   - Usa px para chacoalhar direita/esquerda de forma perceptível
   - Desativa transition de transform no estado animando (evita suavizar demais)
   ============================================================ */

/* Quando estiver tremendo, não suaviza transform (deixa o shake nítido) */
.hotspot-element.hotspot-shake {
    transition: none;
    will-change: transform;
}

/* Override: última definição de @keyframes shake vence no CSS */
@keyframes shake {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg));
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translate(calc(-50% - 7px), -50%) rotate(var(--spot-rotate, 0deg));
    }
    20%, 40%, 60%, 80% {
        transform: translate(calc(-50% + 7px), -50%) rotate(var(--spot-rotate, 0deg));
    }
}


/* ============================================================
   ✅ FIX: HINT NÃO PISCAR (principalmente com IMAGENS/HTML)
   - JS adiciona .hint-hover-lock no .hotspot-element quando o mouse entra no hint.
   - Isso evita que o hint suma quando o hover do shape (ex.: polygon) é perdido.
   - Mantém compatibilidade: por padrão o hint continua com pointer-events: none.
   ============================================================ */

/* Mantém o hint visível quando o mouse está sobre o próprio hint (via classe no pai) */
.hotspot-element.hint-hover-lock .hotspot-hint{
    opacity: var(--hint-opacity, 1);
    visibility: visible;
}

/* Permitir interação SOMENTE quando estiver visível (hover, force, poly-hover, ou lock) */
.hotspot-element:hover .hotspot-hint,
.hotspot-element.force-hint .hotspot-hint,
.hotspot-element.poly-hover .hotspot-hint,
.hotspot-element.hint-hover-lock .hotspot-hint{
    pointer-events: auto;
}

/* Reforço do transform final para o estado "lock" (evita pulo) */
.hotspot-element.hint-hover-lock .hotspot-hint.top{
    transform: translateX(-50%) translateY(0);
}
.hotspot-element.hint-hover-lock .hotspot-hint.right{
    transform: translateY(-50%) translateX(0);
}
.hotspot-element.hint-hover-lock .hotspot-hint.bottom{
    transform: translateX(-50%) translateY(0);
}
.hotspot-element.hint-hover-lock .hotspot-hint.left{
    transform: translateY(-50%) translateX(0);
}

/* Polígono: mesma lógica (compat com patch existente de poly-hover/force-hint) */
.hotspot-element.polygon.hint-hover-lock .hotspot-hint.top,
.hotspot-element.polygon.hint-hover-lock .hotspot-hint.right,
.hotspot-element.polygon.hint-hover-lock .hotspot-hint.bottom,
.hotspot-element.polygon.hint-hover-lock .hotspot-hint.left{
    /* já foi setado acima por direção; este bloco é apenas redundância segura */
    opacity: var(--hint-opacity, 1);
    visibility: visible;
}


/* ============================================================
   ✅ FIX EXTRA (SEM QUEBRAR LINK): permitir clicar no SPOT mesmo com HINT em cima
   Problema:
   - Quando o hint contém HTML/IMG, ele pode "cobrir" o hotspot e capturar o clique.
   - Aí você clica no spot para fechar, mas o clique vai no hint e o hint não some.
   Solução:
   - O container do hint NÃO captura eventos (pointer-events: none)
   - Somente elementos interativos DENTRO do hint capturam eventos (links, botões, inputs, etc)
   Resultado:
   - Link continua clicável
   - Clique no spot sempre funciona para desligar/alternar o hint, mesmo com imagem grande
   ============================================================ */

/* Container do hint não intercepta cliques/hover (deixa passar pro hotspot) */
.hotspot-hint {
  pointer-events: none !important;
}

/* Somente elementos interativos dentro do hint podem receber clique */
.hotspot-hint a,
.hotspot-hint button,
.hotspot-hint input,
.hotspot-hint textarea,
.hotspot-hint select,
.hotspot-hint label,
.hotspot-hint [role="button"],
.hotspot-hint [tabindex],
.hotspot-hint .hint-image {
  pointer-events: auto !important;
}

/* Mantém UX: cursor de link dentro do hint */
.hotspot-hint a {
  cursor: pointer;
}

/* ============================================================
   ✅ FIX V4: Permitir navegação do CARROSSEL dentro do Hint
   Problema observado:
   - Um patch anterior definia .hotspot-hint { pointer-events: none !important; }
   - Isso pode bloquear cliques nos botões/dots do carrossel em alguns browsers.
   Solução:
   - Quando o Hint estiver VISÍVEL (hover/force/poly-hover/lock), liberamos pointer-events
     no container do hint e, por redundância, no wrapper do carrossel.
   - Mantém compatibilidade: fora desses estados, o Hint segue "transparente" ao mouse.
   ============================================================ */

/* Quando o Hint está visível, ele pode receber interação (necessário para carrossel) */
.hotspot-element:hover .hotspot-hint,
.hotspot-element.force-hint .hotspot-hint,
.hotspot-element.poly-hover .hotspot-hint,
.hotspot-element.hint-hover-lock .hotspot-hint,
.hotspot-element.hint-hover-persist .hotspot-hint{
  pointer-events: auto !important;
}

/* Redundância: garantir que o carrossel sempre receba eventos quando estiver renderizado */
.hotspot-hint .hint-carousel,
.hotspot-hint .hint-carousel *{
  pointer-events: auto !important;
}

/* UX: botões e dots do carrossel sempre clicáveis */
.hotspot-hint .hint-carousel-btn,
.hotspot-hint .hint-carousel-dot{
  pointer-events: auto !important;
  cursor: pointer;
}

/* Mantém clique no link (caso exista HTML no hint) */
.hotspot-hint a{
  pointer-events: auto !important;
}

/* ============================================================
   ✅ CARROSSEL NO HINT: Setas laterais + bolinhas em baixo
   - Não remove nenhum estilo anterior
   - Apenas adiciona layout/visibilidade dos controles
   ============================================================ */

.hotspot-hint .hint-carousel{
  position: relative;
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.hotspot-hint .hint-carousel-viewport{
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
}

.hotspot-hint .hint-carousel-image{
  display: block;
  width: 100%;
  height: auto;
}

/* Setas laterais */
.hotspot-hint .hint-carousel-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  border: 0;
  padding: 8px 10px;
  line-height: 1;
  font-size: 18px;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  user-select: none;
}

.hotspot-hint .hint-carousel-prev{ left: 8px; }
.hotspot-hint .hint-carousel-next{ right: 8px; }

.hotspot-hint .hint-carousel-btn:hover{
  background: rgba(0,0,0,0.6);
}

/* Bolinhas em baixo */
.hotspot-hint .hint-carousel-dots{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 3;
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
}

.hotspot-hint .hint-carousel-dot{
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.hotspot-hint .hint-carousel-dot.active{
  background: rgba(255,255,255,0.95);
}

/* Garante clique nos controles mesmo com outras regras de pointer-events */
.hotspot-hint .hint-carousel-btn,
.hotspot-hint .hint-carousel-dot{
  pointer-events: auto !important;
  cursor: pointer;
}

/* ============================================================
   ⏪⏩ HISTÓRICO (UNDO/REDO) — TOPBAR
   - Botões próximos ao Snap/Ajuda rápida
   - Visual reaproveita .btn .btn-icon já existente
   ============================================================ */

/* Wrapper opcional (caso o JS crie) */
.hs-history-topbar-wrap{
    display:flex;
    align-items:center;
    gap:10px;
}

/* Botões de histórico (mesma base do design atual) */
#hs-undo-topbar,
#hs-redo-topbar{
    position: relative;
}

#hs-undo-topbar[disabled],
#hs-redo-topbar[disabled]{
    opacity: 0.55;
    cursor: not-allowed;
}

/* Badge de atalho (discreto) */
.hs-history-kbd{
    position:absolute;
    bottom:-10px;
    right:-10px;
    font-size:10px;
    padding:2px 6px;
    border-radius:10px;
    background:rgba(0,0,0,0.55);
    color:#fff;
    border:1px solid rgba(255,255,255,0.2);
    pointer-events:none;
    transform: scale(0.95);
}

/* ============================================================
   FIM: HISTÓRICO (UNDO/REDO)
   ============================================================ */
.hs-history-topbar-wrap .btn{
    /* mantém herança; apenas garante consistência */
}

/* Feedback leve quando desabilitado */
.hs-history-topbar-wrap .btn:disabled{
    opacity:0.45;
}

/* Ajuste fino do ícone */
.hs-history-topbar-wrap .btn i{
    font-size:1rem;
}


/* ============================================================
   🎨 EDITOR VISUAL DE BOTÕES SOCIAIS - ABA BÁSICO
   - Painel em 2 colunas (configurações + preview)
   - Cards internos em cinza claro com radius 8px
   - Galeria de ícones 40x40 grayscale
   ============================================================ */

.controls-panel .panel-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
}

.social-button-editor {
  margin-top: 8px;
  container-type: inline-size;
}

.sb-editor-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 14px;
  align-items: start;
}

.sb-editor-left {
  min-width: 220px;
}

.sb-card {
  background: #f5f6f7;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.sb-card-title {
  font-weight: 600;
  font-size: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  list-style: none;
}

.sb-card-title::-webkit-details-marker {
  display: none;
}

.sb-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sb-label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 4px;
}

.sb-input,
.sb-select,
.sb-number {
  width: 100%;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
}

.sb-inline {
  display: grid;
  grid-template-columns: 36px 36px 1fr;
  gap: 8px;
  align-items: center;
}

.sb-toggle {
  width: 36px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  cursor: pointer;
}

.sb-toggle.active {
  background: rgba(0,0,0,.06);
}

.sb-divider {
  height: 1px;
  background: rgba(0,0,0,.06);
  width: 100%;
}

.sb-icon-gallery {
  display: grid;
  grid-template-columns: repeat(4, 40px);
  gap: 8px;
}

.sb-icon-tile {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  filter: grayscale(1);
  opacity: 0.85;
}

.sb-icon-tile i {
  font-size: 16px;
}

.sb-icon-tile.active {
  outline: 2px solid rgba(58, 134, 255, 0.55);
  opacity: 1;
}

.sb-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sb-range-wrap {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 10px;
  align-items: center;
}

.sb-range-wrap input[type="range"] {
  width: 100%;
}

.sb-number {
  text-align: right;
}

.sb-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sb-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
}

.sb-presets,
.sb-radius-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sb-preset,
.sb-rpreset {
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.sb-preset.active,
.sb-rpreset.active {
  background: rgba(0,0,0,.06);
}

.sb-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
}

.sb-color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sb-color-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
}

.sb-color-label {
  font-size: 12px;
}

.sb-color {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  overflow: hidden;
  background: transparent;
}

/* Preview */
.sb-editor-right {
  position: sticky;
  top: 10px;
}

.sb-preview-surface {
  width: 100%;
  max-width: 260px;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px dashed rgba(0,0,0,.22);
  background: rgba(0,0,0,.02);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.sb-preview-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(0,0,0,.6);
  border-radius: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,1);
  color: #111;
  font-size: 13px;
  font-weight: 600;
  cursor: default;
  user-select: none;
}

.sb-preview-btn.sb-icon-right {
  flex-direction: row-reverse;
}

.sb-preview-btn.sb-icon-top {
  flex-direction: column;
}

.sb-preview-btn.sb-only-icon .sb-preview-text {
  display: none;
}

.sb-preview-icon i {
  font-size: 18px;
}

.sb-preview-hint {
  font-size: 12px;
  opacity: 0.6;
  text-align: center;
}

/* Responsivo: sidebar estreita vira 1 coluna */
@container (max-width: 520px) {
  .sb-editor-grid { grid-template-columns: 1fr; }
  .sb-editor-right { position: static; top: auto; }
  .sb-preview-surface { max-width: 100%; min-height: 200px; }
}

/* ============================================================
   🧩 HOTSPOT TIPO "socialButton" (renderizado no canvas)
   ============================================================ */

.hotspot-element.socialButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%) rotate(var(--spot-rotate, 0deg));
  padding: 0;
}

.hotspot-element.socialButton .sb-spot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sb-gap, 10px);
  width: var(--sb-width, auto);
  height: var(--sb-height, auto);
  padding: var(--sb-pad-y, 8px) var(--sb-pad-x, 14px);
  border-radius: var(--sb-radius, 8px);
  border: var(--sb-border-width, 1px) solid var(--sb-border-color, #111);
  background: var(--sb-bg, rgba(255,255,255,1));
  color: var(--sb-text-color, #111);
  font-family: var(--sb-font, inherit);
  font-weight: var(--sb-fw, 600);
  font-style: var(--sb-fs, normal);
  user-select: none;
  white-space: nowrap;
}

.hotspot-element.socialButton .sb-spot-btn.sb-icon-right { flex-direction: row-reverse; }
.hotspot-element.socialButton .sb-spot-btn.sb-icon-top { flex-direction: column; }
.hotspot-element.socialButton .sb-spot-btn.sb-only-icon .sb-spot-text { display: none; }

.hotspot-element.socialButton .sb-spot-icon i {
  font-size: var(--sb-icon-size, 18px);
  color: var(--sb-icon-color, var(--sb-text-color, #111));
}

.hotspot-element.socialButton .sb-spot-text {
  font-size: 13px;
}

/* Fill modes (visual) */
.hotspot-element.socialButton .sb-spot-btn.sb-fill-outline {
  background: rgba(0,0,0,0) !important;
}

.hotspot-element.socialButton .sb-spot-btn.sb-fill-flat {
  border-width: 0 !important;
  background: rgba(0,0,0,0) !important;
}

.hotspot-element.socialButton .sb-spot-btn.sb-fill-clear {
  border-width: 0 !important;
  background: rgba(0,0,0,0) !important;
}

.hotspot-element.socialButton .sb-spot-btn.sb-fill-link {
  border-width: 0 !important;
  background: rgba(0,0,0,0) !important;
  padding: 0 !important;
}


/* ============================================================
   🔧 UX: Redimensionamento mais fácil (alça maior + área clicável)
   - Não remove regras antigas; apenas sobrescreve por cascade
   ============================================================ */

/* Aumenta a alça para facilitar clique/arrasto */
.hotspot-resize-handle{
  right:-9px;
  bottom:-9px;
  width:18px;
  height:18px;
  border-radius:4px;
}

/* Área invisível extra para melhorar "hit area" sem mudar visual */
.hotspot-resize-handle::before{
  content:"";
  position:absolute;
  left:-10px;
  top:-10px;
  width:38px;
  height:38px;
  background:transparent;
}

/* Cursor de resize também ao passar no canto (quando selecionado) */
.hotspot-element.selected{
  cursor: move;
}
.hotspot-element.selected .hotspot-resize-handle{
  cursor: nwse-resize;
}

/* ============================================================
   ✅ Social Button SVG Fallback (X / Threads / Globo / Carrinho)
   - Garante que ícones em SVG inline sigam o mesmo comportamento do <i> do Font Awesome
   ============================================================ */
.sb-spot-icon .sb-svg,
#sb-preview-icon .sb-svg,
.sb-icon-tile .sb-svg {
  display: inline-block;
  vertical-align: middle;
  width: 1em;
  height: 1em;
  color: currentColor;
}

.sb-spot-icon .sb-svg path,
#sb-preview-icon .sb-svg path,
.sb-icon-tile .sb-svg path {
  fill: currentColor;
}

