/**
 * ============================================================
 * CtrlEat Official Shopping Website
 * ============================================================
 * CtrlEat 正式版购物网站
 * 版权归天河星雨工作室[thxymc Studio] thxymc.com所有
 * Copyright © 2026 thxymc.com. All rights reserved.
 * 网页由天河星雨工作室制作 thxymc.com
 * ！！未经允许禁止公开源码！！
 * ============================================================
 */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 12% 12%, rgba(34, 197, 94, 0.12), transparent 30%),
        radial-gradient(circle at 90% 8%, rgba(59, 130, 246, 0.10), transparent 28%),
        #f5f7fb;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

.shop-topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    height: 68px;
    padding: 0 5vw;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.92);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shop-logo {
    color: #16a34a;
    font-size: 1.5rem;
    font-weight: 1000;
    text-decoration: none;
}

.shop-nav {
    display: flex;
    gap: 1rem;
}

.shop-nav a {
    color: #334155;
    text-decoration: none;
    font-weight: 900;
}

.shop-nav a.active,
.shop-nav a:hover {
    color: #16a34a;
}

.mobile-filter-btn {
    display: none;
    border: 0;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-weight: 1000;
}

.shop-mobile-filter-entry {
    display: none;
}

.shop-page {
    flex: 1;
    width: min(1280px, 92vw);
    margin: 28px auto 60px;
}

.shop-hero,
.shop-sidebar,
.shop-toolbar,
.shop-empty,
.product-card {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.07);
}

.shop-hero {
    border-radius: 30px;
    padding: 30px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
    gap: 22px;
    align-items: center;
    margin-bottom: 20px;
}

.eyebrow {
    margin: 0 0 6px;
    color: #16a34a;
    font-weight: 1000;
}

.shop-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(2.1rem, 5vw, 4.2rem);
    letter-spacing: -0.06em;
}

.shop-hero p {
    margin: 0;
    color: #64748b;
    line-height: 1.8;
}

.hero-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 100px;
    gap: 10px;
}

.hero-search input,
.hero-search button,
.filter-form input,
.filter-form select,
.filter-form button {
    height: 48px;
    border-radius: 16px;
    font-size: 1rem;
}

.hero-search input,
.filter-form input,
.filter-form select {
    border: 1px solid #dbe3ef;
    padding: 0 14px;
    outline: none;
    background: #fff;
}

.hero-search input:focus,
.filter-form input:focus,
.filter-form select:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.hero-search button,
.filter-form button {
    border: 0;
    background: #16a34a;
    color: #fff;
    font-weight: 1000;
    cursor: pointer;
}

.shop-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.shop-sidebar {
    position: sticky;
    top: 88px;
    border-radius: 26px;
    padding: 18px;
}

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

.sidebar-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.sidebar-head button {
    display: none;
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    background: #fee2e2;
    color: #dc2626;
    font-weight: 1000;
}

.category-link,
.subcategory-list a,
.pill-link {
    text-decoration: none;
}

.shop-category-tree {
    display: grid;
    gap: 4px;
}

.shop-category-node {
    min-width: 0;
}

.shop-category-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
}

.shop-category-node-toggle,
.shop-category-node-spacer {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 12px;
}

.shop-category-node-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #334155;
    font-weight: 1000;
    cursor: pointer;
    transition: 0.16s ease;
}

.shop-category-node-toggle:hover,
.shop-category-node-toggle.is-expanded {
    background: #dcfce7;
    color: #166534;
}

.shop-category-node-toggle span {
    display: inline-block;
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.16s ease;
}

.shop-category-node-toggle.is-expanded span {
    transform: rotate(90deg);
}

.shop-category-children {
    display: grid;
    gap: 4px;
    margin: 4px 0 6px 18px;
    padding-left: 10px;
    border-left: 2px solid #e2e8f0;
}

.shop-category-children[hidden] {
    display: none !important;
}

.shop-category-link {
    min-width: 0;
}

.category-link {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 15px;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 900;
}

.category-link em {
    font-style: normal;
    color: #94a3b8;
    font-size: 0.82rem;
}

.category-link.active,
.category-link:hover {
    background: #dcfce7;
    color: #166534;
}

.subcategory-list {
    display: grid;
    gap: 4px;
    margin: 4px 0 8px 12px;
    padding-left: 10px;
    border-left: 2px solid #e2e8f0;
}

.subcategory-list a {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 12px;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subcategory-list a.active,
.subcategory-list a:hover {
    background: #f0fdf4;
    color: #166534;
}

.subcategory-list small {
    color: #94a3b8;
}

.sidebar-block {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.sidebar-block h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.pill-link {
    display: inline-flex;
    min-height: 34px;
    padding: 0 12px;
    margin: 0 6px 8px 0;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    align-items: center;
    font-weight: 900;
    font-size: 0.88rem;
}

.pill-link.active,
.pill-link:hover {
    background: #16a34a;
    color: #fff;
}

.shop-content {
    min-width: 0;
}

.shop-mobile-controls {
    display: none;
}

.shop-toolbar {
    border-radius: 26px;
    padding: 20px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.shop-toolbar h2 {
    margin: 0 0 5px;
    font-size: 1.6rem;
}

.shop-toolbar span {
    color: #64748b;
    font-weight: 800;
}

.filter-form {
    display: grid;
    grid-template-columns: 110px 110px 165px 78px;
    gap: 8px;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.active-filters span,
.active-filters a {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-weight: 900;
    font-size: 0.88rem;
    text-decoration: none;
}

.active-filters span {
    background: #f0fdf4;
    color: #166534;
}

.active-filters a {
    background: #fee2e2;
    color: #dc2626;
}

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

.product-card {
    border-radius: 26px;
    overflow: hidden;
    transition: 0.18s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.10);
}

.product-card.soldout {
    opacity: 0.72;
}

.product-image {
    position: relative;
    display: block;
    aspect-ratio: 1 / 0.78;
    background: #f1f5f9;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: 0.25s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.04);
}

.product-badges {
    position: absolute;
    left: 12px;
    top: 12px;
    right: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-badges span {
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.92);
    color: #fff;
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 1000;
}

.product-badges span.discount {
    background: rgba(234, 88, 12, 0.92);
}

.category-title-with-icon,
.shop-title-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.category-title-with-icon img {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    object-fit: cover;
    background: #e2e8f0;
    flex: 0 0 auto;
}

.category-title-with-icon span {
    min-width: 0;
}

.shop-title-with-icon img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    background: #e2e8f0;
}

.product-badges span.promo {
    background: rgba(14, 116, 144, 0.92);
}

.product-badges span.sold {
    background: rgba(100, 116, 139, 0.92);
}

.product-info {
    padding: 16px;
}

.product-title {
    display: block;
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 1000;
    text-decoration: none;
    line-height: 1.35;
}

.product-info p {
    min-height: 45px;
    margin: 8px 0 10px;
    color: #64748b;
    line-height: 1.6;
    font-weight: 700;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.product-meta span {
    padding: 6px 9px;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 900;
}

.product-price {
    color: #16a34a;
    font-weight: 1000;
    margin-bottom: 8px;
    display: grid;
    gap: 4px;
}

.product-price strong {
    color: #16a34a;
    font-size: 1.15rem;
}

.product-price del {
    color: #94a3b8;
    font-size: .88rem;
    font-weight: 900;
}

.product-price small {
    color: #ea580c;
    font-size: .82rem;
    font-weight: 1000;
}

.product-stock {
    color: #475569;
    font-weight: 900;
    font-size: 0.9rem;
}

.product-stock.low {
    color: #ea580c;
}

.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

.product-actions a {
    min-height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 1000;
}

.detail-btn {
    background: #e0f2fe;
    color: #075985;
}

.buy-btn {
    background: #16a34a;
    color: #fff;
}

.shop-empty {
    border-radius: 28px;
    padding: 42px 24px;
    text-align: center;
}

.shop-empty.small {
    padding: 34px 20px;
}

.shop-empty h2 {
    margin: 0 0 10px;
}

.shop-empty p {
    color: #64748b;
    margin: 0 0 18px;
}

.shop-empty a {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    text-decoration: none;
    font-weight: 1000;
    display: inline-flex;
    align-items: center;
}

.site-footer {
    width: min(1280px, 92vw);
    margin: 0 auto 22px;
    padding: 18px 10px;
    text-align: center;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.8;
}

.site-footer a {
    color: #16a34a;
    font-weight: 900;
    text-decoration: none;
}

.sidebar-mask {
    display: none;
}

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

    .shop-toolbar {
        grid-template-columns: 1fr;
    }

    .filter-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 820px) {
    .shop-topbar {
        height: auto;
        min-height: 64px;
        padding: 12px 4vw;
    }

    .shop-nav {
        gap: 0.65rem;
    }

    .shop-nav a {
        font-size: 0.84rem;
    }

    .mobile-filter-btn {
        display: inline-flex;
        align-items: center;
    }

    .shop-mobile-filter-entry {
        display: flex;
        justify-content: flex-end;
        width: calc(100% - 20px);
        margin: 8px auto 0;
    }

    .shop-page {
        width: min(100% - 18px, 1280px);
        margin-top: 10px;
    }

    .shop-hero {
        grid-template-columns: 1fr;
        border-radius: 18px;
        padding: 10px;
        margin-bottom: 10px;
    }

    .shop-hero > div {
        display: none;
    }

    .hero-search {
        grid-template-columns: minmax(0, 1fr) 70px;
        gap: 6px;
    }

    .hero-search input,
    .hero-search button {
        height: 40px;
        border-radius: 12px;
        font-size: 0.9rem;
    }

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

    .shop-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(330px, 86vw);
        z-index: 200;
        border-radius: 0 24px 24px 0;
        transform: translateX(-105%);
        transition: 0.2s ease;
        overflow-y: auto;
    }

    .shop-sidebar.open {
        transform: translateX(0);
    }

    .shop-mobile-controls {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 10px;
    }

    .shop-mobile-controls > button,
    .shop-view-toggle button {
        min-height: 36px;
        border: 0;
        border-radius: 999px;
        padding: 0 12px;
        font-weight: 1000;
    }

    .shop-mobile-controls > button,
    .shop-view-toggle button.active {
        background: #16a34a;
        color: #fff;
    }

    .shop-view-toggle {
        display: inline-flex;
        gap: 6px;
        padding: 4px;
        border-radius: 999px;
        background: #e2e8f0;
    }

    .shop-view-toggle button {
        background: transparent;
        color: #334155;
    }

    .shop-toolbar {
        display: none;
    }

    .shop-toolbar .eyebrow,
    .shop-title-with-icon,
    .shop-toolbar > div > span {
        display: none;
    }

    .filter-form {
        display: none;
    }

    .sidebar-head button {
        display: inline-flex;
    }

    .sidebar-mask {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.38);
        z-index: 180;
    }

    .sidebar-mask.show {
        display: block;
    }
}

@media (max-width: 560px) {
    .shop-logo {
        font-size: 1.2rem;
    }

    .shop-nav {
        gap: 0.45rem;
    }

    .shop-nav a {
        font-size: 0.76rem;
    }

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

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

    .product-card {
        border-radius: 14px;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    }

    .product-image {
        aspect-ratio: 1 / 0.66;
    }

    .product-info {
        padding: 8px;
    }

    .product-title {
        font-size: 0.82rem;
        line-height: 1.24;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-info p {
        min-height: 0;
        margin: 4px 0 6px;
        font-size: 0.7rem;
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-meta span,
    .product-badges span {
        font-size: 0.62rem;
        min-height: 19px;
        padding: 0 6px;
    }

    .product-meta span:nth-child(n+2),
    .product-badges span:nth-child(n+3) {
        display: none;
    }

    .product-price strong {
        font-size: 0.88rem;
    }

    .product-price del,
    .product-price small,
    .product-stock {
        font-size: 0.66rem;
        line-height: 1.25;
    }

    .product-actions {
        grid-template-columns: 1fr;
        gap: 5px;
        margin-top: 6px;
    }

    .product-actions a {
        min-height: 30px;
        font-size: 0.72rem;
    }

    .product-grid.mobile-list .product-card {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .product-grid.mobile-list .product-image {
        aspect-ratio: auto;
        min-height: 100%;
        height: 118px;
    }

    .product-grid.mobile-list .product-actions {
        grid-template-columns: 1fr 1fr;
    }

    .shop-mobile-controls {
        margin-bottom: 6px;
    }

    .shop-mobile-controls > button,
    .shop-view-toggle button {
        min-height: 30px;
        padding: 0 9px;
        font-size: 0.74rem;
    }

    .shop-view-toggle {
        padding: 3px;
        gap: 3px;
    }

    .shop-empty {
        padding: 22px 14px;
        border-radius: 16px;
    }
}

.shop-category-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    margin: 0 0 12px;
    border: 0;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-weight: 1000;
    cursor: pointer;
}

.shop-category-toggle.is-hidden,
.shop-sidebar.is-disabled,
.category-menu-disabled .shop-sidebar {
    display: none !important;
}

.shop-layout.category-menu-collapsed {
    grid-template-columns: minmax(0, 1fr);
}

.shop-sidebar.is-collapsed {
    display: none;
}

@media (max-width: 820px) {
    .shop-category-toggle {
        min-height: 34px;
        padding: 0 12px;
        margin-bottom: 8px;
        font-size: 0.84rem;
    }

    .shop-sidebar.open {
        display: block;
    }

    .shop-category-row {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .shop-category-node-toggle,
    .shop-category-node-spacer {
        width: 38px;
        height: 38px;
    }

    .shop-category-children {
        margin-left: 10px;
        padding-left: 8px;
    }

    .shop-category-link {
        min-height: 40px;
        padding-inline: 10px;
    }

    .category-title-with-icon span {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}
