:root {
    --bg: #f4f7ff;
    --bg-2: #fff9f0;
    --panel: #ffffff;
    --ink: #18243f;
    --muted: #5d6988;
    --line: #d9e1f3;
    --brand: #ff5a2f;
    --brand-2: #0d8cff;
    --ok: #0f8f5f;
    --err: #bf2e2e;
    --radius: 16px;
    --shadow: 0 16px 40px rgba(18, 42, 85, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(1200px 520px at -10% -10%, #d9f3ff 0%, transparent 45%),
        radial-gradient(1000px 480px at 110% 10%, #ffe8d1 0%, transparent 40%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    min-height: 100vh;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.9);
}

.brand {
    display: inline-flex;
    gap: 0.55rem;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
}

.brand strong {
    display: block;
    font-size: 0.96rem;
    letter-spacing: 0.2px;
}

.brand small {
    color: var(--muted);
    font-size: 0.7rem;
}

.brand-badge {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: var(--shadow);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.main-nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
}

.main-nav a:hover,
.main-nav a.active {
    background: #e9efff;
}

.auth-zone {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.86rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.38rem 0.65rem;
    background: #fff;
}

.user-chip span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--muted);
}

.page {
    max-width: 1160px;
    margin: 0 auto;
    padding: 1.2rem;
}

.hero {
    background: linear-gradient(145deg, #172a53, #203566 55%, #2a4685);
    color: #fff;
    border-radius: 22px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    animation: rise 0.45s ease;
}

.hero h1 {
    margin: 0;
    font-size: clamp(1.45rem, 3.4vw, 2.1rem);
}

.hero p {
    margin: 0.5rem 0 1rem;
    color: #d7e3ff;
    max-width: 720px;
}

.layout-two {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.grid-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.product-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    display: grid;
    grid-template-rows: 160px 1fr;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(25, 52, 101, 0.12);
}

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

.product-body {
    padding: 0.75rem;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.product-title {
    margin: 0 0 0.3rem;
    font-size: 1rem;
}

.new-badge {
    background: var(--brand);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.price-stack {
    display: flex;
    flex-direction: column;
}

.old-price {
    color: #8c95aa;
    text-decoration: line-through;
    font-size: 0.8rem;
}

.new-price {
    color: #103877;
    font-weight: 800;
}

.discount-tag {
    border-radius: 999px;
    background: #ffe7e0;
    color: #a22a10;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.22rem 0.5rem;
}

.stock-ok,
.stock-low,
.stock-out {
    font-size: 0.82rem;
    margin-bottom: 0.55rem;
}

.stock-ok {
    color: var(--ok);
}

.stock-low {
    color: #b06b00;
}

.stock-out {
    color: var(--err);
}

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

.btn {
    border: 0;
    border-radius: 10px;
    padding: 0.56rem 0.75rem;
    font-weight: 700;
    font-size: 0.88rem;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #ff7e29);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    filter: brightness(0.97);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn.ghost {
    color: #17346d;
    background: #ecf2ff;
}

.btn.danger {
    color: #fff;
    background: var(--err);
}

.btn.danger:hover {
    background: #c92a2a;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    padding: 0 0.4rem;
    color: #113779;
    background: #dce8ff;
    font-size: 0.75rem;
    font-weight: 700;
}

.cart-pill-bump {
    animation: cartBump 0.42s ease;
}

.cart-fly-dot {
    position: fixed;
    z-index: 1200;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    pointer-events: none;
    background: radial-gradient(circle at 30% 30%, #ffd9a6 0%, #ff8f1f 60%, #ff5a2f 100%);
    box-shadow: 0 0 0 6px rgba(255, 121, 38, 0.15), 0 8px 16px rgba(35, 53, 95, 0.28);
    transform: translate(0, 0) scale(1);
    opacity: 1;
    transition: transform 0.62s cubic-bezier(0.2, 0.78, 0.18, 1), opacity 0.62s ease;
}

.input,
select,
textarea {
    width: 100%;
    border: 1px solid #c8d4ef;
    border-radius: 10px;
    padding: 0.62rem 0.7rem;
    color: var(--ink);
    background: #fff;
    font-size: 0.95rem;
}

.input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #d8e7ff;
    border-color: var(--brand-2);
}

.form-grid {
    display: grid;
    gap: 0.55rem;
}

.status {
    border-radius: 10px;
    border: 1px solid var(--line);
    padding: 0.68rem 0.8rem;
    margin-top: 0.9rem;
    font-size: 0.9rem;
}

.status.info {
    background: #f7faff;
}

.status.success {
    background: #ecfff5;
    color: var(--ok);
    border-color: #bdeccf;
}

.status.error {
    background: #fff1f1;
    color: var(--err);
    border-color: #ffcaca;
}

.muted {
    color: var(--muted);
}

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 0.5rem 1rem 1.2rem;
}

.form-card {
    max-width: 520px;
    margin: 2rem auto;
    padding: 1rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.order-list {
    display: grid;
    gap: 0.7rem;
}

.order-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.7rem;
    background: #fff;
}

.review-list {
    display: grid;
    gap: 0.55rem;
}

.review-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.65rem;
    background: #fff;
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.9rem;
}

.product-detail img {
    width: 100%;
    height: 320px;
    border-radius: 14px;
    object-fit: cover;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
}

.metric-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.7rem;
    background: #f9fbff;
}

.metric-card span {
    color: var(--muted);
    font-size: 0.78rem;
}

.metric-card strong {
    display: block;
    font-size: 1.35rem;
    margin-top: 0.2rem;
}

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

@keyframes cartBump {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 920px) {
    .top-nav {
        grid-template-columns: 1fr;
    }

    .layout-two {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 580px) {
    .main-nav {
        gap: 0.2rem;
    }

    .main-nav a {
        font-size: 0.86rem;
        padding: 0.42rem 0.58rem;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }
}