:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-card-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --wb-color: #cb11ab;
    --ozon-color: #005bff;
    --ym-color: #ffcc00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.topbar > .notification-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 24px;
}

.topbar-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-logo {
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-slot {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-bell {
    position: relative;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.header-bell:hover {
    border-color: rgba(79, 70, 229, 0.28);
    box-shadow: var(--shadow-md);
}

.header-bell i {
    font-size: 1.2rem;
}

.header-bell-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 9999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-popover {
    width: min(420px, calc(100vw - 32px));
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 28px 60px -32px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    z-index: 260;
}

.notification-popover-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.notification-popover-head strong {
    display: block;
    margin-bottom: 4px;
}

.notification-popover-head span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.notification-mark-read {
    border: none;
    background: none;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

.notification-popover-body {
    max-height: 420px;
    overflow-y: auto;
}

.notification-empty,
.notification-locked {
    padding: 22px 20px;
    color: var(--text-muted);
}

.notification-locked a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.notification-item {
    display: block;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.notification-item:hover {
    background: rgba(248, 250, 252, 0.92);
}

.notification-item.unread {
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.76), rgba(255, 255, 255, 0.98));
}

.notification-item-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.notification-item-head strong {
    font-size: 0.95rem;
}

.notification-item-head time {
    color: var(--text-muted);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.notification-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.header-auth-link,
.header-auth-button {
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 9999px;
    transition: var(--transition);
}

.header-auth-link {
    color: var(--text-main);
    padding: 10px 14px;
}

.header-auth-link:hover {
    background: rgba(79, 70, 229, 0.08);
}

.header-auth-button {
    background: linear-gradient(135deg, #ff6b35 0%, #ffd23f 100%);
    color: #0f172a;
    padding: 10px 16px;
    box-shadow: 0 12px 30px -18px rgba(255, 107, 53, 0.9);
}

.header-auth-button:hover {
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    background: linear-gradient(to right bottom, #ffffff, #f1f5f9);
    padding: 64px 20px 80px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #FF6B35 0%, #FFD23F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.category-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 560px;
    margin: 14px auto 0;
}

.category-chip {
    border: 1px solid rgba(79, 70, 229, 0.12);
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-main);
    padding: 9px 14px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
    line-height: 1.2;
}

.category-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: var(--shadow-md);
}

.category-chip.active {
    background: linear-gradient(135deg, #ff6b35 0%, #ffd23f 100%);
    color: #0f172a;
    border-color: transparent;
    box-shadow: 0 15px 35px -18px rgba(255, 107, 53, 0.9);
}

/* Search Container */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    border-radius: 9999px;
    transition: var(--transition);
}

.search-container:focus-within {
    transform: scale(1.02);
    box-shadow: 0 25px 50px -12px rgb(79 70 229 / 0.25);
}

/* --- Стили для прилипающего поиска --- */
/* --- Стили для прилипающего поиска --- */
@keyframes slideDown {
    from {
        transform: translateY(-150%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.search-container.sticky {
    position: fixed;
    top: 86px;
    left: 16px;
    right: 16px;
    margin: 0 auto;
    z-index: 180;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Добавляем плавное появление */
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--text-muted);
}

#global-search {
    width: 100%;
    padding: 20px 24px 20px 60px;
    font-size: 1.125rem;
    border: 2px solid transparent;
    border-radius: 9999px;
    background: white;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

#global-search:focus {
    border-color: var(--accent);
}

.stats-banner {
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: margin-top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Main Layout */
.main-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 40px 24px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

.sidebar-filters {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);


    position: sticky;
    top: 24px;

    max-height: calc(100vh - 48px);

    overflow-y: auto;

}


.sidebar-filters::-webkit-scrollbar {
    width: 6px;
}

.sidebar-filters::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.filter-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.reset-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.reset-btn:hover {
    color: var(--accent);
}

.filter-group {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.filter-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
}

.custom-select,
.range-inputs input,
.brand-search-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
}

.custom-select:focus,
.range-inputs input:focus,
.brand-search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.brand-search-box {
    margin-bottom: 12px;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scrollable-list {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 8px;
}

.scrollable-list::-webkit-scrollbar {
    width: 6px;
}

.scrollable-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.premium-filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.premium-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 9999px;
    background: rgba(197, 154, 45, 0.14);
    color: #8b5a00;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.premium-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(10px);
}

.premium-modal-card {
    position: relative;
    width: min(420px, 100%);
    padding: 26px 24px 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 30px 70px -34px rgba(15, 23, 42, 0.35);
}

.premium-modal-card h2 {
    font-size: 1.6rem;
    line-height: 1.1;
    margin-bottom: 10px;
}

.premium-modal-card p {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

.premium-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.premium-modal-close:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent);
}

.premium-modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.checkbox-label:hover {
    color: var(--text-main);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Rating slider */
#rating-range {
    width: 100%;
    accent-color: #f59e0b;
}

.range-value {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Products Section */
.results-info {
    margin-bottom: 24px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}

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

.empty-state {
    grid-column: 1 / -1;
    padding: 32px 24px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

.auth-page-body,
.account-page-body,
.legal-page-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 210, 63, 0.28), transparent 30%),
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.14), transparent 28%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.auth-page,
.account-page,
.legal-page,
.subscribe-page,
.admin-page {
    max-width: 920px;
    margin: 0 auto;
    padding: 48px 20px 72px;
}

.auth-card,
.account-card,
.legal-card,
.subscribe-card,
.admin-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 28px;
    box-shadow: 0 24px 60px -34px rgba(15, 23, 42, 0.28);
}

.auth-card {
    max-width: 560px;
    margin: 0 auto;
    padding: 32px;
}

.auth-card-wide {
    max-width: 640px;
}

.auth-back-link,
.legal-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 9999px;
    transition: var(--transition);
}

.auth-back-link:hover,
.legal-back:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--text-main);
}

.auth-kicker,
.legal-kicker {
    display: inline-block;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 9999px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 700;
}

.auth-card h1,
.account-card h1,
.legal-card h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.05;
    margin-bottom: 12px;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
}

.auth-field input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: #fff;
    font: inherit;
    transition: var(--transition);
}

.auth-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.auth-checkbox input {
    margin-top: 4px;
    accent-color: var(--accent);
}

.auth-checkbox a {
    color: var(--accent);
    font-weight: 600;
}

.auth-submit,
.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff6b35 0%, #ffd23f 100%);
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 18px 40px -28px rgba(255, 107, 53, 0.9);
}

.auth-submit:hover,
.secondary-action:hover {
    transform: translateY(-1px);
}

.secondary-action {
    background: #fff;
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.auth-message {
    min-height: 24px;
    font-size: 0.9375rem;
    font-weight: 600;
}

.auth-message.is-error {
    color: #dc2626;
}

.auth-message.is-success {
    color: #15803d;
}

.auth-footer-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--text-muted);
}

.auth-footer-links a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.account-card,
.legal-card,
.subscribe-card,
.admin-card {
    padding: 32px;
}

.admin-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0 10px;
}

.admin-action-message {
    margin-bottom: 16px;
}

.admin-text-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: #fff;
    font: inherit;
}

.admin-logout-button {
    width: auto;
    min-width: 160px;
}

.cancel-subscription-button {
    margin-top: 14px;
    border-color: #fecaca;
    color: #b91c1c;
}

.cancel-subscription-button:hover {
    background: #fff5f5;
}

.subscribe-benefits {
    margin: 24px 0;
    padding: 22px 24px;
    border-radius: 22px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid var(--border-color);
}

.subscribe-benefits h2 {
    font-size: 1.35rem;
    margin-bottom: 12px;
}

.subscribe-benefits ul {
    padding-left: 20px;
    color: var(--text-muted);
    display: grid;
    gap: 10px;
}

.subscribe-price-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    padding: 20px 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(255, 210, 63, 0.18));
    border: 1px solid rgba(255, 107, 53, 0.15);
}

.subscribe-price-block span {
    color: var(--text-muted);
    font-weight: 600;
}

.subscribe-price-block strong {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1;
}

.subscribe-actions,
.subscription-actions-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.subscription-actions-inline {
    margin-top: 14px;
}

.subscription-panel {
    padding: 20px 22px;
    border-radius: 22px;
    border: 1px solid var(--border-color);
    background: rgba(248, 250, 252, 0.92);
    display: grid;
    gap: 16px;
}

.subscription-panel.loading {
    color: var(--text-muted);
}

.subscription-panel.status-active,
.subscription-panel.status-expiring {
    border-color: rgba(34, 197, 94, 0.22);
    background: linear-gradient(135deg, rgba(220, 252, 231, 0.72), rgba(255, 255, 255, 0.96));
}

.subscription-panel.status-none,
.subscription-panel.status-expired {
    border-color: rgba(251, 146, 60, 0.24);
    background: linear-gradient(135deg, rgba(255, 237, 213, 0.82), rgba(255, 255, 255, 0.96));
}

.subscription-main-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.subscription-main-row strong {
    display: block;
    margin-top: 8px;
    font-size: 1rem;
}

.subscription-status-badge {
    display: inline-flex;
    margin-bottom: 4px;
    padding: 7px 11px;
    border-radius: 9999px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 700;
}

.subscription-meta-block {
    min-width: 150px;
    text-align: right;
}

.subscription-meta-block span,
.subscription-grid span {
    display: block;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.subscription-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.subscription-grid strong {
    display: block;
    word-break: break-word;
}

.telegram-link-box,
.notification-lock-banner {
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: rgba(248, 250, 252, 0.92);
}

.telegram-link-info {
    color: var(--text-muted);
    line-height: 1.7;
}

.telegram-link-info a {
    color: var(--accent);
    font-weight: 700;
}

.telegram-link-info code {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 10px;
    background: #e0e7ff;
    color: #312e81;
    font-size: 0.95rem;
    font-weight: 700;
}

.copy-code-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.copy-code-button {
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-main);
    min-height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.copy-code-button:hover {
    border-color: rgba(79, 70, 229, 0.28);
    color: var(--accent);
}

.notification-lock-banner.locked {
    border-color: rgba(251, 146, 60, 0.24);
    color: #9a3412;
}

.notification-lock-banner.unlocked {
    border-color: rgba(34, 197, 94, 0.22);
    color: #166534;
}

.notifications-gate {
    margin-top: 28px;
}

.notifications-page-controls {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.notifications-filter {
    max-width: 260px;
}

.notifications-page-list {
    display: flex;
    flex-direction: column;
    margin-top: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
}

.notifications-page-item {
    padding: 20px 22px;
}

.notifications-page-empty {
    margin-top: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
}

.notification-status-tag {
    display: inline-flex;
    margin-top: 12px;
    padding: 6px 10px;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 700;
}

.notification-status-tag.read {
    background: rgba(226, 232, 240, 0.9);
    color: #475569;
}

.notification-status-tag.unread {
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent);
}

.notifications-page-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.telegram-connect-section,
.telegram-settings-section {
    margin: 24px 0;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: rgba(255, 255, 255, 0.96);
}

.telegram-actions {
    margin-top: 16px;
}

.notification-settings-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    align-items: center;
}

.settings-row span {
    font-weight: 600;
}

.pagination-button {
    min-width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-main);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-button.active {
    background: linear-gradient(135deg, #ff6b35 0%, #ffd23f 100%);
    border-color: transparent;
}

.account-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.account-state,
.account-guest p,
.legal-card p,
.legal-card li {
    color: var(--text-muted);
    font-size: 1rem;
}

.account-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.account-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.95);
}

.account-row span {
    color: var(--text-muted);
}

.account-logout {
    margin-top: 12px;
}

.account-guest-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.favorites-section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--border-color);
}

.favorites-head {
    margin-bottom: 18px;
}

.favorites-head h2 {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.favorites-head p,
.favorites-empty {
    color: var(--text-muted);
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.favorite-item {
    display: grid;
    grid-template-columns: 108px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: rgba(248, 250, 252, 0.9);
}

.favorite-item-image {
    width: 108px;
    height: 108px;
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
    padding: 10px;
}

.favorite-item-content h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.favorite-item-content p {
    margin-bottom: 10px;
}

.favorite-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.favorite-item-meta span {
    padding: 6px 10px;
    border-radius: 9999px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 700;
}

.favorite-item-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.favorite-item-bottom a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.favorite-remove-button {
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #b91c1c;
    border-radius: 14px;
    min-height: 44px;
    padding: 0 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.favorite-remove-button:hover {
    background: #fee2e2;
}

.legal-card h2 {
    margin: 24px 0 10px;
    font-size: 1.25rem;
}

.legal-card p + p {
    margin-top: 12px;
}

/* Product Card */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--accent);
}

.card-image-wrap {
    width: 100%;
    height: 240px;
    padding: 24px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover .card-image {
    transform: scale(1.05);
}

.mp-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.favorite-button {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    z-index: 11;
}

.favorite-button i {
    font-size: 1.1rem;
    line-height: 1;
}

.favorite-button:hover {
    transform: scale(1.06);
    color: #ef4444;
}

.favorite-button.active {
    color: #ffffff;
    background: #ef4444;
    box-shadow: 0 16px 32px -18px rgba(239, 68, 68, 0.95);
}

.favorite-button.active:hover {
    color: #ffffff;
    background: #dc2626;
}

.mp-wb {
    background-color: var(--wb-color);
}

.mp-partner {
    background: linear-gradient(135deg, #c59a2d 0%, #f5d36d 100%);
    color: #352100;
}

.mp-taobao {
    background: linear-gradient(135deg, #d7863a 0%, #efb26c 100%);
    color: #3f2200;
}

.mp-alibaba {
    background: linear-gradient(135deg, #d97a42 0%, #f2b184 100%);
    color: #422000;
}

.partner-card {
    border: 1px solid rgba(197, 154, 45, 0.35);
    box-shadow: 0 24px 40px -30px rgba(197, 154, 45, 0.55);
}

.partner-card:hover {
    border-color: rgba(197, 154, 45, 0.55);
    box-shadow: 0 30px 48px -30px rgba(197, 154, 45, 0.7);
}

.mp-ozon {
    background-color: var(--ozon-color);
}

.mp-ym {
    background-color: var(--ym-color);
    color: #000;
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    border-top: 1px solid var(--border-color);
}

.card-brand {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 16px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.4em * 2);
    word-break: break-word;
    flex-grow: 1;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    gap: 12px;
}

.card-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.card-price-note {
    margin-bottom: 12px;
    color: #9a6700;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.buyer-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f6ead1 0%, #f3d78c 100%);
    color: #4b3200;
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
}

.buyer-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
    .buyer-button {
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.75rem;
    }
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    color: #d97706;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.reviews-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Loader */
.loader {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-weight: 500;
    display: none;
    /* hidden by default */
    align-items: center;
    justify-content: center;
    gap: 8px;
}

body.loading .loader {
    display: flex;
}

.spinner {
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

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

/* Scroll To Top */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    border: none;
    z-index: 50;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .sidebar-filters {
        position: relative;
        top: 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .topbar-inner,
    .account-head {
        flex-direction: column;
        align-items: stretch;
    }
}

/* --- БАЗОВЫЕ СТИЛИ (ДЛЯ ПК) --- */
/* Прячем кнопку-переключатель на больших экранах */
.mobile-filter-toggle {
    display: none;
}

/* Гарантируем, что фильтры всегда полностью открыты на ПК */
.advanced-filters {
    display: block;
    opacity: 1;
    max-height: none;
    overflow: visible;
}

/* --- МОБИЛЬНАЯ ВЕРСИЯ --- */
@media (max-width: 640px) {
    .topbar-inner {
        padding: 12px 16px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .topbar > .notification-popover {
        right: 16px;
    }

    .search-container.sticky {
        top: 118px;
        left: 12px;
        right: 12px;
    }

    .header-auth-link,
    .header-auth-button {
        font-size: 0.875rem;
    }

    .hero {
        padding: 40px 16px;
    }

    .category-bar {
        gap: 8px;
        margin-top: 12px;
        max-width: 100%;
    }

    .category-chip {
        width: auto;
        max-width: 100%;
        padding: 9px 12px;
        font-size: 0.8125rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    #global-search {
        font-size: 1rem;
        padding: 16px 20px 16px 50px;
    }

    .search-icon {
        left: 20px;
        font-size: 1.25rem;
    }

    /* 1. Настройки мобильного меню фильтров */
    .mobile-filter-toggle {
        display: flex;
        /* Показываем кнопку только на телефоне */
        width: 100%;
        padding: 12px;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 0.9375rem;
        font-weight: 600;
        color: var(--text-main);
        cursor: pointer;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-bottom: 16px;
        transition: var(--transition);
    }

    .mobile-filter-toggle:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

    /* Прячем сами фильтры по умолчанию на мобилках */
    .advanced-filters {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
    }

    /* Класс, который добавляет JS при клике (открывает меню) */
    .advanced-filters.open {
        max-height: 1000px;
        opacity: 1;
        overflow-y: auto;
    }

    /* 2. Товары в 2 столбца и адаптация карточек */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Задаем 2 колонки */
        gap: 12px;
    }

    .card-image-wrap {
        height: 160px;
        padding: 12px;
    }

    .card-content {
        padding: 12px;
    }

    .card-title {
        font-size: 0.8125rem;
        margin-bottom: 8px;
    }

    .card-price {
        font-size: 1.125rem;
    }

    .card-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }


    .sidebar-filters {
        padding: 16px;
    }

    .filter-header {
        margin-bottom: 16px;
    }

    .filter-group {
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    .mobile-filter-toggle {
        padding: 10px;
        margin-bottom: 8px;
        font-size: 0.875rem;
    }

    .auth-card,
    .account-card,
    .legal-card {
        padding: 24px 18px;
        border-radius: 22px;
    }

    .auth-page,
    .account-page,
    .legal-page,
    .subscribe-page {
        padding: 24px 16px 48px;
    }

    .account-row,
    .account-guest-actions,
    .subscription-grid,
    .subscribe-actions,
    .subscription-actions-inline,
    .settings-row,
    .admin-actions-grid {
        grid-template-columns: 1fr;
    }

    .account-row {
        flex-direction: column;
    }

    .subscription-main-row,
    .subscribe-price-block,
    .notifications-page-controls {
        flex-direction: column;
    }

    .subscription-meta-block {
        min-width: 0;
        text-align: left;
    }

    .notifications-filter {
        max-width: 100%;
        width: 100%;
    }

    .premium-modal-card {
        padding: 24px 18px 20px;
        border-radius: 22px;
    }

    .premium-modal-actions {
        grid-template-columns: 1fr;
    }

    .favorite-item {
        grid-template-columns: 1fr;
    }

    .favorite-item-image,
    .favorite-remove-button {
        width: 100%;
    }

}

@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-card-hover);
        border-color: var(--accent);
    }

    .product-card:hover .card-image {
        transform: scale(1.05);
    }
}
