/**
 * Offer Aside Card — style komponentu karty na stronie show
 */

/* ============================================
   ASIDE — wrapper sticky
   ============================================ */

.offer-body-aside {
    width: 360px;
    flex-shrink: 0;
}

/* Sticky — w pełni kontrolowane przez JS (body ma overflow:hidden co blokuje CSS sticky) */
.offer-aside-sticky {
    position: relative;
}

/* ============================================
   KARTA — wrapper główny
   ============================================ */

.offer-aside-card {
    border-radius: 8px;
    overflow: hidden;
    border: 0.5px solid var(--color-light-gray);
    background: var(--color-white);
}

/* ============================================
   GRAFICZNA CZĘŚĆ KARTY — 4/5 aspect-ratio, bg-image
   ============================================ */

.offer-aside-card-graphic {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    width: 100%;
}

.offer-aside-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    z-index: 0;
}

/* ── Pills ticker — klasy job-card-band-top / job-card-pills / job-card-pill
      dziedziczone z card.css; tu tylko korekta pozycji ── */

.offer-aside-card-graphic .job-card-band-top {
    position: relative;
    z-index: 20;
}

/* ── Pasek numeru oferty — styl identyczny jak job-card-salary-wrap, prawa strona ── */

.offer-aside-number-wrap {
    position: absolute;
    top: 42px;
    right: 0;
    z-index: 20;
    max-width: 82%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.offer-aside-number {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    height: 44px;
    padding: 0 14px 0 0;
    min-width: 135px;
    background-color: var(--color-primary);
}

/* ukośna lewa krawędź — identyczna jak job-card-salary::before */
.offer-aside-number::before {
    content: '';
    position: absolute;
    top: 0;
    left: -44px;
    border-top: 44px solid var(--color-primary);
    border-left: 44px solid transparent;
}

.offer-aside-number-label {
    font-family: var(--font-condensed);
    font-size: 10px;
    font-weight: 500;
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1;
    margin-bottom: 1px;
}

.offer-aside-number-text {
    font-family: var(--font-condensed);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}

/* ── Title band — ukryty na desktop, widoczny tylko na mobile ── */

.offer-aside-title-wrap {
    display: none;
    overflow: hidden;
    margin: -16px -16px 0 -16px;
}

.offer-aside-title-wrap::after {
    content: none;
}

.offer-aside-title {
    display: flex;
    align-items: center;
    overflow: hidden;
    font-family: var(--font-condensed);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    padding: 14px 14px;
    background: var(--color-primary);
    position: relative;
}

/* ── Lokalizacja — info-wrap dziedziczone z card.css ── */

.offer-aside-info-wrap {
    bottom: 0 !important;
    transform: translateY(0) !important;
    transition: none !important;
    z-index: 20 !important;
}

/* ============================================
   BODY KARTY — salary, CTA, progress, akcje
   ============================================ */

.offer-aside-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--color-white);
}

/* ── Salary ── */

.offer-aside-salary-label,
.offer-aside-languages-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--color-dark-gray);
}

.offer-aside-salary-rows {
    display: flex;
    flex-direction: column;
}

.offer-aside-salary-row {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 0.5px solid var(--color-light-gray);
}

.offer-aside-salary-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.offer-aside-salary-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-secondary);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.offer-aside-salary-meta {
    font-size: 13px;
    font-weight: 400;
    color: var(--color-dark-gray);
}

.offer-aside-salary-contract {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-dark-gray);
    margin-top: 2px;
    line-height: 1.3;
}

.offer-aside-salary-negotiable {
    font-size: 16px;
    color: var(--color-secondary);
    font-weight: 500;
}

/* ── Wymagane języki ── */

.offer-aside-languages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.offer-aside-languages-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.offer-aside-language {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.offer-aside-language-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-secondary);
    line-height: 1.25;
}

/* Skala A1-C2: szare poniżej minimum, ciemny segment = minimum, wyższe poziomy też spełniają wymaganie */
.offer-aside-language-scale {
    flex-shrink: 0;
    display: flex;
    gap: 2px;
}

.offer-aside-language-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 20px;
    background: var(--color-light-gray);
    color: var(--color-white);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.offer-aside-language-segment:first-child {
    border-radius: 4px 0 0 4px;
}

.offer-aside-language-segment:last-child {
    border-radius: 0 4px 4px 0;
}

.offer-aside-language-segment.is-above {
    background: var(--color-primary-light);
}

.offer-aside-language-segment.is-minimum {
    background: var(--color-primary-dark);
}

/* ── Divider ── */

.offer-aside-divider {
    height: 0.5px;
    background: var(--color-light-gray);
    margin: 0;
}

/* ── Przycisk aplikuj ── */

.offer-aside-btn-apply {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--color-primary);
    color: var(--color-white);
    font-family: var(--font-condensed);
    font-size: 16px;
    font-weight: 700;
    padding: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s;
}

.offer-aside-btn-apply:hover {
    background: var(--color-primary-dark);
    color: var(--color-white);
    text-decoration: none;
}

.offer-aside-btn-apply.is-disabled {
    background: var(--color-light-gray);
    color: var(--color-dark-gray);
    cursor: not-allowed;
    pointer-events: none;
}

.offer-aside-archived-note {
    font-size: 13px;
    color: var(--color-dark-gray);
    line-height: 1.5;
    margin: 0;
}

/* ── Progress bar ważności ── */

.offer-aside-progress {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.offer-aside-progress-bar {
    height: 6px;
    background: var(--color-light-gray);
    border-radius: 3px;
    overflow: hidden;
}

.offer-aside-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.offer-aside-progress-label {
    font-size: 13px;
    color: var(--color-dark-gray);
    line-height: 1.3;
}

/* ── Akcje: dodaj do ulubionych + udostępnij ── */

.offer-aside-actions {
    display: flex;
    gap: 8px;
}

.offer-aside-btn-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-condensed);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-secondary);
    background: transparent;
    border: 0.5px solid var(--color-light-gray);
    border-radius: 6px;
    padding: 9px 0;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.offer-aside-btn-action:hover {
    border-color: var(--color-secondary);
    background: var(--color-secondary);
    color: var(--color-white);
}

/* Share wrap — flex: auto żeby nie rozciągał się jak flex: 1 */
.offer-aside-share-wrap {
    position: relative;
    flex: 0 0 auto;
}

.offer-aside-share-wrap .offer-aside-btn-share {
    flex: none;
    padding-left: 14px;
    padding-right: 14px;
}

@media (max-width: 480px) {
    .offer-aside-btn-action:not(.offer-aside-btn-share) {
        padding-left: 12px;
        padding-right: 12px;
    }
}
.offer-card-mobile {
    display: none;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.offer-card-mobile .offer-aside-card {
    width: 100%;
    box-sizing: border-box;
}

.offer-card-mobile .offer-aside-card-graphic {
    width: 100%;
    box-sizing: border-box;
}

/* ── Share dropdown ── */

.offer-aside-share-wrap {
    position: relative;
    flex: 0 0 auto;
}

.offer-aside-share-wrap .offer-aside-btn-share {
    flex: 1;
    width: 100%;
}

.offer-aside-share-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    width: 200px;
    background: var(--color-secondary);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    z-index: 200;
}

.offer-aside-share-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Trójkąt — strzałka w dół */
.offer-aside-share-dropdown::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 18px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--color-secondary);
}

.offer-aside-share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--color-white);
    font-family: var(--font-condensed);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s;
    text-align: left;
    line-height: 1.2;
}

.offer-aside-share-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-white);
    text-decoration: none;
}

.offer-aside-share-item svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.offer-aside-share-divider {
    height: 0.5px;
    background: rgba(255, 255, 255, 0.15);
    margin: 4px 6px;
}

.offer-aside-share-copy-label {
    transition: opacity 0.15s;
}

/* ── Marker — identyczny z job-list-map.css ──────────────── */

.hirvu-marker {
    position: relative;
    width: 22px;
    height: 46px;
    animation: hirvu-bounce 2s ease-in-out infinite;
    transform-origin: bottom center;
}

.hirvu-marker-head {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-primary);
    z-index: 2;
}

.hirvu-marker-inner {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-secondary);
    z-index: 3;
}

.hirvu-marker-tail {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 16px solid var(--color-primary);
    z-index: 1;
}

.hirvu-marker-ring1 {
    position: absolute;
    top: 0;
    left: 50%;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: hirvu-pulse 2.4s ease-out infinite;
    animation-fill-mode: both;
    z-index: 1;
}

.hirvu-marker-ring2 {
    position: absolute;
    top: 0;
    left: 50%;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: hirvu-pulse 2.4s ease-out infinite 0.9s;
    animation-fill-mode: both;
    z-index: 1;
}

.hirvu-marker-shadow {
    position: absolute;
    bottom: -14px;
    left: 50%;
    width: 14px;
    height: 5px;
    border-radius: 50%;
    background: rgba(227, 10, 108, 0.35);
    animation: hirvu-shadow 2s ease-in-out infinite;
}

@keyframes hirvu-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

@keyframes hirvu-shadow {
    0%, 100% { transform: translateX(-50%) scale(1);    opacity: 0.35; }
    50%       { transform: translateX(-50%) scale(0.65); opacity: 0.15; }
}

@keyframes hirvu-pulse {
    0%   { transform: translate(-50%, 0) scale(1);   opacity: 0.5; }
    100% { transform: translate(-50%, 0) scale(2.8); opacity: 0; }
}

/* ============================================
   TOGGLE MAPY — przycisk w grafice karty
   ============================================ */

.offer-aside-map-toggle {
    position: absolute;
    top: 93px;
    right: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--color-secondary);
    color: var(--color-white);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-family: var(--font-condensed);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.offer-aside-map-toggle:hover {
    background: var(--color-primary);
}

.offer-aside-map-toggle.is-active {
    background: var(--color-secondary);
}

.offer-aside-map-toggle svg {
    flex-shrink: 0;
}

.offer-aside-map-toggle-label {
    flex-shrink: 0;
}

.offer-aside-map-switch-track {
    width: 32px;
    height: 18px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 9px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.offer-aside-map-toggle.is-active .offer-aside-map-switch-track {
    background: rgba(255, 255, 255, 0.7);
}

.offer-aside-map-switch-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: left 0.2s ease;
}

.offer-aside-map-toggle.is-active .offer-aside-map-switch-thumb {
    left: 17px;
}

/* ============================================
   MAPA W KARCIE
   ============================================ */

.offer-aside-map {
    position: absolute;
    inset: 0;
    z-index: 15;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.offer-aside-map.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Leaflet zoom — identyczne z job-list-map.css */

.offer-aside-map .leaflet-control-zoom {
    border: none !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.offer-aside-map .leaflet-bottom.leaflet-right {
    top: 137px;
    right: 0;
}

.offer-aside-map .leaflet-control-zoom-in,
.offer-aside-map .leaflet-control-zoom-out {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: none !important;
    background: var(--color-secondary) !important;
    color: var(--color-white) !important;
    font-size: 18px !important;
    line-height: 32px !important;
    text-align: center !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    transition: background 0.2s ease !important;
}

.offer-aside-map .leaflet-control-zoom-in:hover,
.offer-aside-map .leaflet-control-zoom-out:hover {
    background: var(--color-primary-dark) !important;
    color: var(--color-white) !important;
}

.offer-aside-map .leaflet-control-zoom-in.leaflet-disabled,
.offer-aside-map .leaflet-control-zoom-out.leaflet-disabled {
    background: var(--color-secondary) !important;
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

/* Attribution */

.offer-aside-map .map-attribution {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 22px;
    z-index: 1000;
    background: var(--color-secondary-dark);
    padding: 2px 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 0;
    pointer-events: none;
    text-align: right;
}

.offer-aside-map .map-attribution a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    pointer-events: all;
}

.offer-aside-map .map-attribution a:hover {
    color: var(--color-white);
    text-decoration: underline;
}

/* ============================================
   POPUP MAPY — styl identyczny z listą ofert
   ============================================ */

.offer-aside-map .hirvu-popup .leaflet-popup-content-wrapper {
    background: var(--color-secondary);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    padding: 0;
    overflow: hidden;
    min-width: 140px;
}

.offer-aside-map .hirvu-popup .leaflet-popup-content {
    margin: 0;
}

.offer-aside-map .hirvu-popup .leaflet-popup-tip-container {
    display: none;
}

.offer-aside-map .hirvu-popup .leaflet-popup-content-wrapper::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--color-secondary);
}

.offer-aside-map .hirvu-popup .leaflet-popup-close-button {
    top: -9px !important;
    right: -9px !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    font-size: 20px !important;
    line-height: 20px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.offer-aside-map .hirvu-popup .leaflet-popup-close-button:hover {
    background: var(--color-primary-dark) !important;
}

.map-popup-location {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    gap: 2px;
}

.map-popup-place {
    font-family: var(--font-condensed);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.3;
}

.map-popup-subdivision {
    font-family: var(--font-condensed);
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.3;
}

.map-popup-country {
    font-family: var(--font-condensed);
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.3;
}

/* ============================================
   RESPONSIVE — tablet i mobile (≤ 860px)
   ============================================ */

@media (max-width: 860px) {
    .offer-body-aside {
        display: none;
    }

    .offer-card-mobile {
        display: block;
    }

    .offer-aside-card {
        max-width: 100%;
        margin: 0 auto;
    }

    .offer-aside-sticky {
        position: static;
    }

    .offer-aside-card-graphic {
        max-height: 380px;
    }

    .offer-aside-title-wrap {
        display: block;
    }

    .offer-title {
        display: none;
    }
}