/* ── parking-grid.css — Схема парковки по плану ── */

/* Враппер секции */
.g-park-grid.gp-plan-root {
    display: block;
    padding: 10px 8px 14px;
    min-height: 0;
}

/* Главный холст — соотношение сторон как у плана (~1000:570) */
.gp-plan {
    position: relative;
    width: 100%;
    aspect-ratio: 1000 / 570;
    min-height: 340px;
    max-height: min(76vh, 700px);
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;

    /* Асфальт: тёмно-серый + тонкая сетка */
    background:
        linear-gradient(rgba(12,14,20,.9), rgba(12,14,20,.9)),
        repeating-linear-gradient(0deg, transparent, transparent 38px, rgba(255,255,255,.03) 39px),
        repeating-linear-gradient(90deg, transparent, transparent 38px, rgba(255,255,255,.03) 39px);
    box-shadow: inset 0 0 0 1.5px rgba(48,54,61,.6);
}

/* Полосы проезда */
.gp-lane {
    position: absolute;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 0;
}
.gp-lane--h {
    left: 0; right: 0;
    background: rgba(24,28,36,.65);
    border-top: 1px solid rgba(55,62,70,.45);
    border-bottom: 1px solid rgba(55,62,70,.45);
}
.gp-lane--v {
    top: 0; bottom: 0;
    background: rgba(24,28,36,.65);
    border-left: 1px solid rgba(55,62,70,.45);
    border-right: 1px solid rgba(55,62,70,.45);
}
/* Центральная разметка (штрихпунктир) */
.gp-lane--h .gp-lane-line,
.gp-lane--v .gp-lane-line {
    position: absolute;
    background: repeating-linear-gradient(90deg, rgba(220,185,30,.35) 0 18px, transparent 18px 34px);
    left: 0; right: 0;
    height: 1.5px;
    top: 50%; transform: translateY(-50%);
}
.gp-lane--v .gp-lane-line {
    background: repeating-linear-gradient(0deg, rgba(220,185,30,.35) 0 18px, transparent 18px 34px);
    top: 0; bottom: 0; left: 50%; right: auto;
    width: 1.5px; height: auto; transform: translateX(-50%);
}

/* Разделитель «спина к спине» между строками острова */
.gp-divider {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    left: 18%; right: calc(100% - 67%);
    height: 2px;
    background: repeating-linear-gradient(90deg, rgba(88,166,255,.25) 0 8px, transparent 8px 14px);
}

/* Место (блок) */
.gp-spot.gp-scheme {
    position: absolute;
    box-sizing: border-box;
    border-radius: 4px;
    cursor: pointer;
    z-index: 2;
    transition: filter .13s, box-shadow .13s;
    overflow: visible;
    /* убираем старые flex-размеры */
    width: auto; height: auto; min-width: 0; min-height: 0;
    padding: 0; gap: 0;
    touch-action: manipulation;
}
.gp-spot.gp-scheme:hover { filter: brightness(1.25); z-index: 10; }
.gp-spot.gp-scheme:active { filter: brightness(1.4); }

/* Состояния */
.gp-spot.gp-scheme.free {
    background: rgba(22,27,34,.85);
    border: 1px solid rgba(55,62,70,.8);
}
.gp-spot.gp-scheme.free:hover {
    border-color: rgba(63,185,80,.8);
    background: rgba(18,48,28,.7);
    box-shadow: 0 0 0 1px rgba(63,185,80,.4);
}
.gp-spot.gp-scheme.occ {
    background: rgba(20,40,75,.9);
    border: 1px solid rgba(31,111,235,.7);
    box-shadow: inset 0 0 0 0.5px rgba(88,166,255,.15);
}
.gp-spot.gp-scheme.mon {
    background: rgba(38,20,65,.9);
    border: 1px solid rgba(163,113,247,.7);
    box-shadow: inset 0 0 0 0.5px rgba(192,132,252,.15);
}

/* Внутренний блок (контрротация для наклонных) */
.gp-spot-inner {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    padding: 1px 1px 2px;
    gap: 0;
}

/* Номер места */
.gp-spot.gp-scheme .gp-spot-num {
    position: static;
    font-size: clamp(6px, 0.7vw, 9px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: .03em;
    color: rgba(140,150,165,.85);
    margin-bottom: 1px;
    font-family: var(--mono, monospace);
    white-space: nowrap;
}
.gp-spot.gp-scheme.occ .gp-spot-num { color: rgba(120,170,255,.9); }
.gp-spot.gp-scheme.mon .gp-spot-num { color: rgba(192,132,252,.9); }

/* SVG-иконка авто */
.gp-spot.gp-scheme .gp-spot-icon {
    width: 90%; height: clamp(10px, 1.5vw, 18px);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    pointer-events: none;
    color: rgba(60,120,200,.75);
}
.gp-spot.gp-scheme.mon .gp-spot-icon { color: rgba(163,113,247,.85); }
.gp-spot.gp-scheme.free .gp-spot-icon { display: none; }
.gp-spot.gp-scheme .gp-spot-icon svg { width: 100%; height: 100%; }

/* Номерной знак */
.gp-spot.gp-scheme .gp-spot-plate {
    font-family: var(--mono, monospace);
    font-size: clamp(5px, 0.65vw, 8px);
    font-weight: 800;
    color: rgba(201,209,217,.9);
    letter-spacing: .03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 97%;
    line-height: 1;
    pointer-events: none;
}

/* «Плюс» для свободного */
.gp-spot.gp-scheme.free .gp-spot-plus {
    font-size: clamp(11px, 2vw, 18px);
    color: rgba(80,100,120,.5);
    line-height: 1;
    transition: color .12s;
}
.gp-spot.gp-scheme.free:hover .gp-spot-plus { color: rgba(63,185,80,.8); }

/* Метка М (месячный) */
.gp-spot.gp-scheme .gp-spot-badge {
    position: absolute; top: 1px; right: 2px;
    font-size: clamp(5px, 0.55vw, 7px);
    font-weight: 900; color: #c4b5fd;
    background: rgba(163,113,247,.3);
    padding: 0 2px; border-radius: 2px;
    line-height: 1.4; pointer-events: none;
}

/* Последнее авто на месте */
.gp-spot.gp-scheme .gp-spot-prev {
    position: static;
    transform: none;
    font-family: var(--mono, monospace);
    font-size: clamp(4px, 0.5vw, 6px);
    color: rgba(100,115,135,.6);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 97%; line-height: 1; margin-top: 1px; pointer-events: none;
}

/* Landmark (ШИНОМОНТАЖ, Охрана) */
.gp-landmark {
    position: absolute;
    box-sizing: border-box;
    border-radius: 6px;
    display: flex;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 4px 6px;
    pointer-events: none;
    z-index: 3;
}
.gp-landmark span {
    font-size: clamp(7px, 1.1vw, 11px);
    font-weight: 900;
    letter-spacing: .06em;
    line-height: 1.2;
}
.gp-landmark--tire {
    border: 1.5px dashed rgba(210,153,34,.6);
    background: rgba(40,30,10,.55);
    color: rgba(242,204,96,.9);
}
.gp-landmark--guard {
    border: 1.5px solid rgba(31,111,235,.55);
    background: rgba(10,22,45,.6);
    color: rgba(125,184,255,.95);
}

/* Тулбар над схемой */
.gp-toolbar {
    display: flex; align-items: center; gap: 8px;
    padding: 0 4px 8px; flex-wrap: wrap;
}
.gp-toolbar-hint {
    font-size: 11px; color: var(--dim, #6e7681);
    letter-spacing: .02em; font-weight: 500;
}

/* Адаптив */
@media (max-width: 700px) {
    .gp-plan { min-height: 260px; }
}
