﻿* {
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

:root {
    --bg: #ffffff;
    --bg-soft: #f6f7f9;
    --text: #0f172a;
    --text-soft: #475569;
    --header-h: 72px;
    --header-h-small: 56px;
    --radius: 18px;
}

body[data-mode="dark"] {
    --bg: #0b0f14;
    --bg-soft: #121826;
    --text: #e5e7eb;
    --text-soft: #94a3b8;
}

body {
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: var(--header-h);
    transition: background-color 0.35s ease, color 0.35s ease, padding-top 0.35s ease;
}

.header-progress {
    pointer-events: none;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    z-index: 1200;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
    transition: height 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

.site-header-inner {
    height: 100%;
    padding: 0 22px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    transition: padding 0.35s ease, gap 0.35s ease;
}

body.header-scrolled {
    padding-top: var(--header-h-small);
}

    body.header-scrolled .site-header {
        height: var(--header-h-small);
        backdrop-filter: blur(24px) saturate(160%);
        -webkit-backdrop-filter: blur(24px) saturate(160%);
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
    }

    body.header-scrolled .site-header-inner {
        padding: 0 12px;
        gap: 10px;
    }

.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    font-weight: 900;
    letter-spacing: -0.2px;
    justify-self: start;
}

.site-logo {
    height: 32px;
    width: auto;
}

.site-brand-name {
    font-size: 15px;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    justify-self: center;
    position: relative;
}

.header-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 16px;
    font-weight: 900;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    opacity: 0.88;
    transition: all 0.25s ease;
    user-select: none;
}

    .header-nav-link:hover {
        opacity: 1;
        transform: translateY(-1px);
        background: color-mix(in srgb, var(--primary) 14%, transparent);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
    }

    .header-nav-link.active {
        opacity: 1;
        background: radial-gradient( circle at top left, color-mix(in srgb, var(--primary) 26%, transparent), transparent 60% );
        box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent), 0 10px 26px color-mix(in srgb, var(--primary) 20%, transparent);
    }

.nav-icon {
    font-size: 17px;
    line-height: 1;
}

.nav-text {
    white-space: nowrap;
}

.site-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    justify-self: end;
}

.header-search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 14px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    font-weight: 900;
    font-size: 14px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--text);
    transition: all 0.25s ease;
}

    .header-search-btn:hover {
        background: color-mix(in srgb, var(--primary) 18%, transparent);
        box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent), 0 8px 22px color-mix(in srgb, var(--primary) 30%, transparent);
        transform: translateY(-1px);
    }

    .header-search-btn:active {
        transform: scale(0.97);
    }

.hamburger-btn {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--primary) 14%, transparent);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

    .hamburger-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent), 0 12px 28px rgba(0, 0, 0, 0.18);
    }

    .hamburger-btn span {
        position: absolute;
        left: 11px;
        right: 11px;
        height: 3px;
        border-radius: 4px;
        background: var(--text);
        transition: transform 0.35s ease, top 0.35s ease, opacity 0.25s ease;
    }

        .hamburger-btn span:nth-child(1) {
            top: 14px;
        }

        .hamburger-btn span:nth-child(2) {
            top: 21px;
        }

        .hamburger-btn span:nth-child(3) {
            top: 28px;
        }

body.drawer-open .hamburger-btn span:nth-child(1) {
    top: 21px;
    transform: rotate(45deg);
}

body.drawer-open .hamburger-btn span:nth-child(2) {
    opacity: 0;
}

body.drawer-open .hamburger-btn span:nth-child(3) {
    top: 21px;
    transform: rotate(-45deg);
}

.header-right-block {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 8px;
}

.header-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
}

.header-user-name {
    font-size: 13px;
    font-weight: 800;
}

.header-user-sub {
    font-size: 11px;
    opacity: 0.75;
    color: var(--text-soft);
    margin-top: 2px;
    white-space: nowrap;
}

.header-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

.header-login-primary {
    font-size: 14px;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
    line-height: 1.1;
    transition: all 0.25s ease;
}

    .header-login-primary:hover {
        text-decoration: underline;
        text-shadow: 0 0 14px color-mix(in srgb, var(--primary) 50%, transparent);
    }

.cart-link {
    position: relative;
}

.cart-preview {
    position: absolute;
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    width: 360px;
    border-radius: 18px;
    background: var(--bg);
    border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 2000;
}

.cart-link:hover .cart-preview {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.cart-preview-header {
    font-weight: 900;
    padding: 6px 8px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
}

.cart-preview-items {
    max-height: 280px;
    overflow: auto;
    padding: 10px 6px;
}

.cart-preview-empty {
    opacity: 0.7;
    padding: 10px 6px;
}

.cart-preview-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 10px;
    padding: 8px;
    border-radius: 14px;
    transition: background 0.2s ease;
}

    .cart-preview-item:hover {
        background: color-mix(in srgb, var(--primary) 10%, transparent);
    }

    .cart-preview-item img {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        object-fit: cover;
        border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
    }

.cart-preview-name {
    font-weight: 800;
    font-size: 13px;
}

.cart-preview-meta {
    font-size: 12px;
    opacity: 0.75;
    color: var(--text-soft);
    margin-top: 2px;
}

.cart-preview-price {
    font-weight: 900;
    font-size: 13px;
    white-space: nowrap;
}

.cart-preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px 4px;
    border-top: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
    font-weight: 900;
}

.theme-fab {
    position: fixed;
    right: 18px;
    bottom: 92px;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    z-index: 1600;
    background: var(--bg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
}

.theme-fab-menu {
    position: fixed;
    right: 18px;
    bottom: 154px;
    width: 210px;
    border-radius: 18px;
    background: var(--bg);
    border: 1px solid color-mix(in srgb, var(--primary) 14%, transparent);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.2);
    padding: 12px;
    z-index: 1600;
    display: none;
}

    .theme-fab-menu.open {
        display: block;
    }

.theme-mode-btn {
    width: 100%;
    border: 0;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
}

.theme-colors {
    display: flex;
    gap: 10px;
    padding-top: 12px;
}

.theme-color-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid color-mix(in srgb, var(--text) 10%, transparent);
}

    .theme-color-btn[data-color="orange"] {
        background: #f97316;
    }

    .theme-color-btn[data-color="blue"] {
        background: #3b82f6;
    }

    .theme-color-btn[data-color="green"] {
        background: #22c55e;
    }

    .theme-color-btn[data-color="purple"] {
        background: #8b5cf6;
    }

    .theme-color-btn[data-color="red"] {
        background: #ef4444;
    }

.header-progress {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1199;
}

body.header-scrolled .header-progress {
    top: var(--header-h-small);
}

.header-progress-bar {
    display: block;
    height: 100%;
    width: 0%;
    opacity: 0;
    background: linear-gradient(90deg, var(--primary), var(--primary-soft, var(--primary)));
    box-shadow: 0 0 12px color-mix(in srgb, var(--primary) 65%, transparent);
    transition: width 0.35s ease, opacity 0.3s ease;
}

.header-progress.active .header-progress-bar {
    opacity: 1;
}

.header-progress.complete .header-progress-bar {
    width: 100%;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.35s ease;
}

.page-content-wrapper {
    position: relative;
    min-height: 100vh;
}

.page-loader {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.12);
    opacity: 1;
    pointer-events: all;
    transition: opacity 0.35s ease;
}

    .page-loader.hide {
        opacity: 0;
        pointer-events: none;
    }

.loader-ring {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 3px solid rgba(148, 163, 184, 0.35);
    border-top-color: var(--primary);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.image-zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.image-zoom-box {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

    .image-zoom-box img {
        max-width: 80vw;
        max-height: 80vh;
        object-fit: contain;
        display: block;
        border-radius: 10px;
    }

.image-zoom-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

.fly-to-cart-img {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.7s ease;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px 10px;
    font-size: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.4);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
}

@media (max-width: 1024px) {
    .footer {
        display: none;
    }
}

.site-brand-center {
    display: none;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.site-brand-center-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.site-brand-center-name {
    font-weight: 900;
    font-size: 14px;
    line-height: 1.1;
    color: var(--text);
    white-space: nowrap;
    max-width: 70vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-brand-center-tagline {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-soft);
    opacity: 0.85;
    white-space: nowrap;
    line-height: 1;
    margin-top: 1px;
}

@media (max-width: 1024px) {
    .site-nav {
        display: none;
    }

    .hamburger-btn {
        display: inline-flex !important;
    }

    .header-right-block {
        display: none !important;
    }

    .site-brand {
        display: none !important;
    }

    .site-brand-center {
        display: flex;
        grid-column: 2;
        justify-self: center;
    }
}
