/* Font and Base Styles */
* {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Color Palette Variables */
:root {
    --color-black: #0A0A0A;
    --color-gold: #EAB308;
    --color-white: #F9FAFB;
    --color-emerald: #047857;
    --color-purple: #4C1D95;

    /* Theme Variables - Dark */
    --bg-primary: var(--color-black);
    --bg-secondary: #1A1A1A;
    --bg-tertiary: #2A2A2A;
    --text-primary: var(--color-white);
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;
    --accent-primary: var(--color-gold);
    --accent-secondary: var(--color-emerald);
    --accent-tertiary: var(--color-purple);
    --border-color: #374151;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-light: rgba(0, 0, 0, 0.2);
    --accent-hover: rgba(234, 179, 8, 0.1);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: var(--color-white);
    --bg-secondary: #F3F4F6;
    --bg-tertiary: #E5E7EB;
    --text-primary: var(--color-black);
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --border-color: #D1D5DB;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-light: rgba(0, 0, 0, 0.05);
    --accent-hover: rgba(234, 179, 8, 0.08);
}

/* Global Styles */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

body.modal-open {
    overflow: hidden;
}

.page-404 {
    min-height: 100vh;
}

.error-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    background: var(--bg-primary);
}

.error-page__card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 18px 48px var(--shadow-light);
    padding: 40px 36px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.error-page__badge {
    display: inline-flex;
    align-self: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--color-black);
    font-weight: 700;
    font-size: 20px;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.08em;
}

.error-page__title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.error-page__text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.error-page__action {
    margin-top: 8px;
}

/* Header Styles */
.header-container {
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow-light);
    z-index: 1000;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
}

.header-brand,
.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-controls {
    margin-left: auto;
}

.header-brand {
    min-width: 0;
}


/* Main Container */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Desktop Layout */
.desktop-layout {
    display: flex;
    height: 100%;
}

.mobile-layout {
    display: none;
    flex-direction: column;
    height: 100%;
}

.map-app-chooser {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 11000;
}

.map-app-chooser__dialog {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 360px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.map-app-chooser__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.map-app-chooser__description {
    font-size: 13px;
    color: var(--text-secondary);
}

.map-app-chooser__options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-app-chooser__button {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-align: left;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.map-app-chooser__button span {
    font-size: 12px;
    color: var(--text-muted);
}

.map-app-chooser__button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.map-app-chooser__actions {
    display: flex;
    justify-content: flex-end;
}

.map-app-chooser__cancel {
    border: none;
    background: none;
    color: var(--accent-primary);
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
}

/* Sidebar Styles */
.sidebar {
    width: calc(20% + 157px);
    min-width: 437px;
    max-width: 507px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-section {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Filter Styles */
.filter-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-options--two-column {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 6px;
}

.filter-options--dense {
    column-gap: 8px;
    row-gap: 4px;
}

.filter-options--tight {
    column-gap: 8px;
    row-gap: 4px;
}

.collapsible-filter-wrapper {
    position: relative;
}

.collapsible-filter {
    position: relative;
    transition: max-height 0.3s ease;
}

.collapsible-filter.is-collapsed {
    overflow: hidden;
}

.collapsible-filter.is-expanded {
    overflow: visible;
}

.collapsible-filter__overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 32px 12px 10px;
    border: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, var(--bg-secondary) 82%);
    color: var(--accent-primary);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.25s ease;
    z-index: 1;
    border-radius: 0 0 12px 12px;
}

.collapsible-filter__overlay:hover {
    opacity: 0.92;
}

.collapsible-filter__overlay:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.collapsible-filter__overlay--hidden {
    opacity: 0;
    pointer-events: none;
}

.collapsible-filter__overlay-text {
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-group--compact {
    gap: 4px;
}

.filter-group--small-text .filter-title {
    font-size: 12px;
    font-weight: 500;
}

.filter-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    transition: background 0.2s ease;
    font-size: 12px;
    color: var(--text-secondary);
}

.filter-toggle:hover {
    background: var(--accent-hover);
}

.filter-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch {
    position: relative;
    width: 38px;
    height: 20px;
    background: #4B5563;
    border-radius: 999px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--color-white);
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.filter-toggle input[type="checkbox"]:checked + .toggle-switch {
    background: var(--accent-primary);
}

.filter-toggle input[type="checkbox"]:checked + .toggle-switch .toggle-thumb {
    transform: translateX(18px);
}

.filter-toggle .toggle-label {
    color: var(--text-secondary);
    line-height: 1.3;
}

.filter-toggle--small {
    font-size: 11.5px;
    gap: 6px;
}

.filter-toggle--small .toggle-switch {
    width: 34px;
    height: 18px;
}

.filter-toggle--small .toggle-thumb {
    width: 14px;
    height: 14px;
}

.filter-toggle--small input[type="checkbox"]:checked + .toggle-switch .toggle-thumb {
    transform: translateX(16px);
}

/* Apply Filters Button */
.apply-filters-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--color-black);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
}

.apply-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(234, 179, 8, 0.4);
}

.apply-filters-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-black);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Exchange Rates Display */
.rates-display {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.rate-card {
    background: rgba(234, 179, 8, 0.18);
    border-radius: 10px;
    padding: 7px;
    color: var(--text-primary);
    /*box-shadow: 0 2px 8px rgba(234, 179, 8, 0.45);*/
    display: flex;
    flex-direction: column;
    gap: 0px;
    flex: 1 1 0;
    min-width: 0;
}

.rate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rate-currency {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
}

.rate-values {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    gap: 8px;
}

.rate-buy, .rate-sell {
    text-align: center;
    flex: 1;
}

.rate-buy .rate-label, .rate-buy .rate-value {
    text-align: left !important;
}

.rate-sell .rate-label, .rate-sell .rate-value {
    text-align: right !important;
}

.rate-label {
    opacity: 0.8;
    font-size: 9px;
    margin-bottom: 2px;
}

.rate-value {
    font-weight: 500;
    font-size: 9px;
}

.section-title--with-subtitle {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.section-title--with-subtitle .section-subtitle {
    font-size: 0.6em;
    font-weight: 400;
    opacity: 0.7;
    letter-spacing: 0.4px;
}

.nbs-section {
    gap: 6px;
}

.nbs-section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.85;
}

.nbs-section-date {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.6;
}

.nbs-rates-display {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.nbs-rate-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--text-primary);
    min-height: 37px;
}

.nbs-rate-code-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 10px;
    width: 10px;
}

.nbs-rate-code {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    transform: rotate(-90deg);
    transform-origin: center;
    white-space: nowrap;
}

.nbs-rate-values {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    line-height: 1.3;
    float: right;
    margin-left: auto;
}

.nbs-rate-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

.nbs-rate-line span:first-child {
    opacity: 0.65;
    font-size: 7px;
}

.nbs-rate-line span:last-child {
    font-weight: 400;
}

.nbs-rates-display .empty-state {
    grid-column: 1 / -1;
    font-size: 10px;
    opacity: 0.6;
    text-align: center;
    padding: 8px 0;
}

/* Info Section */
.info-toggle {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.info-toggle:hover {
    background: var(--accent-hover);
}

.info-content {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.info-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.exchange-types-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.exchange-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.type-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.type-1 { background: var(--accent-primary); }
.type-2 { background: var(--accent-secondary); }
.type-3 { background: var(--accent-tertiary); }
.type-4 { background: #DC2626; }
.type-5 { background: #EA580C; }
.type-6 { background: #0891B2; }
.type-7 { background: #7C3AED; }

.info-description {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Map Area */
.map-area {
    flex: 1;
    padding: 57px;
    background: var(--bg-primary);
}

.map-container {
    position: relative;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
            inset 0 2px 8px rgba(0, 0, 0, 0.1),
            inset 0 -2px 8px rgba(0, 0, 0, 0.1),
            inset 2px 0 8px rgba(0, 0, 0, 0.1),
            inset -2px 0 8px rgba(0, 0, 0, 0.1);
}

.map-viewport {
    width: 100%;
    height: 100%;
}

/* Map Controls */
.map-controls {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.map-control-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px var(--shadow-color);
    backdrop-filter: blur(8px);
}

.map-control-btn:focus {
    outline: none;
}

.map-control-btn--active {
    background: var(--color-white);
    color: var(--color-black);
}

[data-theme="light"] .map-control-btn--active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.map-control-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-color);
}

/* Control Buttons */
.control-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.control-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.control-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px var(--shadow-color);
    backdrop-filter: blur(12px);
}

/* Footer */
.footer-container {
    height: 60px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px var(--shadow-light);
    z-index: 1000;
}

.footer-content {
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-info {
    display: flex;
    flex-direction: column;
    line-height: 10px;
    gap: 2px;
}

.footer-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.footer-company {
    font-size: 11px;
    color: var(--text-muted);
}

.add-exchange-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--color-black);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3);
}

.add-exchange-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.4);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--accent-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--color-black);
}

.modal-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.exchange-description {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    font-weight: 300;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--color-black);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--accent-hover);
}

/* Exchange Details */
.exchange-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.sv-modal-video-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
}

.sv-modal-video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    background: #000;
    border: none;
}

.detail-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Rate type info with tooltip in modal */
.sv-rate-type-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    position: relative;
}

.sv-rate-type-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.sv-rate-type-tooltip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent-primary);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.sv-rate-type-tooltip-btn svg {
    width: 16px;
    height: 16px;
}

.sv-rate-type-tooltip-btn:hover,
.sv-rate-type-tooltip-btn:focus {
    color: var(--accent-secondary);
    transform: scale(1.1);
    outline: none;
}

.sv-rate-type-tooltip {
    position: absolute;
    left: 14px;
    right: 14px;
    top: calc(100% + 6px);
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-secondary);
    z-index: 10;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sv-rate-type-tooltip.hidden {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-link {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.detail-link:hover {
    color: var(--accent-secondary);
}

/* Working Hours */
.working-hours-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.working-day {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 4px 0;
}

.day-name {
    color: var(--text-secondary);
    font-weight: 500;
}

.day-hours {
    color: var(--text-primary);
    font-weight: 500;
}

.day-closed {
    color: #DC2626;
}

/* Services Tags */
.services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.service-tag {
    background: var(--accent-primary);
    color: var(--color-black);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 16px;
        gap: 12px;
    }

    .header-brand {
        flex: 1 1 auto;
        gap: 10px;
    }

    .header-brand h1 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-controls {
        flex: 0 0 auto;
        gap: 10px;
        margin-left: auto;
    }

    .desktop-layout {
        display: none;
    }

    .mobile-layout {
        display: flex;
        flex: 1;
        min-height: 0;
    }

    .header-container {
        height: 50px;
    }

    .header-container h1 {
        font-size: 16px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
    }

    .mobile-map-area {
        flex: 0 0 45vh;
        height: 45vh;
        padding: 14px;
        min-height: 45vh;
        position: relative;
    }

    .mobile-bottom-panel {
        flex: 1;
        min-height: 0;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        padding: 12px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mobile-section {
        background: var(--bg-tertiary);
        border-radius: 8px;
        padding: 12px;
        display: flex;
        flex-direction: column;
    }

    .mobile-section-toggle {
        width: 100%;
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        padding: 0;
    }

    .mobile-section-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 8px;
    }

    .mobile-section-content {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mobile-rates {
        display: flex;
        gap: 8px;
        align-items: stretch;
    }

    .mobile-rates .rate-card {
        flex: 1 1 0;
        min-width: 0;
    }

    .mobile-filter-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .mobile-filter-title {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-secondary);
    }

    .mobile-filter-options {
        display: grid;
        flex-wrap: wrap;
        gap: 3px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .mobile-filter-options--stacked {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .apply-filters-btn {
        align-self: stretch;
    }

    .footer-container {
        height: 61px;
        padding-bottom: calc(1px + env(safe-area-inset-bottom));
    }

    .footer-content {
        padding: 0 16px;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 12px;
    }

    .footer-text {
        font-size: 10px;
    }

    .footer-company {
        font-size: 9px;
    }

    .add-exchange-btn {
        font-size: 11px;
        padding: 8px 12px;
        justify-self: end;
        border-radius: 999px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    }

    .modal-content {
        margin: 0;
        max-height: none;
        height: 100vh;
        border-radius: 0;
    }

    .modal-overlay {
        padding: 0;
        align-items: stretch;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }

    .map-controls {
        right: 12px;
        gap: 6px;
    }

    .map-control-btn {
        width: 36px;
        height: 36px;
    }

    .map-app-chooser {
        padding: 16px;
    }

    .map-app-chooser__dialog {
        max-width: none;
        border-radius: 20px;
        padding: 20px;
    }

    .error-page {
        padding: 32px 12px;
    }

    .error-page__card {
        padding: 32px 24px;
        border-radius: 16px;
    }

    .error-page__badge {
        width: 56px;
        height: 56px;
        font-size: 18px;
    }

    .error-page__title {
        font-size: 24px;
    }

    .error-page__text {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #mobileApplyFiltersBtn {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        bottom: calc(61px + 16px + env(safe-area-inset-bottom));
        width: min(360px, calc(100% - 32px));
        max-width: 360px;
        z-index: 1300;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    }
}

/* Responsive Desktop Breakpoints */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 50%;
        min-width: 250px;
        max-width: 400px;
        padding: 16px;
    }



    .map-area {
        padding: 10px 0px 10px 20px;
    }

    .map-container {
        border-top-right-radius: 0px;
        border-bottom-right-radius: 0px;
    }

    .section-title {
        font-size: 15px;
    }

    .filter-checkbox {
        font-size: 12px;
    }
}

@media (min-width: 1025px) and (max-width: 1280px) {
    .sidebar {
        width: 39%;
        min-width: 260px;
        max-width: 419px;
    }


    .map-container {
        border-top-right-radius: 0px;
        border-bottom-right-radius: 0px;
    }

    .map-area {
        padding: 10px 0px 10px 10px;
    }
}

@media (min-width: 1281px) and (max-width: 1536px) {
    .sidebar {
        width: 37%;
        min-width: 280px;
        max-width: 407px;
    }

    .map-area {
        padding: 10px 0px 10px 10px;
    }

    .map-container {
        border-top-right-radius: 0px;
        border-bottom-right-radius: 0px;
    }
}

@media (min-width: 1537px) {
    .sidebar {
        width: 21%;
        min-width: 300px;
        max-width: 417px;
    }

    .map-area {
        /*padding: 60px;*/
        padding: 20px 0px 20px 20px;
    }
    .map-container {
        border-bottom-right-radius: initial;
        border-top-right-radius: initial;
    }
}

/* === Safe fixes для скролла сайдбара и рекламного блока === */

/* Позволяем внутренним блокам во flex-иерархии нормально скроллиться */
.main-container { min-height: 0; }
.desktop-layout { min-height: 0; }

/* Правая часть карты не должна распирать строку */
.map-area { min-width: 0; min-height: 0; }

/* Сайдбар остаётся колонкой со скроллом, но ему можно «сжиматься» по высоте */
.sidebar { min-height: 0; }

/* Рекламная секция не «тянет» всю колонку */
.sidebar-section.additional-material { flex: 0 0 auto; }

/* Рекламный слот: рекомендованный display:block, защита от схлопывания */
.sidebar .adsbygoogle {
    display: block;
    width: 100%;
    min-height: 160px; /* подстраховка от 0px и скачков */
    contain: content;
}

/* Опционально — «рамка» фиксированной высоты под автообъявления
   (уменьшает CLS и исключает влияние динамической высоты объявления) */
.ad-wrap {
    height: 280px;        /* ПК-высота рамки под авто-объявление */
    overflow: hidden;
}

/* Адаптация под мобильные: рамка ниже, чтобы не занимать много места */
@media (max-width: 768px) {
    .ad-wrap { height: 160px; }
    .mobile-section.additional-material .adsbygoogle {
        display: block;
        width: 100%;
        min-height: 120px;
    }
}
.ymaps-pie-chart__label {
    fill: #2D0571 !important; /* цвет текста (числа) */
    font-weight: bold;        /* можно сделать жирным */
    font-size: 14px;          /* задать размер шрифта */
}
.exchange-description {
    font-size: 12px;
    font-weight: 100;
}

/* Обёртка для рекламы и сам инвентарь – нормальная ширина на мобиле */
.additional-material .ad-wrap { width: 100%; min-width: 250px; }
ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    min-width: 250px;    /* чтобы availableWidth не был 0 */
    min-height: 120px;   /* авто/резponsive требуют какую-то высоту */
}

/* На всякий случай: мобильная нижняя панель точно не должна давать 0 ширины */
.mobile-bottom-panel, .mobile-section.additional-material { width:100%; }
.footer-zone-menu {
    font-size: 10px !important;
    text-align: center;
}
.exchange-location-hint {
    font-size: 12px;
}

/* Custom video player */
.sv-custom-video-player {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.sv-custom-video-player video {
    display: block;
    width: 100%;
    height: auto;
}

.sv-video-overlay-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: none;
    background: none;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 3;
}

.sv-video-overlay-button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255, 140, 0, 0.8);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(1px);
    transition: background 0.2s ease;
}

.sv-video-overlay-button::after {
    content: '';
    position: relative;
    border-left: 22px solid #fff;
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
    margin-left: 4px;
}

.sv-video-overlay-button:hover::before,
.sv-video-overlay-button:focus-visible::before {
    background: rgba(255, 140, 0, 0.95);
}

.sv-custom-video-player.is-playing .sv-video-overlay-button {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.92);
}

.sv-video-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.0) 90%);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.sv-custom-video-player.is-playing .sv-video-controls,
.sv-custom-video-player:hover .sv-video-controls,
.sv-custom-video-player:focus-within .sv-video-controls {
    opacity: 1;
    pointer-events: auto;
}

.sv-video-control-button {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sv-video-control-button:hover,
.sv-video-control-button:focus-visible {
    background: rgba(255, 140, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
}

.sv-video-icon {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.sv-video-volume {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.sv-video-volume.is-muted .sv-video-volume-slider {
    opacity: 0;
    width: 0;
}

.sv-video-volume-slider {
    width: 0;
    opacity: 0;
    transition: opacity 0.2s ease, width 0.2s ease;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.sv-video-volume.show-slider .sv-video-volume-slider {
    width: 130px;
    opacity: 1;
}

.sv-video-volume-slider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
}

.sv-video-volume-slider::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border-radius: 50%;
    background: #ff8c00;
    border: none;
    appearance: none;
    box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.25);
}

.sv-video-volume-slider::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
}

.sv-video-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff8c00;
    border: none;
    box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.25);
}

.sv-video-volume-slider:focus-visible {
    outline: none;
}

.sv-custom-video-player::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.25) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.sv-custom-video-player:hover::after,
.sv-custom-video-player.is-playing::after {
    opacity: 1;
}
/* === Mobile map resizer === */
@media (max-width: 768px) {
    /* Переопределяем стартовую высоту с 45vh на половину — 22.5vh.
       Используем CSS-переменную, чтобы JS мог плавно менять её. */
    .mobile-map-area {
        --map-min: 22.5vh;
        --map-max: 45vh;
        --map-height: var(--map-min); /* стартовое значение */
        /* Обязательно одинаково задать flex-basis/height/min-height,
           чтобы блок корректно занимал место во flex-контейнере */
        flex: 0 0 var(--map-height);
        height: var(--map-height);
        min-height: var(--map-height);
        /* Немного внутреннего отступа снизу под визуальную шторку */
        padding-bottom: 20px;
    }

    /* Кнопка-шторка (ручка) */
    .mobile-map-resize-handle {
        position: absolute;
        left: 50%;
        bottom: 4px;
        transform: translateX(-50%);
        width: 177px;
        height: 12px;               /* узкая по высоте */
        border-radius: 999px;
        background: var(--accent-primary);
        border: 1px solid var(--border-color);
        box-shadow: 0 6px 14px var(--shadow-light);
        cursor: ns-resize;
        touch-action: none;          /* важно для корректного Pointer Events */
        z-index: 5;
    }

    /* Небольшой “гребень” внутри шторки */
    .mobile-map-resize-handle::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 48px;
        height: 4px;
        border-radius: 4px;
        transform: translate(-50%, -50%);
        background: var(--bg-tertiary);
    }

    /* Визуальная обратная связь при активном перетаскивании */
    .mobile-map-resize-handle.is-dragging {
        box-shadow: 0 10px 22px rgba(0,0,0,0.35);
        background: var(--accent-hover);
    }
}
/* Order Action Block Styles */
.order-action-block {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 0.75rem;
}

.order-action-block-mobile {
    padding: 1rem;
    background: var(--color-bg-elevated);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 0px;
    padding-right: 0px;
}

.create-order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    color: white;
    font-weight: bold;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.3);
}

.create-order-btn:hover {
    background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(234, 88, 12, 0.4);
}

.create-order-btn:active {
    transform: translateY(0);
}

.how-it-works-link {
    display: block;
    text-align: center;
    font-size: 0.8125rem;
    color: #9ca3af;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.how-it-works-link:hover {
    color: #ea580c;
}

/* Verification Slider (Human Check) */
.sv-verification-slider {
    position: relative;
    width: 247px;
    height: 44px;
    flex-shrink: 0;
}

.sv-verification-slider-track {
    position: relative;
    width: 100%;
    height: 100%;
    background: #374151;
    border-radius: 22px;
    overflow: hidden;
    border: 2px solid #4b5563;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sv-verification-slider.verified .sv-verification-slider-track {
    background: #065f46;
    border-color: #10b981;
}

.sv-verification-slider-handle {
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: left 0.1s ease-out, background-color 0.3s ease;
    z-index: 2;
}

.sv-verification-slider.verified .sv-verification-slider-handle {
    left: calc(100% - 38px);
    background: #10b981;
    color: white;
}

.sv-verification-slider-handle:active {
    cursor: grabbing;
}

.sv-verification-slider-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8125rem;
    color: #9ca3af;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.sv-verification-slider.verified .sv-verification-slider-text {
    opacity: 0;
}

/* Mobile Responsive - Verification Slider */
@media (max-width: 480px) {
    #verification-slider-wrapper {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    #verification-label {
        font-weight: 100;
        font-size: 11px;
        width: 100%;
    }

    .sv-verification-slider {
        width: 100%;
        max-width: 100%;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .sv-verification-slider {
        width: 100%;
        max-width: 280px;
    }
}

/* Updated Order Action Block - Compact Two-Column Layout */
.order-action-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.75rem;
    align-items: center;
}

.create-order-btn-compact {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    color: white;
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.create-order-btn-compact:hover {
    background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(234, 88, 12, 0.4);
}

.how-it-works-link-compact {
    font-size: 0.75rem;
    color: #9ca3af;
    text-decoration: underline;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.how-it-works-link-compact:hover {
    color: #ea580c;
}

/* Compact Order Form Row */
.order-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.order-form-col {
    min-width: 0;
}

@media (max-width: 768px) {
    .order-form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Fix modal z-index and mobile display */
#howItWorksModal,
#createOrderModal {
    z-index: 99999 !important;
    position: fixed !important;
}

/* Fix modal overlay on mobile */
@media (max-width: 768px) {
    #howItWorksModal,
    #createOrderModal {
        padding: 1rem !important;
        overflow-y: auto !important;
    }

    #howItWorksModal > div,
    #createOrderModal > div {
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
}

/* Hide Yandex Map buttons when modals are open */
body:has(#createOrderModal:not(.hidden)) .ymaps-2-1-79-controls__toolbar,
body:has(#createOrderModal:not(.hidden)) .ymaps-2-1-79-controls-button,
body:has(#createOrderModal:not(.hidden)) .ymaps-2-1-79-float-button,
body:has(#howItWorksModal:not(.hidden)) .ymaps-2-1-79-controls__toolbar,
body:has(#howItWorksModal:not(.hidden)) .ymaps-2-1-79-controls-button,
body:has(#howItWorksModal:not(.hidden)) .ymaps-2-1-79-float-button {
    display: none !important;
    visibility: hidden !important;
}

/* Fix Yandex Map button styles on main page */
.ymaps-2-1-79-controls-button,
.ymaps-2-1-79-float-button {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #ddd !important;
}

.ymaps-2-1-79-controls-button:hover,
.ymaps-2-1-79-float-button:hover {
    background-color: rgba(255, 255, 255, 1) !important;
}

/* Alternative fallback using specific class versions */
[class*="ymaps"][class*="controls"] {
    z-index: 1000 !important;
}

/* Ensure modals are always on top */
.fixed[id$="Modal"] {
    z-index: 99999 !important;
}
