/* ================================================================
   Dealer Map — Mobilné Planetárium brand skin
   ─────────────────────────────────────────────
   Primárna (magenta):   #E33054   hover: #C52447
   Navy (titul/text):    #133555   tmavá:  #10172a
   Svetlá sekundárna:    #a3b7cc   podklad: #F4F6FA
   ================================================================ */
:root {
    --dm-primary:       #E33054;
    --dm-primary-dark:  #C52447;
    --dm-navy:          #133555;
    --dm-navy-deep:     #10172a;
    --dm-text:          #1f2a44;
    --dm-muted:         #6B7A94;
    --dm-blue-soft:     #a3b7cc;
    --dm-bg:            #F4F6FA;
    --dm-surface:       #ffffff;
    --dm-border:        #E4E9F2;
    --dm-shadow-md:     0 6px 20px rgba(19, 53, 85, .12);
    --dm-shadow-lg:     0 12px 40px rgba(16, 23, 42, .2);
}

/* ─── Wrap ─── */
.dm-wrap {
    border: 1px solid var(--dm-border);
    border-radius: 14px;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    box-shadow: var(--dm-shadow-md);
    background: #fff;
    position: relative;
    color: var(--dm-text);
}

/* ─── Floating search overlay (pravý horný roh) ─── */
.dm-search-overlay {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1000; /* nad leaflet controls */
    width: 340px;
    max-width: calc(100% - 28px);
    pointer-events: none; /* deti nastavíme pointer-events:auto */
}
.dm-search-overlay > * { pointer-events: auto; }

.dm-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--dm-shadow-md);
    border: 1px solid var(--dm-border);
    position: relative;
}
/* Jemný kozmický glow na vrchu search baru */
.dm-search-wrap::before {
    content: '';
    position: absolute;
    top: -1px; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--dm-primary), transparent);
    opacity: .5;
    border-radius: 2px;
}

.dm-search-inner {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.dm-search-icon {
    position: absolute;
    left: 10px;
    color: #999;
    pointer-events: none;
    flex-shrink: 0;
}

#dm-search {
    width: 100%;
    padding: 10px 12px 10px 34px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    background: var(--dm-bg);
    color: var(--dm-navy);
    transition: background .2s, border-color .2s, box-shadow .2s;
}
#dm-search::placeholder { color: #888; }
#dm-search:focus {
    background: #fff;
    border-color: var(--dm-primary);
    box-shadow: 0 0 0 3px rgba(227, 48, 84, .18);
}

/* ─── Autocomplete ─── */
.dm-autocomplete {
    margin-top: 6px;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-top: 3px solid var(--dm-primary);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    max-height: 280px;
    overflow-y: auto;
    display: none;
}
.dm-autocomplete.open { display: block; }

.dm-ac-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #f5f5f5;
    transition: background .12s;
    color: var(--dm-text);
}
.dm-ac-item:last-child { border-bottom: none; }
.dm-ac-item:hover, .dm-ac-item.active { background: #FEF0F0; }
.dm-ac-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hviezdičky v autocomplete */
.dm-ac-rating {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
}
.dm-ac-star {
    position: relative;
    width: 12px;
    height: 12px;
    display: inline-block;
}
.dm-ac-star svg { width: 100%; height: 100%; display: block; }
.dm-ac-star-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    overflow: hidden;
}
.dm-ac-star-fill svg { width: 12px; height: 12px; }
.dm-ac-rating-value {
    margin-left: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #B45309;
}

/* ─── GPS button ─── */
#dm-gps-btn {
    flex-shrink: 0;
    background: var(--dm-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(227, 48, 84, .3);
}
#dm-gps-btn:hover  { background: var(--dm-primary-dark); box-shadow: 0 3px 12px rgba(227, 48, 84, .45); }
#dm-gps-btn:active { transform: scale(.94); }
#dm-gps-btn svg {
    width: 26px !important;
    height: 26px !important;
    display: block;
}

/* ─── Results info (pod search barom) ─── */
.dm-results-info {
    margin-top: 6px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    background: rgba(255,255,255,.95);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    text-transform: uppercase;
    letter-spacing: .5px;
    display: none;
}
.dm-results-info:not(:empty) { display: block; }

/* ─── Map ─── */
.dm-map-wrap {
    width: 100%;
    height: 100%;
    position: relative;
}
#dm-map {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100% !important;
    height: 100% !important;
}

/* ─── Leaflet popup — Novochema skin ─── */
.dm-popup {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    min-width: 220px;
    max-width: 320px;
}

.dm-popup-photo {
    width: calc(100% + 36px);
    margin: -16px -18px 14px -18px;
    height: 140px;
    object-fit: cover;
    display: block;
    background: var(--dm-bg);
}

.dm-popup-title {
    font-size: 14px;
    font-weight: 800;
    margin: 0 0 4px;
    color: var(--dm-navy);
    letter-spacing: -.2px;
}

.dm-popup-addr {
    font-size: 12px;
    color: #777;
    margin: 0 0 10px;
    line-height: 1.4;
}

.dm-popup-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #F0F0F0;
    padding-top: 8px;
}

.dm-popup-rows li {
    font-size: 12px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #444;
}

.dm-popup-rows a {
    color: var(--dm-primary);
    text-decoration: none;
    font-weight: 500;
}
.dm-popup-rows a:hover { text-decoration: underline; }

/* Leaflet popup — full bleed foto, vlastný close button */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.18) !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: none !important;
}
.leaflet-popup-content {
    margin: 0 !important;
    width: 320px !important;
}
.leaflet-popup-tip-container { display: none !important; }

/* Skryť natívny Leaflet close button — máme vlastný */
.leaflet-popup-close-button { display: none !important; }

/* Popup wrapper */
.dm-popup {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* Foto sekcia — full bleed, relatívna pre close btn */
.dm-popup-photo-wrap {
    position: relative;
    width: 320px;
    height: 140px;
    background: #EBEBEB;
    overflow: hidden;
    flex-shrink: 0;
}
.dm-popup-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Vlastný close button cez fotku */
.dm-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,.45);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    padding: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.dm-popup-close:hover { background: rgba(200,24,30,.85); }

/* Obsah pod fotkou */
.dm-popup-body {
    padding: 16px 18px 18px;
    background: #fff;
    position: relative;
}
/* Jemná planétarium "star" decor v rohu popup body */
.dm-popup-body::before {
    content: '';
    position: absolute;
    top: 6px;
    right: 10px;
    width: 40px;
    height: 40px;
    background-image:
        radial-gradient(circle 1px at 6px 10px, var(--dm-primary) 100%, transparent 100%),
        radial-gradient(circle 1.5px at 22px 6px, var(--dm-navy) 100%, transparent 100%),
        radial-gradient(circle 1px at 32px 16px, var(--dm-primary) 100%, transparent 100%),
        radial-gradient(circle 1px at 12px 22px, var(--dm-navy) 100%, transparent 100%);
    opacity: .35;
    pointer-events: none;
}
.dm-popup-title {
    font-size: 14px;
    font-weight: 800;
    margin: 0 0 4px;
    color: var(--dm-navy);
    letter-spacing: -.2px;
    line-height: 1.3;
}
.dm-popup-addr {
    font-size: 12px;
    color: #777;
    margin: 0 0 10px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}
.dm-popup-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #F0F0F0;
    padding-top: 8px;
}
.dm-popup-rows li {
    font-size: 12px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #444;
}
.dm-popup-rows a {
    color: var(--dm-primary);
    text-decoration: none;
    font-weight: 500;
}
.dm-popup-rows a:hover { text-decoration: underline; }

/* ─── Otváracie hodiny v popupe ─── */
.dm-popup-hours {
    border-top: 1px solid #F0F0F0;
    padding-top: 10px;
    margin-bottom: 10px;
}

/* Variant: neznáme hodiny – statický, bez toggle */
.dm-popup-hours--unknown {
    padding: 10px 8px 6px;
}
.dm-popup-hours--unknown .dm-hours-head {
    color: #999;
    font-size: 12px;
}
.dm-hours-unknown-text {
    font-style: italic;
}
.dm-hours-toggle {
    width: 100%;
    background: none !important;
    border: none !important;
    padding: 6px 8px !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: inherit;
    color: #444;
    font-size: 12px;
    text-align: left;
    box-shadow: none !important;
    text-decoration: none !important;
    -webkit-appearance: none;
            appearance: none;
    line-height: 1.3;
    border-radius: 6px !important;
    transition: background .15s ease;
}
.dm-hours-toggle:hover {
    background: #FAFAFA !important;
    color: #444 !important;
    text-decoration: none !important;
}
.dm-hours-toggle:focus,
.dm-hours-toggle:active {
    background: #FAFAFA !important;
    color: #444 !important;
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
    text-decoration: none !important;
}
.dm-hours-toggle .dm-hours-clock-icon { color: #999; flex-shrink: 0; }
.dm-hours-toggle:hover .dm-hours-caret { color: var(--dm-primary); }
.dm-hours-toggle * { pointer-events: none; }

.dm-hours-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    min-width: 0;
}
.dm-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: -.1px;
}
.dm-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}
.dm-status--open          { color: #15803d; }
.dm-status--open .dm-status-dot   {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,.15);
    animation: dm-pulse 2s ease-in-out infinite;
}
.dm-status--closed        { color: #b91c1c; }
.dm-status--closed .dm-status-dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.dm-status--unknown       { color: #b45309; }
.dm-status--unknown .dm-status-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }

@keyframes dm-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
    50%      { box-shadow: 0 0 0 5px rgba(34,197,94,.08); }
}

.dm-hours-caret {
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    color: #bbb;
    flex-shrink: 0;
}
.dm-popup-hours.is-open .dm-hours-caret { transform: rotate(180deg); color: var(--dm-primary); }

/* Rozbaliteľný panel – animácia cez max-height */
.dm-hours-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .3s cubic-bezier(.4,0,.2,1), opacity .2s ease, margin-top .3s ease;
    margin-top: 0;
}
.dm-popup-hours.is-open .dm-hours-panel {
    max-height: 340px;
    opacity: 1;
    margin-top: 6px;
}

/* Moderný layout – flex riadky s leader dots */
.dm-hours-list {
    list-style: none;
    padding: 6px 8px 4px;
    margin: 0;
    background: #FAFAFA;
    border-radius: 6px;
    font-size: 12px;
}
.dm-hours-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 5px 0;
    position: relative;
}
.dm-hours-list li + li {
    border-top: 1px dashed #EAEAEA;
}
.dm-hours-list .dm-day-name {
    color: #888;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 72px;
}
.dm-hours-list .dm-day-time {
    color: #222;
    font-weight: 600;
    margin-left: auto;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.dm-hours-list li.dm-hours-today {
    padding: 6px 8px;
    margin: 0 -6px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.dm-hours-list li.dm-hours-today + li { border-top: none; }
.dm-hours-list li.dm-hours-today .dm-day-name { color: var(--dm-primary); font-weight: 700; }
.dm-hours-list li.dm-hours-today .dm-day-time { color: var(--dm-navy); font-weight: 800; }
.dm-hours-closed {
    color: #bbb;
    font-weight: 500;
    font-style: normal;
}
.dm-hours-note {
    margin: 8px 2px 0;
    padding: 0;
    font-size: 11px;
    color: #999;
    font-style: italic;
    line-height: 1.4;
}
.dm-map-wrap .leaflet-pane     { z-index: 1; }
.dm-map-wrap .leaflet-top,
.dm-map-wrap .leaflet-bottom   { z-index: 2; }
.dm-map-wrap .leaflet-popup    { z-index: 3; }

/* ─── Leaflet zoom control — brand skin ─── */
.dm-map-wrap .leaflet-top.leaflet-left { top: 14px; left: 14px; }
.dm-map-wrap .leaflet-control-zoom {
    border: none !important;
    border-radius: 10px !important;
    box-shadow: var(--dm-shadow-md) !important;
    overflow: hidden;
    background: #fff;
}
.dm-map-wrap .leaflet-control-zoom a {
    width: 38px !important;
    height: 38px !important;
    line-height: 38px !important;
    background: #fff !important;
    color: var(--dm-navy) !important;
    border: none !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    transition: background .15s, color .15s;
    position: relative;
}
.dm-map-wrap .leaflet-control-zoom a:first-child {
    border-bottom: 1px solid var(--dm-border) !important;
    border-radius: 10px 10px 0 0 !important;
}
.dm-map-wrap .leaflet-control-zoom a:last-child {
    border-radius: 0 0 10px 10px !important;
}
.dm-map-wrap .leaflet-control-zoom a:hover {
    background: var(--dm-primary) !important;
    color: #fff !important;
}
.dm-map-wrap .leaflet-control-zoom a.leaflet-disabled {
    background: #fafbfc !important;
    color: #cbd2dc !important;
    cursor: not-allowed;
}
.dm-map-wrap .leaflet-control-zoom a.leaflet-disabled:hover {
    background: #fafbfc !important;
    color: #cbd2dc !important;
}

/* Leaflet atribúcia — jemnejšia */
.dm-map-wrap .leaflet-control-attribution {
    background: rgba(255,255,255,.85) !important;
    border-radius: 6px 0 0 0 !important;
    padding: 2px 8px !important;
    font-size: 10px !important;
    color: var(--dm-muted) !important;
    backdrop-filter: blur(4px);
}
.dm-map-wrap .leaflet-control-attribution a {
    color: var(--dm-navy) !important;
    text-decoration: none;
}
.dm-map-wrap .leaflet-control-attribution a:hover { color: var(--dm-primary) !important; }

/* Custom Leaflet marker pin — červená */
.dm-marker-icon {
    background: var(--dm-primary);
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    width: 24px;
    height: 24px;
    box-shadow: 0 2px 6px rgba(227, 48, 84, .35);
}

/* ─── Scrollbar autocomplete ─── */
.dm-autocomplete::-webkit-scrollbar { width: 6px; }
.dm-autocomplete::-webkit-scrollbar-track { background: #f9f9f9; }
.dm-autocomplete::-webkit-scrollbar-thumb { background: #E0E0E0; border-radius: 3px; }
.dm-autocomplete::-webkit-scrollbar-thumb:hover { background: var(--dm-primary); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .dm-search-overlay {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
    .dm-search-wrap {
        padding: 6px;
        gap: 6px;
    }
    #dm-search { font-size: 13px; padding: 9px 10px 9px 32px; }
    #dm-gps-btn { width: 42px; height: 42px; }
    #dm-gps-btn svg { width: 24px !important; height: 24px !important; }
}

/* GPS button spin animation */
@keyframes dm-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ─── Hviezdičkové hodnotenie (popup) ─── */
.dm-popup-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 10px 0;
    padding: 8px 10px;
    background: #FFFBEB;
    border-radius: 6px;
    border: 1px solid #FEF3C7;
}
.dm-popup-rating .dm-star {
    position: relative;
    width: 18px;
    height: 18px;
    display: inline-block;
}
.dm-popup-rating .dm-star svg {
    width: 100%;
    height: 100%;
    display: block;
}
.dm-popup-rating .dm-star-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    overflow: hidden;
}
.dm-popup-rating .dm-star-fill svg { width: 18px; height: 18px; }
.dm-popup-rating-value {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #B45309;
}

/* ─── Textová referencia ─── */
.dm-popup-testimonial {
    margin: 10px 0;
    padding: 10px 12px 10px 14px;
    background: #F9FAFB;
    border-left: 3px solid var(--dm-primary);
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    line-height: 1.5;
    color: #444;
    font-style: italic;
    quotes: "„" """ "'" "'";
}
.dm-popup-testimonial::before { content: open-quote; margin-right: 2px; color: var(--dm-primary); font-weight: 700; font-size: 16px; line-height: 0; }
.dm-popup-testimonial::after  { content: close-quote; margin-left: 2px; color: var(--dm-primary); font-weight: 700; font-size: 16px; line-height: 0; }

/* ─── Tlačidlo "Zobraziť referenciu" ─── */
.dm-popup-btn--ref {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
    padding: 9px 12px;
    background: var(--dm-primary);
    color: #fff !important;
    border: 1px solid var(--dm-primary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s, border-color .15s;
    box-sizing: border-box;
}
.dm-popup-btn--ref:hover {
    background: var(--dm-primary-dark);
    border-color: var(--dm-primary-dark);
    color: #fff !important;
}

/* ─── Popup action buttons ─── */
.dm-popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #F0F0F0;
}
.dm-popup-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.dm-popup-btn--map {
    background: var(--dm-bg);
    color: #333 !important;
    border: 1px solid #E0E0E0;
}
.dm-popup-btn--map:hover {
    background: #E8E8E8;
    color: var(--dm-navy) !important;
}
.dm-popup-btn--navi {
    background: var(--dm-primary);
    color: #fff !important;
    border: 1px solid var(--dm-primary);
}
.dm-popup-btn--navi:hover {
    background: var(--dm-primary-dark);
    border-color: var(--dm-primary-dark);
}
