@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary-color: #7c3aed;
    --accent: #059669;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-elevated: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 14px 28px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.12);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background: linear-gradient(160deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    background-attachment: fixed;
    line-height: 1.6;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(99, 102, 241, 0.06) 1px, transparent 0);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}
body > .header,
body .main {
    position: relative;
    z-index: 1;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.debug-panel {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: #1a1a2e;
    color: #a5f3fc;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-family: ui-monospace, monospace;
    word-break: break-word;
}
.debug-panel strong { color: #fbbf24; }
.debug-panel .err { color: #f87171; }
.debug-panel .ok { color: #4ade80; }

.main {
    overflow-x: hidden;
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    max-width: min(1200px, 100%);
}

/* Header — единый на всех страницах */
.header {
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 0;
}

.header .container,
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    max-width: 1200px;
    margin: 0 auto;
}

.main {
    margin-top: 1.5rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s;
    position: relative;
}
.logo__img {
    display: block;
    height: 46px;
    width: auto;
    max-width: 290px;
    object-fit: contain;
}
.logo:hover {
    opacity: 0.88;
}
.logo:focus-visible .logo__img {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Поисковая строка */
.search-bar-wrap {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}
.search-bar-inner {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}
.search-bar-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 3rem;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar-input::placeholder {
    color: var(--text-muted);
}
.search-bar-input:hover,
.search-bar-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.search-bar-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-bar-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}
.search-suggestions {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: 100%;
    margin-top: 0.25rem;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    display: none;
}
.search-suggestions.is-open {
    display: block;
}
.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    cursor: pointer;
    text-align: left;
}
.search-suggestion-item:last-child {
    border-bottom: none;
}
.search-suggestion-item:hover,
.search-suggestion-item:focus {
    background: var(--bg-secondary);
    color: var(--primary-color);
}
.search-suggestion-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.search-suggestion-item__thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, var(--primary-light) 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.search-suggestion-item__text {
    flex: 1;
    min-width: 0;
}
.search-suggestion-item__title {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-suggestion-item__price {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 0.15rem;
}
.search-suggestion-item__arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}
.search-suggestions-empty {
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}
.search-suggestions-loading {
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}

/* Меню с нуля */
.header__contacts.v2-only {
    display: none;
}
.vitrina-v2 .header__contacts.v2-only {
    display: flex;
}
.header__contacts {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}
.header__contact-link {
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
}
.header__contact-link:hover {
    color: var(--link-color, var(--accent));
    text-decoration: underline;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.nav-menu__btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.nav-menu__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.nav-menu__icon svg {
    width: 100%;
    height: 100%;
    color: currentColor;
}

.nav-menu__badge {
    min-width: 1.25rem;
    padding: 0.1rem 0.35rem;
    background: var(--primary-color);
    color: white;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.nav-menu__btn:hover .nav-menu__badge {
    background: rgba(255,255,255,0.3);
}
.nav-menu__btn--order {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.nav-menu__btn--order:hover {
    filter: brightness(1.08);
    color: white;
}
.cart-empty-hint {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Совместимость со старыми id */
#compareCount, #cartCount {
    display: inline;
}
.nav-btn { display: none; }

/* Основной контент */
.main .container {
    padding-top: 0;
}

/* Заголовок каталога */
.page-hero {
    text-align: center;
    padding: 2rem 1rem 2.5rem;
    margin-bottom: 0.5rem;
}
.page-hero__title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}
.page-hero__title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    margin-top: 0.5rem;
    margin-left: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}
.page-hero__sub {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Категории */
.categories-toggle {
    display: none;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0.5rem;
}
.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}
.categories-list li {
    border-bottom: 1px solid var(--border-color);
}
.categories-list li:last-child {
    border-bottom: none;
}
.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.category-link:hover {
    background: var(--bg-secondary);
}
.category-link.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}
.category-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}
.category-link.active .category-count {
    color: rgba(255,255,255,0.9);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem 0 2rem;
}

@media (min-width: 640px) {
    .products-grid {
        gap: 1.75rem;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        gap: 2rem;
    }
}

.load-more-btn,
.load-more-btn:focus {
    width: 100%;
    margin: 2rem auto;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    max-width: 420px;
    display: block;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}
.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.pagination-info {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.site-footer {
    margin-top: 3rem;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}
.site-footer__text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}
.site-footer__contacts.v2-only {
    display: none;
}
.vitrina-v2 .site-footer__contacts.v2-only {
    display: block;
}
.site-footer__contacts {
    text-align: center;
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.site-footer__contacts-sep {
    margin: 0 0.5rem;
    color: var(--text-muted);
}
.site-footer__link {
    color: var(--link-color, var(--accent));
    text-decoration: none;
}
.site-footer__link:hover {
    text-decoration: underline;
}

.site-footer__version {
    text-align: center;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
/* Скрыть переключатель версий (Версия: 1 | 2). ОТКАТ: удалить следующие 2 строки — переключатель снова появится. */
.site-footer__version {
    display: none !important;
}
.version-label { margin-right: 0.35rem; }
.version-sep { margin: 0 0.35rem; color: var(--border-color); }
.version-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}
.version-link:hover { text-decoration: underline; }
.version-link.is-active {
    color: var(--text-primary);
    pointer-events: none;
    text-decoration: none;
}

/* Версия 2: скрыть всё, что ведёт на маркетплейс */
.vitrina-v2 [data-version-1-only] {
    display: none !important;
}
.vitrina-v2 #productDetailActionsV1,
.vitrina-v2 #productDetailTrust,
.vitrina-v2 #productDetailDisclaimer {
    display: none !important;
}
.vitrina-v2 #productOrderFormV2 {
    display: block !important;
}

/* Статьи на главной */
.home-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.home-articles__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.5rem;
    letter-spacing: -0.02em;
}
.home-articles__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
.home-article-card {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}
.home-article-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}
.home-article-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 0.75rem;
}
.home-article-card p:last-child {
    margin-bottom: 0;
}
@media (min-width: 768px) {
    .home-articles__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.home-faq {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.home-faq__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
    letter-spacing: -0.02em;
}
.home-faq__list {
    display: grid;
    gap: 1rem;
    max-width: 800px;
}
.home-faq__item {
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.home-faq__q {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}
.home-faq__a {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.home-advantages {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.home-advantages__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
    letter-spacing: -0.02em;
}
.home-advantages__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
    max-width: 700px;
}
.home-advantages__item {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-left: 1.75rem;
    position: relative;
}
.home-advantages__item::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

/* Инфоблоки Версии 2 (правила доставки, оплаты, реквизиты) */
.v2-info-blocks {
    display: none;
    margin-top: 2rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.vitrina-v2 .v2-info-blocks {
    display: block;
}
.v2-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .v2-info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.v2-info-card {
    padding: 1.25rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}
.v2-info-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}
.v2-info-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 0.5rem;
}
.v2-info-card p:last-child { margin-bottom: 0; }
.v2-requisites-name {
    font-weight: 600;
    color: var(--text-primary);
}
.v2-requisites-list {
    margin: 0.5rem 0 0;
}
.v2-requisites-list dt {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}
.v2-requisites-list dd {
    margin: 0.15rem 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}
.v2-requisites-email,
.v2-requisites-link {
    color: var(--link-color, var(--accent));
    text-decoration: none;
}
.v2-requisites-email:hover,
.v2-requisites-link:hover {
    text-decoration: underline;
}

.v2-legal-links {
    margin: 1rem 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.v2-legal-sep {
    margin: 0 0.5rem;
    color: var(--text-muted);
}
.v2-legal-link {
    color: var(--link-color, var(--accent));
    text-decoration: none;
}
.v2-legal-link:hover {
    text-decoration: underline;
}

.modal-content--legal .modal-body {
    max-height: 60vh;
}

/* Форма заказа (Версия 2) */
.product-order-form-v2 {
    margin-top: 1.25rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}
.order-form-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem;
}
.order-summary-v2 {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
}
.order-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
}
.order-summary-row span:last-child { color: var(--text-primary); font-weight: 600; }
.order-summary-row.order-summary-delivery { border-top: 1px dashed var(--border-color); margin-top: 0.25rem; padding-top: 0.5rem; }
.order-delivery-partner {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
}
.order-summary-row.order-summary-total { font-size: 1.1rem; color: var(--text-primary); margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border-color); }
.order-summary-row.order-summary-total span:last-child { font-size: 1.25rem; color: var(--primary-color); }
.order-form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.order-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    box-sizing: border-box;
}
.order-form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}
.order-payment-v2 {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.order-payment-v2__icon { font-size: 1.2rem; }
.order-form-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 1rem 0 0;
    line-height: 1.4;
}

/* Корзина V2: итоги и форма заказа в модалке */
.cart-summary-v2 {
    padding: 1rem;
    margin-top: 1rem;
    border-top: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
}
.cart-summary-row span:last-child { font-weight: 600; color: var(--text-primary); }
.cart-summary-row.cart-summary-total { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border-color); font-size: 1.1rem; }
.cart-summary-row.cart-summary-total span:last-child { font-size: 1.25rem; color: var(--primary-color); }
.cart-order-form-v2 {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.cart-order-form-v2 .order-form-title { margin-top: 0; }
.cart-order-form-v2 .btn-buy { width: 100%; margin-top: 0.5rem; }
.cart-order-success-v2 {
    margin-top: 1rem;
    padding: 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: var(--radius-lg);
}
.cart-order-success-v2 .order-success-icon { margin: 0 auto 0.5rem; }
.cart-order-success-v2 .order-success-title { margin: 0 0 0.5rem; }
.cart-order-success-v2 .order-success-text { margin: 0 0 1rem; font-size: 0.95rem; line-height: 1.5; }

.product-order-form-v2 .btn-buy {
    width: 100%;
    animation: none;
    margin-top: 0.25rem;
}

/* Успешное оформление (Версия 2) */
.product-order-success-v2 {
    margin-top: 1.25rem;
    padding: 2rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 1px solid rgba(6, 95, 70, 0.25);
    border-radius: var(--radius-lg);
}
.order-success-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    background: var(--accent);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 3rem;
    border-radius: 50%;
}
.order-success-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}
.order-success-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 1.25rem;
    text-align: left;
}
.product-order-success-v2 .btn-secondary {
    display: inline-block;
}

.product-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}
.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0.6;
    transition: opacity 0.3s;
}
.product-card:hover::before {
    opacity: 1;
}

/* Ссылка на карточку — открывается по клику даже без JS (при полном каталоге) */
.product-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    text-indent: -9999px;
}
.product-card .product-image,
.product-card .product-info {
    position: relative;
    z-index: 0;
}
.product-card .product-actions {
    position: relative;
    z-index: 2;
}

.product-card-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}

.product-card-discount {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.45);
    border: 1px solid rgba(255,255,255,0.25);
}

.product-price-old {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.product-price-disclaimer {
    margin: 0.3rem 0 0;
    font-size: 0.62rem;
    line-height: 1.3;
    color: var(--text-muted);
    padding: 0.25rem 0.4rem;
    background: rgba(0,0,0,0.03);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--primary-light);
}

.product-marketplace-hint {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
}

.product-marketplace-hint::after {
    content: ' →';
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}
.product-card:hover .product-image {
    transform: scale(1.03);
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(145deg, var(--primary-light) 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
    overflow: hidden;
    transition: transform 0.4s ease;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .product-image .image-emoji {
    font-size: 3rem;
    height: 100%;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.product-info {
    padding: 1.35rem 1.35rem 1.1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.08rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.product-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    flex-grow: 1;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    gap: 0.5rem;
}

.product-price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.6rem;
    padding: 0.5rem 0.65rem;
    background: linear-gradient(135deg, rgba(224, 231, 255, 0.4) 0%, rgba(199, 210, 254, 0.25) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(79, 70, 229, 0.12);
}

.product-price-arrow {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.product-price-discount-pill {
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    margin-left: auto;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

.product-price-current {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.product-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.product-footer-bottom .product-marketplace-hint {
    margin: 0;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

.btn-compare {
    background: var(--secondary-color);
    color: white;
}

.btn-compare:hover {
    background: #7c3aed;
}

.btn-compare.active {
    background: #10b981;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
}

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

.modal-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

/* Comparison Table */
.compare-table {
    width: 100%;
    border-collapse: collapse;
}

.compare-table th,
.compare-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.compare-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.compare-table tr:hover {
    background: var(--bg-secondary);
}

.compare-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.compare-product img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.compare-product-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.compare-product-price {
    color: var(--primary-color);
    font-weight: 600;
}

/* Cart Items */
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Детальная страница товара */
.product-page {
    padding-bottom: 6rem; /* место под плавающую кнопку */
}

/* Плавающие кнопки внизу экрана — по центру, логичная сетка */
.product-fab-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    pointer-events: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 0.5rem;
    box-sizing: border-box;
}

.product-fab-hint {
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 0.25rem 0;
    pointer-events: none;
}

.product-fab-wrap > .product-fab {
    pointer-events: auto;
}

.product-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 999px;
    box-shadow: 0 3px 14px rgba(245, 158, 11, 0.4);
    text-decoration: none;
    pointer-events: auto;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.product-fab-deal {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 3px 14px rgba(5, 150, 105, 0.4);
}
.product-fab-deal:hover {
    box-shadow: 0 5px 20px rgba(5, 150, 105, 0.5);
}
.product-fab-delivery {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 3px 14px rgba(37, 99, 235, 0.4);
}
.product-fab-delivery:hover {
    box-shadow: 0 5px 20px rgba(37, 99, 235, 0.5);
}
.product-fab-reviews {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 3px 14px rgba(245, 158, 11, 0.4);
}
.product-fab-reviews:hover {
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.5);
}
.product-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.5);
}
.product-fab:active {
    transform: translateY(0);
}
.product-fab-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.product-fab-icon-svg {
    width: 1.25rem;
    height: 1.25rem;
}
.product-fab-icon-svg svg {
    width: 100%;
    height: 100%;
    color: currentColor;
}
.product-fab-text {
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .product-fab-wrap {
        padding: 0.85rem 1.5rem;
        padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
        gap: 0.75rem;
        flex-wrap: nowrap;
        max-width:  min(100%, 720px);
        margin-left: auto;
        margin-right: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 100%;
    }
    .product-fab-hint {
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 0.4rem;
        width: auto;
    }
    .product-fab {
        padding: 1rem 1.35rem;
        font-size: 1.05rem;
    }
    .product-fab-icon-svg {
        width: 1.35rem;
        height: 1.35rem;
    }
}

@media (min-width: 1024px) {
    .product-fab-wrap {
        padding: 1rem 2rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
        gap: 1rem;
        max-width: min(100%, 800px);
        border-radius: 1rem 1rem 0 0;
        background: linear-gradient(180deg, rgba(30, 27, 75, 0.96) 0%, rgba(26, 26, 46, 0.94) 100%);
        backdrop-filter: blur(14px);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.08);
        border-bottom: none;
    }
    .product-fab {
        padding: 1.1rem 1.5rem;
        font-size: 1.1rem;
    }
    .product-fab-icon-svg {
        width: 1.45rem;
        height: 1.45rem;
    }
}

.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.product-detail {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
    align-items: start;
}

@media (min-width: 640px) {
    .product-detail-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.75rem;
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .product-page .container {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .product-detail-grid {
        gap: 2.5rem;
        padding: 2rem;
    }
    .product-detail-title {
        font-size: 1.55rem;
    }
    .product-detail-price {
        font-size: 2.25rem;
    }
}

.product-detail-media {
    position: relative;
}

.product-image-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
}

.product-detail-image {
    aspect-ratio: 1;
    background: linear-gradient(145deg, #e0e7ff 0%, #c7d2fe 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
    transition: transform 0.2s;
}

.product-detail-image:hover {
    transform: scale(1.02);
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.image-placeholder {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem;
}

.image-error {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    text-align: center;
}

.image-emoji {
    font-size: 8rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.image-zoom-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
    z-index: 10;
}

.image-zoom-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.product-image-thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.product-image-thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.product-image-thumbnails img:hover,
.product-image-thumbnails img.active {
    border-color: var(--primary-color);
}

/* Модальное окно для увеличенного изображения */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.image-modal-close {
    position: absolute;
    top: -3rem;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 0.5rem;
}

.product-detail-info::-webkit-scrollbar {
    width: 6px;
}

.product-detail-info::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.product-detail-info::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.product-detail-info::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.product-detail-category {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.product-detail-category a {
    color: var(--primary-color);
    text-decoration: none;
}
.product-detail-category a:hover {
    text-decoration: underline;
}
.product-detail-title {
    font-size: clamp(1.25rem, 2.8vw, 1.6rem);
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-detail-description-wrapper {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.product-detail-description-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.product-detail-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.product-detail-description.truncated {
    max-height: 8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.description-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 0;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

.description-toggle:hover {
    color: var(--primary-hover);
}

.product-detail-offer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.product-detail-price-block {
    position: relative;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(224, 231, 255, 0.5) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(79, 70, 229, 0.2);
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.05), inset 0 1px 0 rgba(255,255,255,0.8);
}

.product-detail-price-inner {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.product-detail-price-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.product-detail-price-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 3.5rem;
}

.product-detail-price-line-old .product-detail-price-old {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-detail-price-old {
    display: inline-block;
}

.product-detail-price-line-current .product-detail-price {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.03em;
}

.product-detail-price {
    display: inline-block;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.product-detail-discount {
    margin-left: auto;
}

.product-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.product-detail-actions .btn {
    text-decoration: none;
    text-align: center;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

@keyframes btn-buy-glow {
    0%, 100% { box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4); }
    50% { box-shadow: 0 4px 24px rgba(79, 70, 229, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.2); }
}

.btn-buy {
    flex: 1 1 auto;
    min-width: 200px;
    padding: 1rem 1.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    border: none;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: btn-buy-glow 2.2s ease-in-out infinite;
}

.btn-buy:hover {
    color: #fff;
    box-shadow: 0 6px 24px rgba(79, 70, 229, 0.6);
    transform: translateY(-2px);
    animation: none;
}

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

.product-detail-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}
.product-detail-actions .btn-primary:hover {
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45);
}

.product-detail-watching {
    margin: 0 0 1rem 0;
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #065f46;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 1px solid rgba(6, 95, 70, 0.25);
    border-radius: var(--radius-md);
    display: inline-block;
    box-shadow: 0 1px 3px rgba(6, 95, 70, 0.15);
}
.product-detail-watching:empty {
    display: none;
}

.product-detail-price-block .product-detail-discount {
    position: absolute;
    top: 1rem;
    right: 1rem;
}
.product-detail-discount {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
    border: 1px solid rgba(255,255,255,0.2);
}

.product-detail-price-disclaimer {
    margin: 0.35rem 0 0;
    font-size: 0.65rem;
    line-height: 1.3;
    color: var(--text-muted);
    padding: 0.3rem 0.45rem;
    background: rgba(0,0,0,0.03);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--primary-light);
}

.product-detail-trust {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.product-detail-share {
    margin-top: 0.75rem;
    margin-bottom: 0;
}

.link-copy-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
}

.link-copy-btn:hover {
    color: var(--primary-hover);
}

.product-reviews-anchor {
    margin-top: 2.5rem;
    padding: 2rem 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, #f1f5f9 100%);
    scroll-margin-bottom: 6rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.product-reviews-title {
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.product-reviews-teaser {
    color: var(--text-secondary);
    font-size: clamp(0.95rem, 2.5vw, 1.05rem);
    margin-bottom: 1.25rem;
    line-height: 1.4;
}
.btn-reviews-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: clamp(0.85rem, 2.5vw, 1rem) clamp(1.25rem, 4vw, 1.5rem);
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}
.btn-reviews-toggle:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    color: #fff;
}
.btn-reviews-arrow {
    margin-left: 0.15rem;
}
.product-reviews-examples-title {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.reviews-list {
    margin-top: 0;
    display: block;
}
.reviews-list.is-open {
    display: block;
}
.reviews-list.is-hidden {
    display: none;
}
.btn-reviews-show-examples {
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
}
.btn-reviews-show-examples:hover {
    color: var(--primary-dark, #4338ca);
}
.review-item {
    padding: clamp(1.25rem, 4vw, 1.75rem);
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}
.review-item:hover {
    background: var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.review-item.review-item-link {
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.review-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    margin-bottom: 0.75rem;
}
.review-author {
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: var(--text-primary);
}
.review-date {
    font-size: clamp(0.875rem, 2.2vw, 0.95rem);
    color: var(--text-secondary);
}
.review-rating {
    color: #f59e0b;
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    letter-spacing: 0.05em;
    line-height: 1;
}
.review-text {
    margin: 0;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    color: var(--text-secondary);
    line-height: 1.55;
}
@media (max-width: 480px) {
    .product-reviews-anchor {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    .product-reviews-title {
        font-size: 1.5rem;
    }
    .review-item {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }
    .review-text {
        font-size: 1.05rem;
    }
}
@media (min-width: 769px) {
    .product-reviews-title {
        font-size: 1.75rem;
    }
    .review-item {
        max-width: 100%;
        padding: 1.75rem;
    }
}

@media (max-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1.5rem;
    }
    .product-detail-image {
        font-size: 4rem;
    }
    .image-zoom-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        bottom: 0.5rem;
        right: 0.5rem;
    }
    .image-modal-close {
        top: 1rem;
        right: 1rem;
    }
    .product-detail-title {
        font-size: 1.25rem;
    }
    .product-detail-price {
        font-size: 1.75rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .layout-with-sidebar {
        flex-direction: column;
        gap: 1rem;
    }
    .sidebar {
        width: 100%;
        position: static;
    }
    .categories-toggle {
        display: block;
    }
    .categories-list {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s;
    }
    .categories-list.open {
        max-height: 70vh;
        overflow-y: auto;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    .nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Кнопки на мобильной — удобная зона нажатия и раскладка */
    .nav-menu__btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.65rem 1rem;
        -webkit-tap-highlight-color: rgba(79, 70, 229, 0.12);
    }
    .product-detail-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-top: 1rem;
    }
    .product-detail-actions .btn,
    .product-detail-actions .btn-buy {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        padding: 1rem 1.25rem;
        font-size: 1rem;
        justify-content: center;
        -webkit-tap-highlight-color: rgba(79, 70, 229, 0.12);
    }
    .btn-buy {
        min-height: 52px;
        padding: 1.1rem 1.25rem;
        font-size: 1.05rem;
    }
    .btn-reviews-toggle {
        width: 100%;
        min-height: 48px;
        justify-content: center;
        padding: 1rem 1.25rem;
        -webkit-tap-highlight-color: rgba(245, 158, 11, 0.2);
    }
    .product-card .product-actions {
        gap: 0.5rem;
    }
    .product-card .product-actions .btn {
        min-height: 44px;
        padding: 0.65rem 1rem;
        flex: 1 1 auto;
        min-width: 0;
        -webkit-tap-highlight-color: rgba(79, 70, 229, 0.12);
    }
    .close-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .product-detail-actions .btn,
    .product-detail-actions .btn-buy {
        padding: 1rem 1rem;
    }
    .btn-reviews-toggle {
        padding: 1rem 1rem;
    }
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Лента «Вам зайдёт» внизу страницы товара */
.product-more-strip {
    margin-top: 2.5rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border-color);
}

.product-more-strip__title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.product-more-strip__list {
    display: grid;
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: column;
    grid-auto-columns: minmax(160px, 1fr);
    gap: 1rem;
}

.product-more-strip__item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-more-strip__item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.product-more-strip__item:hover .product-more-strip__btn {
    background: var(--primary-color);
    color: #fff;
}

.product-more-strip__img-wrap {
    position: relative;
    width: 100%;
}

.product-more-strip__discount {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    z-index: 2;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.45);
    line-height: 1;
}

.product-more-strip__img {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(145deg, var(--primary-light) 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-more-strip__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-more-strip__emoji {
    font-size: 2.5rem;
}

.product-more-strip__name {
    padding: 0.5rem 0.75rem 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-more-strip__price-block {
    padding: 0 0.75rem 0.4rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
}

.product-more-strip__price-old {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-more-strip__price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-color);
}

.product-more-strip__btn {
    margin: 0 0.75rem 0.75rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.12);
    border-radius: var(--radius-md);
    transition: background 0.2s, color 0.2s;
    margin-top: auto;
}

/* Список заказов (orders.html) */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}
.order-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}
.order-card__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.order-card__date {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.order-card__row {
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}
.order-card__row:last-child {
    margin-bottom: 0;
}
.order-card__label {
    color: var(--text-secondary);
    margin-right: 0.35rem;
}
