:root {
    --bg-color: #f4f7fa;
    --card-bg: #ffffff;
    --primary-blue: #6395f9;
    --primary-blue-600: #4d7edb;
    --primary-blue-soft: #e7efff;
    --text-main: #1f2937;
    --text-gray: #6b7280;
    --text-light-gray: #9ca3af;
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 12px;
    --shadow-subtle: 0 10px 30px rgba(0, 0, 0, 0.06);
    --ring: 0 0 0 4px rgba(99, 149, 249, 0.18);
}

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

html, body {
    height: 100%;
}

body {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: radial-gradient(1200px 500px at 30% -10%, rgba(99, 149, 249, 0.18), transparent 60%), var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page {
    padding: 28px 0 60px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-subtle);
}

.site-header {
    padding: 18px 0;
}

.header {
    display: grid;
    grid-template-columns: auto 1fr 420px auto;
    gap: 18px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-subtle);
    backdrop-filter: blur(10px);
}

.brand {
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
    letter-spacing: -0.02em;
    padding: 8px 10px;
    border-radius: 12px;
}

.nav {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.nav a {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 10px;
    border-radius: 12px;
    transition: background-color 0.15s, color 0.15s;
}

.nav a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.7);
}

.nav a.is-active {
    color: var(--primary-blue);
    background: var(--primary-blue-soft);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(99, 149, 249, 0.16);
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 0.8rem;
    margin-left: 6px;
}

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

.input {
    width: 100%;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.9);
    padding: 0 14px;
    font-size: 0.95rem;
    outline: none;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.input:focus {
    border-color: rgba(99, 149, 249, 0.6);
    box-shadow: var(--ring);
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.link {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 10px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.7);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s, background-color 0.12s, color 0.12s;
    user-select: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary-blue);
    color: #fff;
    box-shadow: 0 10px 24px rgba(99, 149, 249, 0.28);
}

.btn-primary:hover {
    background: var(--primary-blue-600);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 1);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: rgb(185, 28, 28);
    border: 1px solid rgba(239, 68, 68, 0.22);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.16);
}

.btn-lg {
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 1rem;
}

.btn-sm {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--primary-blue);
    background: rgba(99, 149, 249, 0.16);
}

.pill-soft {
    color: var(--text-gray);
    background: rgba(148, 163, 184, 0.16);
}

.home-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: stretch;
    padding: 12px 0 28px;
}

.hero-content {
    padding: 8px 0;
}

.hero-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.hero-title {
    font-size: 3rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}

.hero-accent {
    display: inline-block;
    color: var(--primary-blue);
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-gray);
    max-width: 46ch;
}

.hero-cta {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.stat {
    padding: 14px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.stat-value {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.stat-label {
    margin-top: 4px;
    color: var(--text-light-gray);
    font-weight: 600;
    font-size: 0.85rem;
}

.hero-media {
    padding: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99, 149, 249, 0.10), rgba(255, 255, 255, 0.85));
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.hero-media-top {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.media-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.8rem;
    color: #fff;
    background: var(--primary-blue);
}

.media-title {
    margin-top: 12px;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.media-desc {
    margin-top: 6px;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 0.92rem;
}

.hero-media-bottom {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.media-item {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.22);
    display: flex;
    gap: 10px;
    align-items: center;
}

.media-emoji {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(99, 149, 249, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.media-name {
    font-weight: 800;
    font-size: 0.95rem;
}

.media-sub {
    color: var(--text-light-gray);
    font-weight: 700;
    font-size: 0.8rem;
    margin-top: 2px;
}

.section {
    margin-top: 34px;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.section-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.92rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.category-card {
    padding: 18px;
    text-decoration: none;
    border: 1px solid rgba(148, 163, 184, 0.18);
    transition: transform 0.12s, box-shadow 0.12s;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.category-emoji {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 149, 249, 0.12);
    font-size: 1.6rem;
}

.category-name {
    margin-top: 12px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.category-sub {
    margin-top: 4px;
    color: var(--text-gray);
    font-weight: 700;
    font-size: 0.88rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.featured {
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.featured-top {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.featured-title {
    margin-top: 12px;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.featured-desc {
    margin-top: 6px;
    color: var(--text-gray);
    font-weight: 700;
    font-size: 0.92rem;
}

.featured-bottom {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.price {
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--primary-blue);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.info {
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.info-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: rgba(99, 149, 249, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.info-title {
    margin-top: 12px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.info-desc {
    margin-top: 6px;
    color: var(--text-gray);
    font-weight: 700;
    font-size: 0.92rem;
}

.footer {
    margin-top: 42px;
}

.footer-inner {
    padding: 22px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-brand {
    font-weight: 900;
    letter-spacing: -0.02em;
}

.footer-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--text-gray);
    font-weight: 700;
    font-size: 0.92rem;
}

.shop-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
    padding: 10px 0 18px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.page-subtitle {
    margin-top: 8px;
    color: var(--text-gray);
    font-weight: 700;
}

.shop-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin: 10px 0 18px;
    flex-wrap: wrap;
}

.chip-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chip {
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-gray);
    font-weight: 800;
    font-size: 0.9rem;
    border-radius: 999px;
    padding: 9px 12px;
    cursor: pointer;
    transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}

.chip.is-active {
    background: var(--primary-blue-soft);
    border-color: rgba(99, 149, 249, 0.35);
    color: var(--primary-blue);
}

.select select {
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.9);
    padding: 0 12px;
    font-weight: 800;
    color: var(--text-gray);
    outline: none;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.product-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    transition: transform 0.12s, box-shadow 0.12s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.product-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    background: linear-gradient(135deg, rgba(99, 149, 249, 0.16), rgba(255, 255, 255, 0.95));
    text-decoration: none;
}

.product-emoji {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--text-gray);
    font-weight: 800;
    font-size: 0.8rem;
}

.product-body {
    padding: 16px 16px 18px;
}

.product-title {
    display: inline-block;
    text-decoration: none;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.product-title:hover {
    color: var(--primary-blue);
}

.product-desc {
    margin-top: 8px;
    color: var(--text-gray);
    font-weight: 700;
    font-size: 0.92rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-bottom {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 14px;
    align-items: start;
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    padding: 14px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.cart-item-main {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.cart-item-emoji {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: rgba(99, 149, 249, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex: none;
}

.cart-item-name {
    font-weight: 900;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-meta {
    margin-top: 4px;
    color: var(--text-gray);
    font-weight: 700;
    font-size: 0.9rem;
}

.cart-item-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: none;
}

.cart-item-price {
    font-weight: 900;
    color: var(--primary-blue);
    letter-spacing: -0.02em;
}

.summary {
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.summary-title {
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-gray);
    font-weight: 800;
    margin-top: 10px;
}

.summary-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.22);
    margin: 14px 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.summary-total-price {
    color: var(--primary-blue);
}

.empty {
    padding: 36px 18px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    display: grid;
    justify-items: center;
    gap: 10px;
}

.empty-emoji {
    width: 64px;
    height: 64px;
    border-radius: 24px;
    background: rgba(99, 149, 249, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.empty-title {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1.1rem;
}

.empty-desc {
    color: var(--text-gray);
    font-weight: 700;
}

@media (max-width: 1100px) {
    .header {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "brand actions"
            "nav nav"
            "search search";
    }
    .brand { grid-area: brand; }
    .nav { grid-area: nav; }
    .search { grid-area: search; }
    .header-actions { grid-area: actions; }
}

@media (max-width: 980px) {
    .home-hero {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-media-bottom {
        grid-template-columns: 1fr;
    }
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .featured-grid {
        grid-template-columns: 1fr;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .hero-title {
        font-size: 2.1rem;
    }
    .product-grid {
        grid-template-columns: 1fr;
    }
    .header {
        padding: 12px 12px;
    }
}

.inline-form {
    display: inline;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(99, 149, 249, 0.12);
    color: var(--primary-blue);
    font-weight: 900;
    font-size: 0.9rem;
}

.flash {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.flash-item {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(99, 149, 249, 0.10);
    border: 1px solid rgba(99, 149, 249, 0.18);
    color: var(--text-main);
    font-weight: 800;
}

.auth-layout {
    display: grid;
    justify-content: center;
    padding: 30px 0;
}

.auth {
    width: min(520px, 100%);
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.auth-subtitle {
    margin-top: 8px;
    color: var(--text-gray);
    font-weight: 700;
}

.auth-form {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.field {
    display: grid;
    gap: 8px;
}

.field-label {
    font-weight: 900;
    font-size: 0.92rem;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.auth-form input {
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.9);
    padding: 0 14px;
    font-size: 0.95rem;
    outline: none;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.auth-form input:focus {
    border-color: rgba(99, 149, 249, 0.6);
    box-shadow: var(--ring);
}

.field-error {
    color: rgb(185, 28, 28);
    font-weight: 800;
    font-size: 0.9rem;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}
