/* ── Stands Map — Frontend v3 ─────────────────────── */

.sm-map-wrapper { font-family: inherit; margin: 0 auto; }

/* Floor tabs */
.sm-floor-tabs {
    display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap;
}
.sm-floor-tab {
    background: #f0f0f0; border: 1px solid #ddd; border-radius: 6px 6px 0 0;
    padding: 8px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
    color: #555; border-bottom-color: transparent; position: relative;
    transition: background .15s, color .15s;
}
.sm-floor-tab:hover { background: #e4e4e4; color: #222; }
.sm-floor-tab.is-active { background: #fff; border-color: #ddd; border-bottom-color: #fff; color: #1a1a1a; }

/* Floor panels */
.sm-floor-panel { display: none; }
.sm-floor-panel.is-active { display: block; }

/* Map container — aspect ratio set by JS after image loads */
.sm-map-container {
    position: relative; width: 100%; overflow: hidden;
    border-radius: 6px;
    background: #f4f4f4; line-height: 0;
}

.sm-map-image {
    display: block; width: 100%; height: auto;
    user-select: none; pointer-events: none;
}

.sm-map-svg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
}

/* Stand groups */
.sm-stand-group { cursor: pointer; }
.sm-stand-rect  { transition: filter .15s; }
.sm-stand-group:hover .sm-stand-rect {
    filter: brightness(1.25) drop-shadow(0 0 4px rgba(0,0,0,.35));
}

/* Legend */
.sm-legend {
    display: flex; align-items: center;
    gap: 24px; margin-top: 14px; flex-wrap: wrap;
}
.sm-legend-item { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #444; }
.sm-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.sm-dot-available   { background: #22c55e; }
.sm-dot-negotiation { background: #eab308; }
.sm-dot-sold        { background: #ef4444; }

/* ── Modal ──────────────────────────────────────── */
.sm-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.55); z-index: 99999;
    align-items: center; justify-content: center;
    padding: 20px; backdrop-filter: blur(3px);
}
.sm-modal-overlay.is-open { display: flex; animation: smIn .2s ease; }
@keyframes smIn { from{opacity:0} to{opacity:1} }

.sm-modal {
    background: #fff; border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    max-width: 520px; width: 100%; max-height: 90vh;
    overflow-y: auto; position: relative; padding: 32px 32px 28px;
    animation: smSlide .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes smSlide {
    from { opacity:0; transform:scale(.92) translateY(16px); }
    to   { opacity:1; transform:scale(1) translateY(0); }
}

.sm-modal-close {
    position: absolute; top:14px; right:16px;
    background:none; border:none; font-size:26px;
    color:#888; cursor:pointer; padding:4px 8px;
    border-radius:6px; line-height:1;
    transition: background .15s, color .15s;
}
.sm-modal-close:hover { background:#f0f0f0; color:#333; }

.sm-modal-header { display:flex; align-items:center; gap:14px; margin-bottom:20px; }
.sm-modal-icon {
    width:48px; height:48px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-size:22px; flex-shrink:0;
}
.sm-icon-available   { background:#dcfce7; }
.sm-icon-negotiation { background:#fef9c3; }
.sm-icon-sold        { background:#fee2e2; }

.sm-modal-title { font-size:20px; font-weight:700; color:#1a1a1a; margin:0; line-height:1.3; }
.sm-modal-body  { color:#444; line-height:1.6; }

.sm-status-msg {
    background:#f8f9fa; border-left:4px solid #eab308;
    padding:14px 16px; border-radius:0 8px 8px 0; font-size:15px;
}
.sm-status-msg.msg-sold { border-color:#ef4444; }
.sm-company-name { display:block; font-size:22px; font-weight:700; color:#1a1a1a; margin-top:8px; }

.sm-loading { display:flex; align-items:center; justify-content:center; padding:32px; gap:12px; color:#888; }
.sm-spinner { width:24px; height:24px; border:3px solid #e5e5e5; border-top-color:#22c55e; border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }

@media (max-width:600px) {
    .sm-modal { padding:24px 18px 20px; }
    .sm-modal-title { font-size:17px; }
}

/* Company card in sold modal */
.sm-company-card {
    display: flex; align-items: center; gap: 14px; margin-top: 12px;
}
.sm-company-logo {
    max-height: 56px; max-width: 120px; object-fit: contain;
    border: 1px solid #eee; border-radius: 6px; padding: 4px; background: #fff;
    flex-shrink: 0;
}
.sm-company-info { display: flex; flex-direction: column; gap: 4px; }
.sm-company-name { font-size: 20px; font-weight: 700; color: #1a1a1a; }
.sm-company-url  { font-size: 13px; color: #2563eb; text-decoration: none; }
.sm-company-url:hover { text-decoration: underline; }

/* ── Tooltip ─────────────────────────────────────── */
#sm-stand-tooltip {
    position: fixed;
    z-index: 99998;
    background: #1a1d26;
    border: 1px solid #2d3348;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.2);
    min-width: 180px;
    max-width: 260px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) scale(.97);
    transition: opacity .15s ease, transform .15s ease;
    font-size: 13px;
    line-height: 1.4;
    overflow: visible; /* necessário para a seta */
    --tt-arrow: 20px;  /* posição horizontal da seta — calculada pelo JS */
}
#sm-stand-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Seta — pseudo-elemento posicionado pelo CSS var --tt-arrow */
#sm-stand-tooltip::before {
    content: '';
    position: absolute;
    left: var(--tt-arrow);
    width: 0; height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    transform: translateX(-50%);
    pointer-events: none;
}
/* Seta a apontar para cima (tooltip por baixo do stand) */
#sm-stand-tooltip.tt-below::before {
    top: -7px;
    border-bottom: 7px solid #2d3348; /* borda */
}
#sm-stand-tooltip.tt-below::after {
    content: '';
    position: absolute;
    left: var(--tt-arrow);
    top: -5px;
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #1a1d26; /* fill */
    transform: translateX(-50%);
    pointer-events: none;
}
/* Seta a apontar para baixo (tooltip por cima do stand) */
#sm-stand-tooltip.tt-above::before {
    bottom: -7px;
    border-top: 7px solid #2d3348;
}
#sm-stand-tooltip.tt-above::after {
    content: '';
    position: absolute;
    left: var(--tt-arrow);
    bottom: -5px;
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1a1d26;
    transform: translateX(-50%);
    pointer-events: none;
}

.sm-tt-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px 8px;
    border-bottom: 1px solid #2d3348;
    font-size: 13px;
    color: #e8eaf0;
}
.sm-tt-available   .sm-tt-dot { background: #22c55e; }
.sm-tt-negotiation .sm-tt-dot { background: #eab308; }
.sm-tt-sold        .sm-tt-dot { background: #ef4444; }

.sm-tt-dot {
    width: 8px; height: 8px;
    border-radius: 50%; flex-shrink: 0;
}

.sm-tt-body {
    padding: 9px 13px 11px;
    color: #8891a8;
    font-size: 12px;
}

/* Company info inside tooltip */
.sm-tt-company {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px 12px;
}
.sm-tt-logo {
    max-height: 40px;
    max-width: 80px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    padding: 3px;
    flex-shrink: 0;
}
.sm-tt-company-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.sm-tt-company-name {
    font-size: 14px;
    font-weight: 700;
    color: #e8eaf0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sm-tt-url {
    font-size: 11px;
    color: #60a5fa;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.sm-tt-url:hover { text-decoration: underline; }

/* Cursor changes per status */
.sm-stand-available   { cursor: pointer; }
.sm-stand-negotiation { cursor: default; }
.sm-stand-sold        { cursor: default; }

/* ── Lista de Stands Vendidos ────────────────────── */
.sm-list-wrapper { font-family: inherit; }

.sm-list-title {
    font-size: 18px; font-weight: 700;
    color: #1a1a1a; margin: 0 0 16px;
}

.sm-list-empty { color: #888; font-style: italic; }

.sm-sold-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 6px;
}

/* Grid: [logo?] [nome empresa] | [stand label] [piso]
   O separador é ::before do .sm-sold-stand */
.sm-sold-list {
    --col-stand-label: 5ch;
    --col-stand: 160px;
}

.sm-sold-item {
    display: grid;
    grid-template-columns: auto 1fr var(--col-stand);
    align-items: center;
    gap: 0 12px;
    padding: 10px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    cursor: default;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
/* Quando não há logo, a primeira coluna colapsa */
.sm-sold-item:not(:has(.sm-sold-logo)) {
    grid-template-columns: 1fr var(--col-stand);
}
.sm-sold-item:hover {
    border-color: #ef4444;
    box-shadow: 0 2px 10px rgba(239,68,68,.1);
    background: #fff8f8;
}

.sm-sold-logo {
    width: 36px; height: 36px;
    object-fit: contain; flex-shrink: 0;
    border: 1px solid #eee; border-radius: 5px;
    padding: 3px; background: #fafafa;
}
.sm-sold-company-name {
    font-size: 15px; font-weight: 600; color: #1a1a1a;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
}

/* Stand + piso — separador como ::before */
.sm-sold-stand {
    display: grid;
    grid-template-columns: var(--col-stand-label) auto;
    align-items: center;
    gap: 7px;
    font-size: 14px; font-weight: 700; color: #444;
    white-space: nowrap;
    padding-left: 14px;    /* espaço para o separador */
    position: relative;
}
/* Separador vertical */
.sm-sold-stand::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 1px; height: 20px;
    background: #e0e0e0;
}
.sm-sold-label {
    position: relative;
    padding-left: 16px;
}
/* Dot vermelho */
.sm-sold-label::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ef4444;
}
.sm-sold-floor {
    font-size: 11px; font-weight: 400; color: #999;
    background: #f3f3f3; padding: 2px 7px;
    border-radius: 10px;
    text-align: center;
}

@media (max-width: 480px) {
    .sm-sold-item,
    .sm-sold-item:not(:has(.sm-sold-logo)) {
        grid-template-columns: 1fr;
        gap: 8px 0;
    }
    .sm-sold-stand { padding-left: 0; }
    .sm-sold-stand::before { display: none; }
}



/* ── Contador ────────────────────────────────────── */
.sm-counter { display: inline-flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.sm-counter-number {
    font-size: 1.6em; font-weight: 800; line-height: 1;
}
.sm-counter-available { color: #16a34a; }
.sm-counter-sold      { color: #dc2626; }
.sm-counter-percent   { color: #dc2626; }
.sm-counter-label     { font-size: .9em; color: #555; }
.sm-counter-sep       { color: #ccc; }

/* Modal intro text */
.sm-modal-intro {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
