/* ==========================================
   KARIERS-COMMON.CSS — стили ТОЛЬКО для страницы каталога карьеров
   Все общие стили (шрифты, навбар, сайдбар, таблицы) — в custom.css
   ========================================== */

/* ==========================================
   ПЕРЕМЕННЫЕ (специфичные для страницы карьеров)
   ========================================== */
:root {
    --gold: #d4af37;
    --gold-dark: #9e791d;
    --gold-light: #f4eac1;
}

/* ==========================================
   ОТСТУП ОТ НАВБАРА
   ========================================== */
.main-container,
.container-fluid.main-container {
    padding-top: 90px !important;
}

@media (max-width: 1199.98px) {
    .main-container,
    .container-fluid.main-container {
        padding-top: 95px !important;
    }
}

@media (max-width: 991.98px) {
    .main-container,
    .container-fluid.main-container {
        padding-top: 100px !important;
    }
}

@media (max-width: 767.98px) {
    .main-container,
    .container-fluid.main-container {
        padding-top: 105px !important;
    }
}

@media (max-width: 575.98px) {
    .main-container,
    .container-fluid.main-container {
        padding-top: 110px !important;
    }
}

/* ==========================================
   ТИПОГРАФИКА
   ========================================== */
.breadcrumb-nav a {
    color: #6b6b6b;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-nav a:hover {
    color: #d4af37;
}

/* ==========================================
   КНОПКИ
   ========================================== */
.btn-gold {
    background: linear-gradient(135deg, #9e791d, #d4af37) !important;
    border: 1px solid #9e791d !important;
    color: #fff !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #d4af37, #e6c84d) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn-gold.btn-sm,
.btn-outline-secondary.btn-sm {
    flex-shrink: 0;
}

.btn-outline-secondary.btn-sm:hover {
    background: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

/* ==========================================
   ХЛЕБНЫЕ КРОШКИ
   ========================================== */
.breadcrumb-nav {
    background: #ffffff;
    border: 1px solid #e6e4df;
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ==========================================
   ЗАГОЛОВОК СТРАНИЦЫ
   ========================================== */
.page-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* ==========================================
   ЗАГОЛОВКИ РЕГИОНОВ
   ========================================== */
.region-header {
    background: rgba(255, 255, 255, 0.9);
    border-left: 4px solid #d4af37;
    padding: 12px 20px;
    margin: 25px 0 15px 0;
    border-radius: 0 10px 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.region-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0d6efd;
}

/* ==========================================
   ХЕДЕР С КНОПКАМИ
   ========================================== */
.header-actions-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.title-block {
    flex: 1;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* ==========================================
   КНОПКИ КАРТЫ И ДОБАВЛЕНИЯ
   ========================================== */
.btn-map {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2d5a27, #4a8c3f);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.3);
    white-space: nowrap;
}

.btn-map:hover {
    background: linear-gradient(135deg, #3a7432, #5da84f);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 90, 39, 0.4);
}

.btn-add-quarry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    white-space: nowrap;
}

.btn-add-quarry:hover {
    background: linear-gradient(135deg, #0b5ed7, #0a58ca);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

/* ==========================================
   КАРТОЧКИ КАРЬЕРОВ
   ========================================== */
.card.card-style {
    background: #ffffff;
    border: 1px solid #e6e4df;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.card.card-style:hover {
    border-color: #d4af37;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-image-container {
    height: 160px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.card-image-container.transshipment-bg {
    background: linear-gradient(135deg, rgba(255, 179, 0, 0.08), rgba(255, 215, 0, 0.04));
}

.card-image-container.karier-bg {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.08), rgba(160, 82, 45, 0.04));
}

.hover-shadow:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.transition-all {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.card-title {
    word-break: break-word;
    hyphens: auto;
}

/* ==========================================
   ИКОНКИ ТИПОВ КАРЬЕРОВ
   ========================================== */
.karier-icon-large {
    font-size: 3.5rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.icon-transshipment {
    color: #ffb300 !important;
}

.icon-karier {
    color: #8B4513 !important;
}

@keyframes swapArrows {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-2px) rotate(-1deg); }
    75% { transform: translateX(2px) rotate(1deg); }
}

.icon-transshipment i {
    animation: swapArrows 2s ease-in-out infinite;
}

/* ==========================================
   ИНФРАСТРУКТУРА
   ========================================== */
.infrastructure-icons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.infra-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e6e4df;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.infra-icon:hover {
    transform: scale(1.1);
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.infra-icon.port {
    color: #0dcaf0;
    border-color: #0dcaf0;
}

.infra-icon.rail {
    color: #795548;
    border-color: #795548;
}

.infra-icon.scales {
    color: #198754;
    border-color: #198754;
}

/* ==========================================
   БЕЙДЖИ И МАТЕРИАЛЫ
   ========================================== */
.badge {
    font-size: 0.7rem;
    padding: 0.3em 0.5em;
}

.material-badge {
    font-size: 0.68rem;
    padding: 0.3em 0.5em;
    line-height: 1.3;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
}

.bg-gold {
    background: linear-gradient(135deg, #9e791d, #d4af37) !important;
}

/* ==========================================
   ПОИСК
   ========================================== */
.search-box .input-group-text {
    border-right: none;
}

.search-box .form-control {
    border-left: none;
    padding-left: 0;
}

.search-box .form-control:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
}

/* ==========================================
   АНИМАЦИИ КАРТОЧЕК
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.karier-card-wrapper {
    animation: fadeInUp 0.5s ease-out;
}

.animate-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-up-delay-1 { animation-delay: 0.1s; }
.animate-up-delay-2 { animation-delay: 0.2s; }
.animate-up-delay-3 { animation-delay: 0.3s; }

.animate-up-observe {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

/* ==========================================
   АККОРДЕОН РЕГИОНА
   ========================================== */
.region-info-accordion .accordion-button::after {
    display: none;
}

.region-info-accordion .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #f8f7f2 0%, #ffffff 100%) !important;
    color: #262626 !important;
    box-shadow: none !important;
    border-radius: 16px 16px 0 0 !important;
}

.region-info-accordion .accordion-button:not(.collapsed) .badge {
    background: linear-gradient(135deg, #6c757d, #495057) !important;
}

.region-info-accordion .accordion-body h2 {
    font-size: 1.3rem;
    color: #262626;
    margin-bottom: 16px;
    font-weight: 700;
}

.region-info-accordion .accordion-body h3 {
    font-size: 1.1rem;
    color: #3a3a3a;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.region-info-accordion .accordion-body ul {
    padding-left: 20px;
    margin-bottom: 16px;
}

.region-info-accordion .accordion-body li {
    margin-bottom: 8px;
}

.region-info-accordion .accordion-collapse {
    transition: all 0.3s ease;
}

/* ==========================================
   СТРАНИЦА КАРТЫ
   ========================================== */
.map-wrapper {
    position: relative;
    width: 100%;
    height: calc(100vh - 56px);
}

#mapContainer {
    width: 100%;
    height: 100%;
}

.map-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-back {
    background: #fff;
    border: 1px solid #e6e4df;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
    color: #262626;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-back:hover {
    background: #f8f9fa;
    border-color: #d4af37;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
    color: #9e791d;
}

.map-counter {
    background: #fff;
    border: 1px solid #e6e4df;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: #6b6b6b;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.legend {
    position: absolute;
    bottom: 30px;
    left: 20px;
    background: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #6b6b6b;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.legend-dot.scheben { background: #4a4a4a; }
.legend-dot.shps { background: #0088cc; }
.legend-dot.pesok { background: #e6a800; }
.legend-dot.dsk { background: #800020; }
.legend-dot.transshipment { background: #2d8a4e; }
.legend-dot.port { background: #1e90ff; }
.legend-dot.inactive { background: #dc3545; }

/* ==========================================
   POPUP НА КАРТЕ
   ========================================== */
.marker-popup {
    font-family: 'Nunito Sans', system-ui, -apple-system, sans-serif;
    min-width: 230px;
    max-width: 280px;
}

.marker-popup h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin: 0 0 6px 0;
    font-size: 0.9rem;
}

.popup-materials {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.material-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
    font-size: 0.72rem;
    line-height: 1.4;
}

.material-label {
    font-weight: 700;
    color: #262626;
    flex-shrink: 0;
}

.material-value {
    color: #6b6b6b;
    word-wrap: break-word;
}

.popup-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    padding: 7px 0;
    background: transparent;
    color: #9e791d;
    border: 2px solid #d4af37;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.2s;
}

.popup-btn:hover {
    background: linear-gradient(135deg, #9e791d, #d4af37);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.popup-infra {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.popup-infra-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid #e6e4df;
}

.popup-infra-icon.scales { color: #198754; }
.popup-infra-icon.rail { color: #795548; }
.popup-infra-icon.port-icon { color: #0dcaf0; }

.tt-popup-content {
    border-radius: 12px !important;
    overflow: visible !important;
    padding: 6px !important;
}

.tt-popup {
    max-width: 300px !important;
}

/* ==========================================
   АДАПТИВНОСТЬ — ПЛАНШЕТЫ (до 991px)
   ========================================== */
@media (max-width: 991.98px) {
    .header-actions-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .action-buttons {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .btn-map,
    .btn-add-quarry {
        flex: 1;
        min-width: 140px;
        justify-content: center;
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    #filterForm .row {
        flex-direction: column;
        gap: 12px;
    }

    #filterForm .col-lg-6 {
        width: 100%;
    }

    #filterForm .d-flex.gap-2 {
        flex-wrap: wrap;
        gap: 8px !important;
    }

    #filterForm select.form-select-sm {
        flex: 1;
        min-width: 0;
    }

    #filterForm .btn-gold,
    #filterForm .btn-outline-secondary {
        width: 34px !important;
        height: 34px !important;
        flex-shrink: 0;
    }

    .card-image-container {
        height: 130px;
    }

    .karier-icon-large {
        font-size: 2.8rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .card-body {
        padding: 12px 14px;
    }

    .card-footer {
        padding: 10px 14px;
    }

    .region-info-accordion .accordion-button {
        font-size: 0.85rem !important;
        padding: 12px 16px !important;
    }

    .region-info-accordion .accordion-body {
        padding: 16px 18px !important;
        font-size: 0.82rem !important;
    }
}

/* ==========================================
   АДАПТИВНОСТЬ — ТЕЛЕФОНЫ (до 767px)
   ========================================== */
@media (max-width: 767.98px) {
    .page-header {
        padding: 16px !important;
        margin-bottom: 16px !important;
    }

    .page-header h1.h2 {
        font-size: 1.35rem;
        margin-bottom: 4px !important;
    }

    .page-header .text-muted {
        font-size: 0.85rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .btn-map,
    .btn-add-quarry {
        width: 100%;
        flex: none;
        padding: 10px 16px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .breadcrumb-nav {
        padding: 10px 14px;
        margin-bottom: 12px;
    }

    .breadcrumb {
        font-size: 0.7rem !important;
    }

    #filterForm .input-group-sm {
        font-size: 0.85rem;
    }

    #filterForm .form-control,
    #filterForm .form-select {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }

    .karier-card-wrapper {
        padding: 0 4px;
        margin-bottom: 8px;
    }

    .card-image-container {
        height: 120px;
    }

    .karier-icon-large {
        font-size: 2.5rem;
    }

    .card-title {
        font-size: 0.95rem;
    }

    .card-text {
        font-size: 0.8rem !important;
    }

    .card-footer {
        font-size: 0.8rem;
    }

    .material-badge {
        font-size: 0.65rem;
        padding: 0.2em 0.4em;
    }

    .infra-icon {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }

    .region-header {
        padding: 10px 14px;
        margin: 20px 0 12px 0;
        flex-wrap: wrap;
        gap: 8px;
    }

    .region-header h2 {
        font-size: 1.2rem;
    }

    .pagination .page-link {
        min-width: 28px;
        padding: 4px 6px;
        font-size: 0.78rem;
    }

    .map-controls {
        top: 10px;
        left: 10px;
        gap: 6px;
    }

    .btn-back {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .legend {
        bottom: 20px;
        left: 10px;
        right: 10px;
        gap: 10px;
        justify-content: center;
    }
}

/* ==========================================
   АДАПТИВНОСТЬ — МАЛЕНЬКИЕ ЭКРАНЫ (до 480px)
   ========================================== */
@media (max-width: 480px) {
    .container-fluid.py-4 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .page-header {
        padding: 12px !important;
        border-radius: 8px !important;
    }

    .page-header h1.h2 {
        font-size: 1.2rem;
    }

    .karier-card-wrapper {
        padding: 0 2px;
        margin-bottom: 6px;
    }

    .card-image-container {
        height: 100px;
    }

    .karier-icon-large {
        font-size: 2rem;
    }

    .card-title {
        font-size: 0.9rem;
        margin-bottom: 4px !important;
    }

    .card-text {
        font-size: 0.75rem !important;
        margin-bottom: 2px !important;
    }

    .card-body {
        padding: 10px;
    }

    .card-footer {
        padding: 8px 10px;
    }

    .position-absolute.top-0.end-0 {
        top: 4px !important;
        right: 4px !important;
    }

    .position-absolute.bottom-0.start-0 {
        bottom: 4px !important;
        left: 4px !important;
        max-width: 60% !important;
    }

    .position-absolute.bottom-0.end-0 {
        bottom: 4px !important;
        right: 4px !important;
    }

    .material-badge {
        font-size: 0.6rem;
        padding: 0.15em 0.35em;
    }

    .infra-icon {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }

    #filterForm .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    #filterForm select.form-select-sm {
        width: calc(50% - 4px);
        min-width: 0;
        flex: none;
    }

    .pagination .page-link {
        min-width: 24px;
        padding: 3px 5px;
        font-size: 0.72rem;
    }

    .region-info-accordion .accordion-button {
        font-size: 0.8rem !important;
        padding: 10px 12px !important;
    }

    .region-info-accordion .accordion-body {
        padding: 12px 14px !important;
        font-size: 0.78rem !important;
    }

    .row.g-3.mb-4 {
        --bs-gutter-y: 0.5rem;
        margin-bottom: 1rem !important;
    }
}

/* ==========================================
   ШИРОКИЕ ЭКРАНЫ (от 1400px)
   ========================================== */
@media (min-width: 1400px) {
    .karier-card-wrapper {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .card-image-container {
        height: 180px;
    }

    .karier-icon-large {
        font-size: 4rem;
    }

    .card-title {
        font-size: 1.15rem;
    }

    .container-fluid.py-4 {
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* ==========================================
   ПРОМЕЖУТОЧНЫЕ ЭКРАНЫ (768px - 1200px)
   ========================================== */
@media (max-width: 1200px) and (min-width: 768px) {
    #filterForm select.form-select-sm {
        min-width: 100px;
        font-size: 0.8rem;
    }

    #filterForm .text-muted.small {
        display: none !important;
    }
}

/* ==========================================
   ОТСТУПЫ ДЛЯ СЕТКИ КАРТОЧЕК
   ========================================== */
.row.g-3 {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
}

@media (max-width: 576px) {
    .row.g-3 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
}

/* ==========================================
   БАЗОВЫЕ ОТСТУПЫ КОНТЕНТА
   ========================================== */
.container-fluid.py-4 {
    padding-left: 16px !important;
    padding-right: 16px !important;
}