.category-page {
    padding-bottom: 4rem;
}

.category-hero {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.12), rgba(0, 123, 255, 0.02));
    padding: 3.5rem 1.5rem;
    margin: 0 -2rem 2rem;
}

@media (min-width: 768px) {
    .category-hero {
        padding: 4.5rem 0;
        margin: 0 0 3rem;
    }
}

.category-hero .container {
    max-width: 1100px;
    margin: 0 auto;
}

.category-breadcrumb {
    font-size: 0.95rem;
    color: rgba(33, 37, 41, 0.65);
    margin-bottom: 0.5rem;
}

.category-title {
    font-size: clamp(2rem, 3vw, 2.8rem);
    margin: 0 0 0.75rem;
    color: #0a2540;
}

.category-subtitle {
    font-size: 1.05rem;
    color: rgba(33, 37, 41, 0.75);
    margin: 0 0 1.5rem;
}

.category-subtitle--warning {
    color: #c53030;
    margin-top: 0.75rem;
}

.category-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pin-count {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    color: #0a2540;
    box-shadow: 0 10px 30px rgba(15, 35, 95, 0.12);
}

.location-filters {
    margin-top: 2rem;
}

.filters-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(10, 37, 64, 0.08);
    box-shadow: 0 18px 40px rgba(10, 37, 64, 0.08);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filters-card__search {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.filters-card__label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0a2540;
}

.input-with-icon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f5f7fb;
    border: 1px solid rgba(10, 37, 64, 0.08);
    border-radius: 14px;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-with-icon:focus-within {
    background: #fff;
    border-color: rgba(0, 123, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.input-with-icon i {
    color: rgba(10, 37, 64, 0.55);
    font-size: 0.95rem;
}

.filter-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #0a2540;
    outline: none;
    padding: 0;
}

.filter-input::placeholder {
    color: rgba(10, 37, 64, 0.45);
}

.clear-input-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(10, 37, 64, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.clear-input-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.clear-input-btn:hover {
    background: rgba(10, 37, 64, 0.08);
    color: #0a2540;
}

.filters-grid {
    display: grid;
    gap: 1.15rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.filter-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-control label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0a2540;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: #f5f7fb;
    border: 1px solid rgba(10, 37, 64, 0.08);
    border-radius: 14px;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.select-wrapper:focus-within {
    background: #fff;
    border-color: rgba(0, 123, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.select-wrapper i {
    color: rgba(10, 37, 64, 0.55);
    font-size: 0.95rem;
}

.select-wrapper::after {
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 16px;
    color: rgba(10, 37, 64, 0.45);
    font-size: 0.9rem;
    pointer-events: none;
}

.filter-select {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: #0a2540;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
}

.filter-select:disabled {
    color: rgba(10, 37, 64, 0.45);
    cursor: not-allowed;
}

.filter-select option {
    color: #0a2540;
}

.category-results .container {
    max-width: 1100px;
    margin: 0 auto;
}

.category-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .category-layout {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        align-items: start;
    }
}

.category-map-card,
.category-list-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(10, 37, 64, 0.08);
    overflow: hidden;
    border: 1px solid rgba(10, 37, 64, 0.08);
}

.category-map-card .card-header,
.category-list-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.75rem;
    border-bottom: 1px solid rgba(10, 37, 64, 0.08);
}

.category-layout.is-map-expanded .category-list-card {
    display: none;
}

@media (min-width: 992px) {
    .category-layout.is-map-expanded {
        grid-template-columns: 1fr;
    }
}

.btn-icon {
    background: none;
    border: 1px solid #e1e1e1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

.btn-icon:hover {
    background-color: #f0f0f0;
}

.btn-icon i {
    font-size: 16px;
}

.category-map-card .card-header h2,
.category-list-card .card-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    color: #0a2540;
}

.card-subtitle {
    margin: 0;
    color: rgba(33, 37, 41, 0.6);
    font-size: 0.95rem;
}

.map-wrapper {
    height: 520px;
}

#category-map {
    width: 100%;
    height: 100%;
}

.category-list-card {
    display: flex;
    flex-direction: column;
}

.pins-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(10, 37, 64, 0.06);
    color: rgba(33, 37, 41, 0.7);
}

.pins-status.is-hidden {
    display: none;
}

.pins-status.is-error {
    color: #c53030;
    background: rgba(197, 48, 48, 0.08);
}

.pins-status.is-empty {
    background: rgba(12, 166, 120, 0.08);
    color: #0a6847;
}

.pins-status .status-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 123, 255, 0.12);
}

.pins-status.is-error .status-icon {
    background: rgba(197, 48, 48, 0.18);
}

.pins-status.is-empty .status-icon {
    background: rgba(12, 166, 120, 0.18);
}

.spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid rgba(0, 123, 255, 0.2);
    border-top-color: rgba(0, 123, 255, 0.8);
    animation: spinner-rotate 0.8s linear infinite;
    display: inline-block;
}

@keyframes spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

.pin-list-container {
    max-height: 600px;
    overflow-y: auto;
    padding: 1.75rem;
}

.pin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.pagination-controls {
    padding: 1.5rem 1.75rem;
    text-align: center;
    border-top: 1px solid rgba(10, 37, 64, 0.08);
}

.pin-card {
    background: #f9fbff;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid rgba(10, 37, 64, 0.05);
    box-shadow: 0 10px 25px rgba(15, 35, 95, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pin-card.is-active {
    background: #eef4ff;
    border-color: rgba(10, 37, 64, 0.45);
    box-shadow: 0 24px 55px rgba(10, 37, 64, 0.22);
    transform: translateY(-4px);
}

.pin-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(10, 37, 64, 0.12);
}

.pin-card.is-active .pin-card__link,
.pin-card:focus .pin-card__link {
    background: #0057d9;
}

.pin-card:focus-visible {
    outline: 3px solid rgba(0, 123, 255, 0.45);
    outline-offset: 4px;
}

.pin-card__header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pin-card__image {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    background-color: #f0f4f8;
}

.pin-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(0, 123, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.pin-card__title-group h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #0a2540;
}

.pin-card__category {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: rgba(33, 37, 41, 0.6);
}

.pin-card__description {
    margin: 0;
    color: rgba(33, 37, 41, 0.8);
    font-size: 0.95rem;
    line-height: 1.6;
}

.pin-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pin-card__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    background: #0a2540;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.pin-card__link:hover {
    background: #0f3270;
    transform: translateY(-1px);
}

.leaflet-marker-icon,
.leaflet-div-icon {
    transition: transform 0.2s ease, filter 0.2s ease;
}

.leaflet-marker-icon.is-active,
.leaflet-div-icon.is-active {
    transform: scale(1.12);
    filter: drop-shadow(0 0 8px rgba(10, 37, 64, 0.35));
    z-index: 1000 !important;
}

.pin-popup {
    max-width: 240px;
}

.pin-popup h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

.pin-popup p {
    margin: 0 0 0.75rem;
    color: rgba(33, 37, 41, 0.75);
    font-size: 0.9rem;
}

.pin-popup__link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.pin-popup__link:hover {
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .category-map-card .card-header,
    .category-list-card .card-header {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .pin-grid {
        padding: 1.25rem;
    }

    .filters-card {
        padding: 1.25rem;
        gap: 1.25rem;
    }
}

/* --- Category Controls --- */
.category-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.toggle-label {
    font-size: 0.95rem;
    color: #0a2540;
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #007bff;
}

input:focus + .slider {
    box-shadow: 0 0 1px #007bff;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* --- Map Icon Styles --- */
.custom-map-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    transition: transform 0.2s ease;
}

.custom-map-icon i {
    font-size: 16px;
    -webkit-text-stroke: 1px white;
}

.custom-map-icon.is-related {
    transform: scale(0.75);
    opacity: 0.8;
}
