/* ─── PVZ Map Module — COS-style for checkout ─── */

/* ─── Container ─── */
.pvz-wrap {
    margin-top: 20px;
}

/* ─── Search ─── */
.pvz-search-wrap {
    position: relative;
    margin-bottom: 12px;
}
.pvz-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}
.pvz-search-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}
.pvz-search-input {
    width: 100%;
    height: 44px;
    padding: 0 12px 0 36px;
    border: 1px solid #ddd;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    color: #222;
    background: #fff;
    transition: border-color 0.15s;
}
.pvz-search-input:focus {
    border-color: #222;
}
.pvz-search-input::placeholder {
    color: #bbb;
}

/* Search dropdown */
.pvz-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}
.pvz-search-dropdown--open {
    display: block;
}
.pvz-search-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}
.pvz-search-item:hover {
    background: #f9f9f9;
}
.pvz-search-item:last-child {
    border-bottom: none;
}
.pvz-search-item__city {
    font-size: 0.78rem;
    font-weight: 600;
    color: #222;
    letter-spacing: 0.04em;
}
.pvz-search-item__address {
    font-size: 0.72rem;
    color: #777;
    margin-top: 2px;
}
.pvz-search-item__badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 2px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 4px;
    vertical-align: middle;
}
.pvz-search-item__badge--cdek {
    background: #34c759;
    color: #fff;
}

/* ─── Map ─── */
.pvz-map-container {
    position: relative;
    border: 1px solid #eee;
    overflow: hidden;
}
.pvz-map {
    width: 100%;
    height: 400px;
    background: #f5f5f5;
}

/* ─── Selected PVZ card ─── */
.pvz-card {
    display: none;
    border: 1px solid #eee;
    border-top: none;
    padding: 16px;
    background: #fff;
}
.pvz-card--visible {
    display: block;
}
.pvz-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.pvz-card__badge {
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #34c759;
    color: #fff;
    flex-shrink: 0;
}
.pvz-card__code {
    font-size: 0.78rem;
    font-weight: 600;
    color: #222;
}
.pvz-card__close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 0;
    display: flex;
    align-items: center;
}
.pvz-card__close:hover {
    color: #222;
}
.pvz-card__close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Details */
.pvz-card__detail {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.78rem;
    color: #555;
}
.pvz-card__detail:last-child {
    margin-bottom: 0;
}
.pvz-card__detail-icon {
    flex-shrink: 0;
    color: #999;
    margin-top: 1px;
}
.pvz-card__detail-icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}
.pvz-card__detail-text {
    line-height: 1.4;
}
.pvz-card__detail-city {
    font-size: 0.72rem;
    color: #999;
    margin-top: 1px;
}
.pvz-card__loading {
    color: #999;
    font-style: italic;
}

/* Select button */
.pvz-card__select {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 12px;
    background: #222;
    color: #fff;
    border: none;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
    font-family: inherit;
}
.pvz-card__select:hover {
    background: #000;
}

/* ─── Loading overlay ─── */
.pvz-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    font-size: 0.82rem;
    color: #999;
    letter-spacing: 0.05em;
}
.pvz-loading__spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #eee;
    border-top-color: #222;
    border-radius: 50%;
    animation: pvz-spin 0.6s linear infinite;
    margin-right: 8px;
}
@keyframes pvz-spin {
    to { transform: rotate(360deg); }
}

/* ─── Selected PVZ display in checkout form ─── */
.pvz-selected-display {
    display: none;
    padding: 12px;
    border: 1px solid #34c759;
    background: #f8fff8;
    margin-top: 12px;
    font-size: 0.78rem;
}
.pvz-selected-display--visible {
    display: block;
}
.pvz-selected-display__title {
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
}
.pvz-selected-display__address {
    color: #555;
    line-height: 1.4;
}
.pvz-selected-display__detail {
    color: #555;
    line-height: 1.4;
    margin-top: 3px;
}
.pvz-selected-display__change {
    margin-top: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #222;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 899px) {
    .pvz-map {
        height: 50vh;
        min-height: 280px;
    }
    .pvz-search-input {
        height: 40px;
    }
    .pvz-card {
        padding: 12px;
    }
    .pvz-card__select {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .pvz-map {
        height: 45vh;
        min-height: 240px;
    }
}

/* Yandex Maps balloon overrides */
.pvz-wrap [class*='balloon_layout_normal'] {
    border: 1px solid #ccc;
    max-width: 275px;
}
