.outway-map-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    border-radius: 12px;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
}

.map-svg-container {
    width: 100%;
    height: auto;
    min-height: 300px;
}

.map-svg-container svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Stylizacja państw */
.map-svg-container svg path {
    transition: fill 0.3s ease, opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
    stroke: #ffffff !important;
    stroke-width: 0.5px !important;
    cursor: default;
    transform-box: fill-box;
    transform-origin: center;
}

path.has-trips {
    cursor: pointer;
}

/* Podświetlenie przy najechaniu - efekt podniesienia (bezpieczny) */
path.has-trips:hover {
    filter: brightness(1.1) drop-shadow(0 3px 5px rgba(0,0,0,0.4));
    transform: scale(1.02);
    stroke-width: 1px !important;
    position: relative;
    z-index: 100;
}

/* Aktywne państwo */
path.has-trips.active {
    filter: brightness(1.2) drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    transform: scale(1.03);
    stroke-width: 1.2px !important;
}

/* Tooltip */
#outway-map-tooltip {
    position: fixed;
    padding: 15px;
    background: #fff;
    color: #1f2937;
    border-radius: 8px;
    font-size: 14px;
    pointer-events: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 1px solid #e5e7eb;
    transform: translate(-50%, -100%);
    margin-top: -10px;
    max-width: 280px;
    max-height: 350px;
    overflow-y: auto;
}

#outway-map-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

#outway-map-tooltip ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

#outway-map-tooltip li {
    margin-bottom: 10px;
    line-height: 1.3;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 8px;
}

#outway-map-tooltip li:last-child {
    border-bottom: none;
}

#outway-map-tooltip li a {
    color: #1f2937;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

#outway-map-tooltip li a:hover {
    color: #3b82f6;
}

#outway-map-tooltip strong {
    display: block;
    font-size: 16px;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 8px;
    margin-bottom: 8px;
    color: #111827;
}

/* Mała etykieta hover z nazwą */
#outway-map-hover-label {
    position: fixed;
    padding: 4px 8px;
    background: rgba(31, 41, 55, 0.9);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1100;
    display: none;
    white-space: nowrap;
    transform: translate(-50%, -100%);
    margin-top: -10px;
}

/* Przyciski regionów */
.map-regions-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.region-btn {
    padding: 10px 20px;
    background: #ff7a30; /* Pomarańczowy ze screena */
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.region-btn:hover {
    background: #e66a26;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.region-btn.active {
    background: #d4591d;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Style dla pinezek na mapie - czarne łezki z pomarańczową obwódką */
.map-pin {
    fill: #000;
    stroke: #ff7a30;
    stroke-width: 0.8px;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
    pointer-events: none;
    transition: transform 0.3s ease;
}

.map-svg-container svg path.active {
    stroke: #000 !important;
    stroke-width: 1.5px !important;
    filter: brightness(1.05);
}

/* Overlay ładowania */
.map-loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.5s ease;
}

.map-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #b63226;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sekcja wycieczek */
.outway-trips-section {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    height: auto;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.outway-trips-section.visible {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
}

.trips-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.trips-header h2 {
    margin: 0;
    font-size: 24px;
    color: #1f2937;
}

.trips-header p {
    margin: 5px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.trip-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f3f4f6;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
}

.trip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.trip-thumb {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
}

.trip-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.trip-content h3 {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.3;
    color: #1f2937;
}

.trip-content p {
    font-size: 14px;
    color: #4b5563;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Kontrola widoczności przez shortcode */
@media (min-width: 769px) {
    .hide-list-desktop .outway-trips-section {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .hide-list-mobile .outway-trips-section,
    .hide-list-mobile .map-mobile-list {
        display: none !important;
    }
}

.map-mobile-list {
    display: none;
}

/* RWD */
@media (max-width: 768px) {
    .outway-map-wrapper {
        padding: 0; /* Więcej miejsca na mobile */
    }

    /* W V3 na mobile ukrywamy ZAWSZE taby i ZAWSZE starą sekcję, 
       chyba że shortcode mówi inaczej (hide-list-mobile) */
    .map-regions-nav {
        display: none !important;
    }
    
    /* Ukrywamy starą sekcję wycieczek, bo mamy akordeon */
    #outway-trips-list {
        display: none !important;
    }

    /* Nowa lista regionów (Accordion) */
    .map-mobile-list {
        display: block;
        margin-top: 10px;
        background: #fff;
        border-top: 1px solid #eee;
    }

    .mobile-region-item {
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-region-header {
        padding: 18px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        font-weight: 700;
        font-size: 17px;
        color: #1f2937;
        transition: all 0.3s;
    }

    .mobile-region-item.active .mobile-region-header {
        color: #ff7a30;
        background: #fffcf9;
    }

    .mobile-region-header .icon {
        font-size: 20px;
        color: #9ca3af;
        transition: transform 0.3s;
    }

    .mobile-region-item.active .mobile-region-header .icon {
        transform: rotate(45deg);
        color: #ff7a30;
    }

    .mobile-region-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
        background: #fff;
    }

    .mobile-region-item.active .mobile-region-content {
        max-height: 1500px;
    }

    .mobile-trips-ul {
        list-style: none;
        padding: 0 0 10px 0;
        margin: 0;
    }

    .mobile-trips-ul li {
        border-top: 1px solid #f9fafb;
    }

    .mobile-trips-ul li a {
        text-decoration: none;
        color: #4b5563;
        font-size: 15px;
        display: block;
        padding: 14px 25px;
        line-height: 1.4;
        transition: background 0.2s;
    }

    .mobile-trips-ul li a:active {
        background: #f3f4f6;
    }

    /* Mniejsza mapa na mobile */
    .map-svg-container {
        height: 250px !important;
        min-height: 250px !important;
    }

    #outway-map-tooltip {
        display: none !important;
    }
}
