*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0b0f19;
    --surface: #141b2d;
    --surface-2: #1c2438;
    --text: #e8edf7;
    --muted: #8b9bb4;
    --wb: #cb11ab;
    --ozon: #005bff;
    --accent: #6c5ce7;
    --radius: 16px;
    --shadow: 0 20px 40px rgba(0,0,0,.35);
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(11,15,25,.85); backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.header .container {
    display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 70px; width: auto; display: block; }
.nav { display: flex; gap: 28px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; transition: color .2s; }
.nav a:hover { color: var(--text); }
.burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; }
.burger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; }

.mobile-menu {
    position: fixed; inset: 72px 0 auto 0; background: var(--surface);
    padding: 24px; display: none; flex-direction: column; gap: 16px; z-index: 99;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.mobile-menu.open { display: flex; }
.mobile-menu a { color: var(--text); text-decoration: none; font-size: 1.1rem; font-weight: 500; }

.auth-area, .user-area { display: flex; align-items: center; gap: 12px; }
.btn-auth {
    background: transparent; border: 1.5px solid rgba(255,255,255,.15);
    color: var(--text); padding: 8px 18px; border-radius: 10px;
    font-weight: 500; font-size: 0.9rem; cursor: pointer; transition: all .2s;
}
.btn-auth:hover { border-color: var(--accent); color: var(--accent); }
.btn-reg { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-reg:hover { background: #5a4bd1; border-color: #5a4bd1; color: #fff; }
.user-greeting { color: var(--muted); font-size: 0.95rem; }
.user-greeting strong { color: var(--text); }
.mobile-auth, .mobile-user {
    display: flex; flex-direction: column; gap: 12px;
    margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08);
}

/* Hero */
.hero { padding: 140px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; }
.hero-text h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 800; line-height: 1.15; margin-bottom: 20px; }
.wb { color: var(--wb); } .ozon { color: var(--ozon); }
.hero-text p { color: var(--muted); font-size: 1.15rem; max-width: 480px; margin-bottom: 32px; }
.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 28px; border-radius: 12px; font-weight: 600; font-size: 1rem;
    text-decoration: none; border: none; cursor: pointer; transition: all .25s;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), #a29bfe); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(108,92,231,.4); }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid rgba(255,255,255,.15); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-full { width: 100%; }

.hero-cards { position: relative; height: 380px; }
.float-card {
    position: absolute; background: var(--surface); border-radius: 18px; padding: 16px;
    display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,.06); width: 260px;
}
.wb-float { top: 40px; left: 20px; transform: rotate(-6deg); }
.ozon-float { bottom: 30px; right: 10px; transform: rotate(5deg); }
.mini-img { width: 70px; height: 70px; border-radius: 12px; flex-shrink: 0; }
.mini-price { font-weight: 700; font-size: 1.15rem; }
.mini-title { color: var(--muted); font-size: .9rem; }

/* Stats */
.stats { padding: 40px 0 80px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat {
    background: var(--surface); border-radius: var(--radius); padding: 28px 20px;
    text-align: center; border: 1px solid rgba(255,255,255,.05);
}
.stat-num {
    font-size: 2.2rem; font-weight: 800;
    background: linear-gradient(135deg, #fff, #a29bfe);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { color: var(--muted); font-size: .9rem; margin-top: 6px; }

/* Portfolio */
.portfolio { padding: 80px 0; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head h2 { font-size: 2.4rem; font-weight: 800; margin-bottom: 12px; }
.section-head p { color: var(--muted); }
.filters { display: flex; justify-content: center; gap: 12px; margin-bottom: 40px; flex-wrap: wrap; }
.filter-btn {
    padding: 10px 22px; border-radius: 999px; background: var(--surface);
    border: 1px solid rgba(255,255,255,.08); color: var(--muted);
    font-weight: 500; cursor: pointer; transition: all .2s;
}
.filter-btn:hover, .filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.portfolio-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
    transition: max-height 0.5s ease;
}
.portfolio-grid.collapsed {
    max-height: 680px;
    overflow: hidden;
}
.portfolio-grid.collapsed::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 180px;
    background: linear-gradient(to bottom, transparent, var(--bg) 80%);
    pointer-events: none;
    z-index: 2;
}
.show-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}
.show-more-btn {
    padding: 14px 36px;
    border-radius: 12px;
    border: 1.5px solid rgba(255,255,255,.15);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s;
}
.show-more-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(108, 92, 231, 0.1);
}

.item {
    background: var(--surface); border-radius: 20px; overflow: hidden;
    border: 1px solid rgba(255,255,255,.05); transition: transform .3s, box-shadow .3s; position: relative;
}
.item:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.item.clickable { cursor: pointer; }
.item.hidden { display: none; }
.badge {
    position: absolute; top: 16px; left: 16px; z-index: 2;
    padding: 5px 12px; border-radius: 8px; font-size: .75rem; font-weight: 700; color: #fff;
}
.badge.wb { background: var(--wb); } .badge.ozon { background: var(--ozon); }
.card-img { height: 240px; background-size: cover; background-position: center; }
.card-body { padding: 18px 20px 16px; }
.card-body h3 {
    font-size: .95rem; font-weight: 600; line-height: 1.35; margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rating { color: #ffb400; font-size: .9rem; margin-bottom: 6px; }
.rating span { color: var(--muted); margin-left: 4px; }
.seller, .delivery { font-size: .82rem; color: var(--muted); }
.item-desc { padding: 0 20px 20px; border-top: 1px solid rgba(255,255,255,.05); margin-top: 4px; padding-top: 16px; }
.item-desc h4 { font-size: 1rem; margin-bottom: 4px; }
.item-desc p { color: var(--muted); font-size: .88rem; }

.fav-btn {
    position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%;
    background: rgba(0,0,0,.5); border: none; color: #fff; font-size: 1.1rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all .2s; z-index: 3;
}
.fav-btn:hover, .fav-btn.active { background: #ff4757; transform: scale(1.1); }
.loading-products { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 20px; }

/* Services */
.services { padding: 80px 0; }
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}
.service-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 28px 24px;
    border: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    transition: transform .25s, box-shadow .25s;
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}
.service-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.service-card p { color: var(--muted); font-size: 0.95rem; flex-grow: 1; margin-bottom: 18px; }
.service-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
}
.service-price span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--muted);
}

/* About */
.about { padding: 80px 0; background: linear-gradient(180deg, var(--bg), #0f1424); }
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step {
    background: var(--surface); border-radius: var(--radius); padding: 28px 22px;
    border: 1px solid rgba(255,255,255,.05);
}
.num { font-size: 1.8rem; font-weight: 800; color: var(--accent); margin-bottom: 14px; }
.step h3 { font-size: 1.15rem; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: .92rem; }

/* Contact */
.contact { padding: 80px 0 100px; }
.contact-box {
    background: var(--surface); border-radius: 24px; padding: 48px;
    max-width: 640px; margin: 0 auto; border: 1px solid rgba(255,255,255,.06); text-align: center;
}
.contact-box h2 { font-size: 2rem; margin-bottom: 12px; }
.contact-box > p { color: var(--muted); margin-bottom: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
input, select, textarea {
    width: 100%; padding: 14px 16px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,.1); background: var(--surface-2);
    color: var(--text); font-family: inherit; font-size: 1rem; margin-bottom: 14px;
    outline: none; transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }

/* Cabinet */
.cabinet { padding: 120px 0 80px; min-height: 80vh; }
.cabinet-header { text-align: center; margin-bottom: 48px; }
.cabinet-header h2 { font-size: 2.4rem; font-weight: 800; margin-bottom: 8px; }
.cabinet-header p { color: var(--muted); }
.cabinet-layout {
    display: grid; grid-template-columns: 240px 1fr; gap: 32px;
    background: var(--surface); border-radius: 20px; overflow: hidden;
    border: 1px solid rgba(255,255,255,.06);
}
.cabinet-sidebar {
    background: var(--surface-2); padding: 24px 16px;
    display: flex; flex-direction: column; gap: 8px;
}
.cab-tab {
    background: transparent; border: none; color: var(--muted);
    padding: 14px 18px; border-radius: 12px; text-align: left;
    font-size: 1rem; font-weight: 500; cursor: pointer; transition: all .2s;
}
.cab-tab:hover { background: rgba(255,255,255,.05); color: var(--text); }
.cab-tab.active { background: var(--accent); color: #fff; }
.cabinet-content { padding: 36px; }
.cab-panel { display: none; }
.cab-panel.active { display: block; }
.cab-panel h3 { font-size: 1.4rem; margin-bottom: 28px; }

.requests-list { display: flex; flex-direction: column; gap: 16px; }
.request-card {
    background: var(--surface-2); border-radius: 14px; padding: 20px;
    border: 1px solid rgba(255,255,255,.05);
}
.request-card .req-date { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.request-card .req-marketplace {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    font-size: 0.75rem; font-weight: 600; margin-bottom: 8px;
}
.req-wb { background: rgba(203,17,171,.2); color: #ff6bce; }
.req-ozon { background: rgba(0,91,255,.2); color: #5b9dff; }
.req-both { background: rgba(108,92,231,.2); color: #a29bfe; }
.request-card p { color: var(--muted); font-size: 0.95rem; margin-top: 6px; }

.favorites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.fav-card { background: var(--surface-2); border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.05); }
.fav-card-body { padding: 14px; }
.fav-card-body h4 { font-size: 0.95rem; margin-bottom: 10px; }
.empty-state { color: var(--muted); text-align: center; padding: 40px 20px; }

.admin-products-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.admin-product-item {
    background: var(--surface-2); border-radius: 12px; padding: 16px;
    display: flex; justify-content: space-between; align-items: center;
    border: 1px solid rgba(255,255,255,.05); flex-wrap: wrap; gap: 10px;
}
.admin-product-item h4 { font-size: 0.95rem; margin-bottom: 4px; }
.admin-product-item span { font-size: 0.8rem; color: var(--muted); }

.btn-delete {
    background: rgba(255,71,87,.15); color: #ff6b81; border: none;
    padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 0.85rem;
}
.btn-delete:hover { background: rgba(255,71,87,.3); }
.btn-edit {
    background: rgba(108, 92, 231, 0.15); color: #a29bfe; border: none;
    padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 0.85rem;
}
.btn-edit:hover { background: rgba(108, 92, 231, 0.3); }
.btn-order {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.15); background: var(--surface-2);
    color: var(--text); font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.btn-order:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-order:disabled { opacity: 0.3; cursor: not-allowed; }

.admin-users-list { display: flex; flex-direction: column; gap: 12px; }
.user-item {
    background: var(--surface-2); border-radius: 14px; padding: 18px 20px;
    display: flex; justify-content: space-between; align-items: center;
    border: 1px solid rgba(255,255,255,.05); flex-wrap: wrap; gap: 12px;
}
.user-info h4 { font-size: 1rem; margin-bottom: 4px; }
.user-info span { font-size: 0.85rem; color: var(--muted); }
.user-badges { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.badge-role { font-size: 0.75rem; padding: 3px 10px; border-radius: 6px; font-weight: 600; }
.badge-user { background: rgba(139,155,180,.2); color: #8b9bb4; }
.badge-moderator { background: rgba(0,184,148,.2); color: #00b894; }
.badge-admin { background: rgba(108,92,231,.2); color: #a29bfe; }
.badge-superadmin { background: rgba(255,71,87,.2); color: #ff6b81; }
.badge-blocked { background: rgba(255,71,87,.2); color: #ff6b81; font-size: 0.75rem; padding: 3px 10px; border-radius: 6px; font-weight: 600; }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-block {
    background: rgba(255,171,0,.15); color: #ffc107; border: none;
    padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 0.85rem;
}
.btn-block:hover { background: rgba(255,171,0,.3); }
.btn-unblock {
    background: rgba(0,184,148,.15); color: #00b894; border: none;
    padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 0.85rem;
}
.btn-unblock:hover { background: rgba(0,184,148,.3); }
.role-select, .status-select {
    padding: 7px 10px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1); background: var(--surface);
    color: var(--text); font-size: 0.85rem; outline: none; cursor: pointer;
}

.badge-pending { background: rgba(255,171,0,.2); color: #ffc107; font-size: 0.75rem; padding: 3px 10px; border-radius: 6px; }
.badge-paid { background: rgba(0,184,148,.2); color: #00b894; font-size: 0.75rem; padding: 3px 10px; border-radius: 6px; }
.badge-cancelled { background: rgba(255,71,87,.2); color: #ff6b81; font-size: 0.75rem; padding: 3px 10px; border-radius: 6px; }

/* Footer */
.footer { padding: 48px 0 28px; border-top: 1px solid rgba(255,255,255,.06); }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.footer-top p { color: var(--muted); margin-top: 8px; font-size: .9rem; }
.footer-links { display: flex; gap: 28px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { text-align: center; color: var(--muted); font-size: .85rem; }

/* Modals */
.modal {
    position: fixed; inset: 0; z-index: 1000;
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal.open { display: flex; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px); }
.modal-content {
    position: relative; background: var(--surface); border-radius: 20px;
    padding: 36px 32px; width: 100%; max-width: 420px;
    border: 1px solid rgba(255,255,255,.08); box-shadow: 0 25px 50px rgba(0,0,0,.5);
    animation: modalIn .3s ease; z-index: 1;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
    position: absolute; top: 16px; right: 18px; background: none; border: none;
    color: var(--muted); font-size: 1.8rem; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-content h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 28px; text-align: center; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group textarea {
    width: 100%; padding: 13px 16px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,.1); background: var(--surface-2);
    color: var(--text); font-size: 1rem; outline: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }
.switch-auth { text-align: center; margin-top: 22px; color: var(--muted); font-size: 0.9rem; }
.switch-auth a { color: var(--accent); text-decoration: none; font-weight: 600; }
.form-error {
    margin-top: 16px; padding: 12px; border-radius: 10px;
    background: rgba(255,71,87,.15); color: #ff6b81; font-size: 0.9rem;
    text-align: center; display: none;
}
.form-error.show { display: block; }

.toast {
    position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: #00b894; color: #fff; padding: 14px 28px; border-radius: 12px;
    font-weight: 600; opacity: 0; transition: all .4s; z-index: 2000; max-width: 90%; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: #ff4757; }

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-cards { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .process { grid-template-columns: 1fr 1fr; }
    .nav { display: none; }
    .burger { display: flex; }
    .auth-area, .user-area { display: none; }
}
@media (max-width: 768px) {
    .cabinet-layout { grid-template-columns: 1fr; }
    .cabinet-sidebar { flex-direction: row; overflow-x: auto; padding: 12px; }
    .cab-tab { white-space: nowrap; }
}
@media (max-width: 560px) {
    .stats-grid { grid-template-columns: 1fr; }
    .process { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .contact-box { padding: 32px 20px; }
    .portfolio-grid { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: 1fr; }
}