/* ─── Torrette Mappa — Frontend CSS ─────────────────────
   Palette: azzurro adriatico + sabbia + bianco
   Font system: usa quello del tema
──────────────────────────────────────────────────────── */

:root {
    --tm-sea:    #0099bb;
    --tm-blue:   #0066cc;
    --tm-sand:   #f5f0e4;
    --tm-dark:   #1a2e3d;
    --tm-white:  #ffffff;
    --tm-shadow: 0 4px 16px rgba(0,100,180,.14);
    --tm-radius: 12px;
}

/* ── Contenitore principale ── */
.tm-container {
    position: relative;
    background: var(--tm-white);
    border-radius: var(--tm-radius);
    overflow: hidden;
    box-shadow: var(--tm-shadow);
    font-family: inherit;
}

/* ── Barra filtri ── */
.tm-filtri {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--tm-dark);
    align-items: center;
}

.tm-filtri-label {
    color: rgba(255,255,255,.6);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-right: 4px;
}

.tm-btn-cat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid rgba(255,255,255,.25);
    background: transparent;
    color: rgba(255,255,255,.8);
    font-size: 12px;
    cursor: pointer;
    transition: all .18s ease;
    white-space: nowrap;
}

.tm-btn-cat:hover,
.tm-btn-cat.active {
    background: var(--tm-sea);
    border-color: var(--tm-sea);
    color: #fff;
    transform: translateY(-1px);
}

/* ── Mappa ── */
#tm-map {
    width: 100%;
    background: #cde8f0;
}

/* ── Counter risultati ── */
.tm-counter {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1000;
    background: var(--tm-white);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--tm-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    pointer-events: none;
}

/* ── Popup marker ── */
.tm-popup {
    min-width: 200px;
    max-width: 260px;
    font-family: inherit;
}

.tm-popup-foto {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 6px 6px 0 0;
    display: block;
    margin: -12px -12px 10px -12px;
    width: calc(100% + 24px);
}

.tm-popup-cat {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tm-sea);
    margin-bottom: 4px;
}

.tm-popup h3 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--tm-dark);
    line-height: 1.2;
}

.tm-popup-desc {
    font-size: 12px;
    color: #555;
    margin: 0 0 8px;
    line-height: 1.4;
}

.tm-popup-info {
    font-size: 11px;
    color: #666;
    line-height: 1.6;
}

.tm-popup-info span {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin-bottom: 2px;
}

.tm-popup-orari {
    background: var(--tm-sand);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 11px;
    color: #555;
    margin: 8px 0;
    white-space: pre-line;
}

.tm-popup-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tm-popup-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .15s;
}

.tm-popup-btn:hover { opacity: .85; }

.tm-popup-btn-primary {
    background: var(--tm-blue);
    color: #fff !important;
}

.tm-popup-btn-social {
    background: #f0f0f0;
    color: var(--tm-dark) !important;
}

/* ── Marker custom (div icon) ── */
.tm-marker {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tm-marker-inner {
    transform: rotate(45deg);
    font-size: 16px;
    line-height: 1;
}

/* ── Versione widget (homepage) ── */
.tm-widget .tm-filtri {
    padding: 10px 12px;
    gap: 6px;
}

.tm-widget #tm-map {
    border-radius: 0;
}

.tm-widget-footer {
    padding: 10px 16px;
    background: var(--tm-sand);
    text-align: center;
    font-size: 12px;
    color: #666;
}

.tm-widget-footer a {
    color: var(--tm-blue);
    font-weight: 700;
    text-decoration: none;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .tm-filtri { gap: 5px; padding: 10px; }
    .tm-btn-cat { font-size: 11px; padding: 4px 9px; }
    .tm-counter { font-size: 11px; padding: 4px 10px; }
}
