/* public/css/main.css */
/* Premium UI refresh – keep existing classnames working */

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

:root {
    --bg: #0b0f19;
    --bg-elev: rgba(255, 255, 255, 0.04);
    --bg-elev-2: rgba(255, 255, 255, 0.07);
    --card: rgba(255, 255, 255, 0.06);
    --card-2: rgba(255, 255, 255, 0.08);

    --text: rgba(255, 255, 255, 0.92);
    --muted: rgba(255, 255, 255, 0.66);
    --muted-2: rgba(255, 255, 255, 0.52);

    --border: rgba(255, 255, 255, 0.1);
    --border-2: rgba(255, 255, 255, 0.16);

    --accent: #7c5cff;
    --accent-2: #4dd6ff;
    --good: #35d07f;
    --danger: #ff4d4d;
    --warn: #ffb020;

    --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);

    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 10px;

    --container: 1120px;
    --header-h: 72px;

    --ring: 0 0 0 4px rgba(124, 92, 255, 0.2);
    --ring-2: 0 0 0 4px rgba(77, 214, 255, 0.16);
}

[data-theme="light"] {
    --bg: #f7f8fc;
    --bg-elev: rgba(15, 18, 26, 0.04);
    --bg-elev-2: rgba(15, 18, 26, 0.06);
    --card: rgba(255, 255, 255, 0.78);
    --card-2: rgba(255, 255, 255, 0.92);

    --text: rgba(15, 18, 26, 0.92);
    --muted: rgba(15, 18, 26, 0.66);
    --muted-2: rgba(15, 18, 26, 0.54);

    --border: rgba(15, 18, 26, 0.1);
    --border-2: rgba(15, 18, 26, 0.16);

    --shadow: 0 22px 60px rgba(12, 18, 38, 0.18);
    --shadow-soft: 0 12px 34px rgba(12, 18, 38, 0.12);

    --ring: 0 0 0 4px rgba(124, 92, 255, 0.14);
    --ring-2: 0 0 0 4px rgba(77, 214, 255, 0.12);
}

[data-theme="dark"] {
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.75);
    --muted-2: rgba(255, 255, 255, 0.6);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;

    background:
        radial-gradient(
            1200px 700px at 12% -10%,
            rgba(124, 92, 255, 0.22),
            transparent 62%
        ),
        radial-gradient(
            1000px 620px at 92% 0%,
            rgba(77, 214, 255, 0.18),
            transparent 60%
        ),
        radial-gradient(
            900px 620px at 60% 110%,
            rgba(53, 208, 127, 0.12),
            transparent 62%
        ),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 45%),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-color: rgba(124, 92, 255, 0.55);
}

main {
    padding: 22px 18px 48px;
    margin: 0 auto;
    max-width: var(--container);
}

/* Layout helpers */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 18px;
}

.centered {
    text-align: center;
}

/* Top header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    display: flex;
    align-items: center;
    padding: 0;
    background: rgba(10, 14, 24, 0.58);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .main-header {
    background: rgba(255, 255, 255, 0.75);
}

.main-header__nav {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Branding */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.brand__mark {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 30px rgba(124, 92, 255, 0.35);
    overflow: hidden;
    isolation: isolate;
}

.brand__mark::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 255, 255, 0.5) 60deg,
        transparent 120deg
    );
    animation: brand-rotate 4s linear infinite;
    z-index: 0;
}

.brand__mark::after {
    content: "$";
    position: relative;
    z-index: 1;
    animation: brand-pulse 1.8s ease-in-out infinite;
}

@keyframes brand-rotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes brand-pulse {
    0% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(255, 255, 255, 0.4);
    }

    20% {
        transform: scale(1.04);
        text-shadow: 0 0 6px rgba(255, 255, 255, 0.55);
    }

    40% {
        transform: scale(1.08);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    }

    60% {
        transform: scale(1.08);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    }

    80% {
        transform: scale(1.04);
        text-shadow: 0 0 6px rgba(255, 255, 255, 0.55);
    }

    100% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(255, 255, 255, 0.4);
    }
}

.brand__name {
    font-size: 15px;
    color: var(--text);
    opacity: 0.95;
    transition: opacity 160ms ease;
}

.brand:hover .brand__name {
    opacity: 1;
}

.nav-shell {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.main-header__item-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-header__item {
    margin: 0;
    padding: 0;
}

.main-header__item a,
.main-header__item button {
    font: inherit;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 12px;
    transition:
        transform 160ms ease,
        background 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.main-header__item a:hover,
.main-header__item button:hover {
    background: var(--bg-elev);
    border-color: var(--border);
    color: var(--text);
    transform: translateY(-1px);
}

.main-header__item a.active {
    background: linear-gradient(
        135deg,
        rgba(124, 92, 255, 0.22),
        rgba(77, 214, 255, 0.14)
    );
    border-color: rgba(124, 92, 255, 0.3);
    color: var(--text);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text);
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition:
        transform 160ms ease,
        background 160ms ease,
        border-color 160ms ease;
}

.theme-toggle:hover {
    background: var(--bg-elev-2);
    border-color: var(--border-2);
    transform: translateY(-1px);
}

.theme-toggle__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.theme-toggle__label {
    font-size: 12px;
    color: var(--muted);
}

/* Mobile menu */
#side-menu-toggle {
    border: 1px solid var(--border);
    font: inherit;
    padding: 10px 12px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-elev);
    color: var(--text);
    cursor: pointer;
    transition:
        transform 160ms ease,
        background 160ms ease,
        border-color 160ms ease;
}

#side-menu-toggle:hover {
    background: var(--bg-elev-2);
    border-color: var(--border-2);
    transform: translateY(-1px);
}

.hamburger {
    width: 16px;
    height: 10px;
    position: relative;
    display: inline-block;
}

.hamburger::before,
.hamburger::after,
.hamburger span {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text);
    border-radius: 999px;
    opacity: 0.85;
}

.hamburger::before {
    top: 0;
}

.hamburger span {
    top: 4px;
}

.hamburger::after {
    bottom: 0;
}

.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 40;
    display: none;
}

.mobile-nav {
    width: 380px;
    height: 100vh;
    max-width: calc(100% - 34px);
    position: fixed;
    left: 14px;
    top: 14px;
    background: rgba(12, 16, 28, 0.82);
    border: 1px solid var(--border);
    backdrop-filter: blur(18px);
    z-index: 60;
    padding: 18px;
    transform: translateX(-120%);
    transition: transform 240ms ease;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

[data-theme="light"] .mobile-nav {
    background: rgba(255, 255, 255, 0.88);
}

.mobile-nav.open {
    transform: translateX(0);
}

.mobile-nav__item-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    margin: 14px 0 0;
    padding: 0;
    gap: 8px;
}

.mobile-nav__item a,
.mobile-nav__item button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font: inherit;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    padding: 12px 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition:
        transform 160ms ease,
        background 160ms ease,
        border-color 160ms ease;
}

.mobile-nav__item a:hover,
.mobile-nav__item button:hover,
.mobile-nav__item a.active {
    background: var(--bg-elev-2);
    border-color: var(--border-2);
    transform: translateY(-1px);
}

/* Cards and grid */
.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 980px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.card {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.08),
        rgba(255, 255, 255, 0.04)
    );
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transform: translateZ(0);
    transition:
        transform 200ms ease,
        border-color 200ms ease,
        box-shadow 200ms ease;
}

[data-theme="light"] .card {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.98),
        rgba(255, 255, 255, 0.86)
    );
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(124, 92, 255, 0.26);
    box-shadow: var(--shadow);
}

.card__header,
.card__content {
    padding: 16px 16px 0;
}

.card__content {
    padding-bottom: 14px;
}

.card__header h1,
.card__content h1,
.card__content h2,
.card__content p {
    margin: 0;
}

.card__image {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.card__image img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    transform: scale(1.02);
    transition: transform 240ms ease;
}

.card:hover .card__image img {
    transform: scale(1.06);
}

.card__actions {
    padding: 14px 16px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    min-height: 40px;
    text-decoration: none;
    font: inherit;
    border: 1px solid rgba(124, 92, 255, 0.45);
    color: var(--text);
    background: linear-gradient(
        135deg,
        rgba(124, 92, 255, 0.22),
        rgba(77, 214, 255, 0.14)
    );
    border-radius: 14px;
    cursor: pointer;
    transition:
        transform 160ms ease,
        filter 160ms ease,
        border-color 160ms ease;
    user-select: none;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    border-color: rgba(77, 214, 255, 0.35);
}

.btn:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

.btn.secondary {
    background: var(--bg-elev);
    border-color: var(--border);
    color: var(--text);
}

.btn.secondary:hover {
    background: var(--bg-elev-2);
    border-color: var(--border-2);
}

.btn.danger {
    background: linear-gradient(
        135deg,
        rgba(255, 77, 77, 0.22),
        rgba(255, 176, 32, 0.12)
    );
    border-color: rgba(255, 77, 77, 0.5);
}

.btn.danger:hover {
    border-color: rgba(255, 77, 77, 0.7);
}

/* Messages */
.user-message {
    margin: 0 auto 16px;
    width: 100%;
    max-width: 720px;
    border: 1px solid rgba(77, 214, 255, 0.25);
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(77, 214, 255, 0.1);
    color: var(--text);
    text-align: left;
}

.user-message--error {
    border-color: rgba(255, 77, 77, 0.45);
    background: rgba(255, 77, 77, 0.1);
    color: var(--text);
}

/* Pagination */
.pagination {
    margin-top: 22px;
    text-align: center;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination a {
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    background: var(--bg-elev);
    padding: 10px 12px;
    border-radius: 12px;
    min-width: 40px;
    transition:
        transform 160ms ease,
        background 160ms ease,
        border-color 160ms ease;
}

.pagination a:hover {
    background: var(--bg-elev-2);
    border-color: var(--border-2);
    transform: translateY(-1px);
}

.pagination a.active {
    background: linear-gradient(
        135deg,
        rgba(124, 92, 255, 0.26),
        rgba(77, 214, 255, 0.14)
    );
    border-color: rgba(124, 92, 255, 0.35);
}

/* Product detail hero image */
.image {
    height: auto;
    max-width: 860px;
    margin: 14px auto;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: var(--shadow-soft);
}

.image img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

/* Page title block (optional helper) */
.page-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(
        135deg,
        rgba(124, 92, 255, 0.14),
        rgba(77, 214, 255, 0.08)
    );
    box-shadow: var(--shadow-soft);
    margin-bottom: 16px;
}

.page-hero h1 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0.2px;
}

.page-hero p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

/* Responsive nav switches */
@media (min-width: 900px) {
    #side-menu-toggle {
        display: none;
    }
}

@media (max-width: 899px) {
    .main-header__nav {
        display: none;
    }
}

/* ===== FOOTER ===== */

.site-footer {
    margin-top: 80px;
    padding-top: 50px;
    border-top: 1px solid var(--border);
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.04),
        rgba(255, 255, 255, 0.02)
    );
    backdrop-filter: blur(20px);
}

.footer-shell {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 18px 40px;
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 30px;
}

@media (min-width: 768px) {
    .footer-shell {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-col--brand {
    gap: 18px;
}

.footer-description {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    max-width: 320px;
}

.footer-title {
    font-size: 13px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: var(--text);
    font-size: 13px;
    opacity: 0.8;
    transition:
        opacity 160ms ease,
        transform 160ms ease;
}

.footer-links a:hover {
    opacity: 1;
    transform: translateX(4px);
}

.footer-link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    opacity: 0.8;
}

.footer-link-btn:hover {
    opacity: 1;
}

.footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-badge {
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--muted);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 18px 0;
    background: rgba(0, 0, 0, 0.15);
}

.footer-bottom-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
}

@media (min-width: 768px) {
    .footer-bottom-inner {
        flex-direction: row;
        align-items: center;
    }
}

.footer-dev {
    opacity: 0.7;
}

/* Force theme text color for headings and product titles */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text);
}

/* Page hero title/subtitle */
.page-hero h1,
.page-hero p {
    color: var(--text);
}

/* Product card titles (подстрой под свои классы, если отличаются) */
.card__header h1,
.card__content h2,
.card__content h1,
.product-item__title,
.product-title,
.product__title {
    color: var(--text);
}

/* Если заголовок обёрнут в ссылку */
.card__content a,
.card__header a {
    color: var(--text);
}
