* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.4;
    font-weight: var(--font-light);
    padding-bottom: var(--mobile-nav-height);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}
body.no-scroll {
    overflow: hidden;
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}
@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

/* --- Хедер --- */
.header {
    background: var(--surface);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 120;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.88);
    transition: box-shadow var(--transition-smooth);
}
.header.scrolled {
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 12px;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: var(--font-semibold);
    font-size: 1.35rem;
    letter-spacing: -0.5px;
    white-space: nowrap;
}
.logo i {
    font-size: 1.5rem;
    color: var(--primary);
}
.logo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    margin-left: -2px;
    margin-top: -8px;
    animation: pulse-dot 2s infinite;
}
.logo.has-image {
    gap: 10px;
}
.logo-img {
    display: block;
    height: 36px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    flex-shrink: 0;
}
.logo-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}
.logo-text {
    font-weight: var(--font-semibold);
    font-size: 1.2rem;
    letter-spacing: -0.4px;
}
.logo.has-image .logo-text {
    font-size: 1.05rem;
}
.logo-tagline {
    font-size: 0.68rem;
    font-weight: var(--font-regular);
    color: var(--text-soft);
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
@media (max-width: 640px) {
    .logo.has-image .logo-text-wrap {
        display: none;
    }
    .logo-img {
        height: 32px;
        max-width: 120px;
    }
}
.sidebar-logo.has-image .sidebar-logo-img {
    height: 28px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    flex-shrink: 0;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.footer-brand img {
    height: 32px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}
.footer-brand h4 {
    margin: 0;
}
.footer-tagline {
    font-size: 0.82rem;
    color: var(--text-soft);
    margin: -6px 0 12px;
    line-height: 1.4;
}
@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.35;
    }
}
.nav-desktop {
    display: none;
    gap: 4px;
}
.nav-link {
    padding: 7px 15px;
    font-size: 0.84rem;
    font-weight: var(--font-regular);
    color: var(--text-soft);
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    background: none;
    font-family: inherit;
}
.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    border-color: rgba(79, 110, 247, 0.15);
}
.nav-link:hover {
    background: #f0f2f5;
    color: var(--text);
}
@media (min-width: 1024px) {
    .nav-desktop {
        display: flex;
    }
}
.search-desktop {
    display: none;
    flex: 1;
    max-width: 380px;
    position: relative;
}
.search-desktop input {
    width: 100%;
    height: 42px;
    padding: 0 16px 0 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg);
    font-size: 0.85rem;
    font-weight: var(--font-light);
    outline: none;
    transition: var(--transition-fast);
    font-family: inherit;
}
.search-desktop input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.08);
}
.search-desktop i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    font-size: 0.9rem;
    pointer-events: none;
}
@media (min-width: 768px) {
    .search-desktop {
        display: block;
    }
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-soft);
    text-decoration: none;
    font-size: 1.15rem;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    font-family: inherit;
}
.icon-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.icon-btn.favorited {
    color: var(--danger);
    animation: heart-pop 0.35s ease;
}
@keyframes heart-pop {
    0%,
    100% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.35);
    }
}
.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    background: var(--danger);
    color: white;
    font-size: 0.62rem;
    font-weight: var(--font-semibold);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    border: 2px solid white;
    line-height: 1;
    pointer-events: none;
}
.balance-btn {
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    padding: 0 18px;
    height: 38px;
    font-size: 0.84rem;
    font-weight: var(--font-medium);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition-fast);
    white-space: nowrap;
}
.balance-btn:hover {
    background: #3d5bd9;
    transform: translateY(-1px);
}
@media (min-width: 480px) {
    .balance-btn {
        display: inline-flex;
    }
}
.burger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 1.2rem;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}
.burger-btn:hover {
    background: #eef1f6;
}
@media (min-width: 1024px) {
    .burger-btn {
        display: none;
    }
}

/* --- Мобильное меню --- */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    padding: 12px 16px 20px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    z-index: 110;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
}
.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}
.mobile-link {
    padding: 13px 16px;
    background: var(--bg);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    font-weight: var(--font-regular);
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition: var(--transition-fast);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    background: none;
    width: 100%;
    text-align: left;
}
.mobile-link:active,
.mobile-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}
.mobile-link i {
    width: 20px;
    text-align: center;
    color: var(--primary);
    font-size: 0.9rem;
}
.mobile-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}
.mobile-link.highlight {
    background: var(--primary);
    color: white;
    justify-content: center;
    font-weight: var(--font-medium);
    border: none;
    border-radius: var(--radius-full);
}
.mobile-link.highlight i {
    color: white;
}
.mobile-link.highlight:active {
    background: #3d5bd9;
}

/* --- Нижняя мобильная навигация --- */
.bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--mobile-nav-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    z-index: 120;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-soft);
    font-size: 0.62rem;
    font-weight: var(--font-regular);
    gap: 3px;
    transition: var(--transition-fast);
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    padding: 4px 8px;
    position: relative;
}
.bottom-nav-item i {
    font-size: 1.35rem;
    transition: var(--transition-fast);
}
.bottom-nav-item.active {
    color: var(--primary);
}
.bottom-nav-item.active i {
    transform: translateY(-2px);
}
.bottom-nav-item .nav-dot {
    position: absolute;
    top: -2px;
    right: 2px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
}

/* --- Кнопки --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-weight: var(--font-medium);
    font-size: 0.88rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.2;
}
.btn:active {
    transform: scale(0.97);
}
.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(79, 110, 247, 0.3);
}
.btn-primary:hover {
    background: #3d5bd9;
    box-shadow: 0 6px 20px rgba(79, 110, 247, 0.4);
    transform: translateY(-1px);
}
.btn-outline {
    background: white;
    color: var(--primary);
    border-color: var(--border);
}
.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}
.btn-sm {
    padding: 7px 15px;
    font-size: 0.78rem;
    gap: 5px;
}

/* --- Футер --- */
.footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 28px 0 20px;
    margin-top: 28px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}
@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 28px;
    }
}
.footer-col h4 {
    font-weight: var(--font-medium);
    font-size: 0.9rem;
    margin-bottom: 10px;
}
.footer-links {
    list-style: none;
}
.footer-links li {
    margin-bottom: 5px;
}
.footer-links a {
    text-decoration: none;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: var(--font-light);
    transition: var(--transition-fast);
    cursor: pointer;
}
.footer-links a:hover {
    color: var(--primary);
}
.social-links {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.social-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}
.social-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}
.footer-bottom {
    text-align: center;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 0.7rem;
}

/* --- Модальные окна --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    background: white;
    border-radius: 24px;
    padding: 20px 20px 24px;
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.25s ease;
}
@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.modal-header h3 {
    font-weight: var(--font-medium);
    font-size: 1.15rem;
}
.modal-close {
    background: var(--bg);
    border: 1px solid var(--border);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.1rem;
    color: var(--text-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}
.modal-close:hover {
    background: #fee;
    color: var(--danger);
    border-color: var(--danger);
}
.modal-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
    transition: var(--transition-fast);
}
.modal-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.08);
}

/* --- Формы --- */
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: var(--font-medium);
    margin-bottom: 5px;
    color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition-fast);
    background: var(--bg);
    resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.06);
}
.form-group textarea {
    min-height: 80px;
}

/* --- Toast --- */
.toast-container {
    position: fixed;
    top: 76px;
    right: 12px;
    z-index: 350;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
@media (min-width: 768px) {
    .toast-container {
        right: 20px;
        top: 80px;
    }
}
.toast {
    background: white;
    border-radius: 16px;
    padding: 12px 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.83rem;
    border-left: 3px solid var(--primary);
    animation: slideInToast 0.3s ease;
    pointer-events: all;
    max-width: 300px;
    font-weight: var(--font-regular);
}
.toast.success {
    border-left-color: var(--success);
}
.toast.error {
    border-left-color: var(--danger);
}
.toast.warning {
    border-left-color: var(--warning);
}
@keyframes slideInToast {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
@keyframes slideOutToast {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* Map markers (Leaflet + fallback) */
.custom-marker-wrap { background: transparent !important; border: none !important; }
.catalog-map-marker {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #4f6ef7, #6d8cff);
    border: 3px solid white; box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.75rem;
}
.catalog-map-marker.drag {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #f43f5e, #fb7185);
    font-size: 1rem;
}
.map-fallback-msg {
    height: 100%; min-height: 200px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; color: var(--text-soft); font-size: 0.85rem;
    background: var(--bg); padding: 20px; text-align: center;
}
.map-fallback-msg i { font-size: 2rem; color: var(--primary); opacity: 0.5; }
.map-locate-btn.loading { opacity: 0.5; pointer-events: none; }
