﻿/* =========================================================
   SHOP / CATALOG - APPLE-LIKE MINIMAL WHITE
   ========================================================= */

/* ===== Page ===== */
.catalog-page,
.shop-page {
    max-width: none;
    margin: 0;
    padding: 40px 0 64px;
    background: #fff;
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================================
   HERO
   ========================================================= */

.shop-hero {
    padding: 30px 0 18px;
    margin-bottom: 12px;
}

.shop-hero__inner {
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
}

.shop-hero__head {
    margin-bottom: 22px;
}

.shop-hero__title {
    margin: 0;
    font-size: clamp(38px, 5vw, 68px);
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #111;
}

/* 如果你后面加副标题，这个类直接可用 */
.shop-hero__subtitle {
    margin-top: 12px;
    font-size: 18px;
    line-height: 1.6;
    color: rgba(17, 17, 17, .62);
}

/* =========================================================
   FILTER
   ========================================================= */

.shop-filter {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

.shop-filter__field {
    position: relative;
    min-width: 0;
    flex: initial;
}

.shop-filter__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .35;
    pointer-events: none;
    font-size: 12px;
    color: #111;
}

.shop-filter__input,
.shop-filter__select {
    width: 100%;
    height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, .08);
    background: #f5f5f7;
    color: #111;
    padding: 0 16px 0 38px;
    outline: none;
    font-size: 14px;
    box-shadow: none;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

    .shop-filter__input:focus,
    .shop-filter__select:focus {
        border-color: rgba(0, 0, 0, .16);
        background: #fff;
        box-shadow: 0 0 0 3px rgba(0, 0, 0, .04);
    }

    .shop-filter__input::placeholder {
        color: rgba(17, 17, 17, .42);
    }

.shop-filter__btn {
    height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, .08);
    background: #111;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: transform .16s ease, opacity .16s ease, background .16s ease;
}

    .shop-filter__btn:hover {
        transform: translateY(-1px);
        opacity: .92;
    }

/* =========================================================
   PRODUCT GRID
   ========================================================= */

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 24px;
    margin-top: 34px;
}

/* =========================================================
   PRODUCT CARD
   ========================================================= */

.product-card {
    border: none;
    background: transparent;
    overflow: visible;
    min-width: 0;
    border-radius: 0;
    box-shadow: none;
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-media {
    background: #f5f5f7;
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .product-media img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
        padding: 24px;
        transition: transform .22s ease;
    }

.product-card:hover .product-media img {
    transform: scale(1.03);
}

.product-body {
    padding: 14px 2px 0;
}

.product-name {
    margin-top: 0;
}

    .product-name a,
    .product-name {
        font-size: 15px;
        line-height: 1.4;
        font-weight: 600;
        color: #111;
        text-decoration: none;
        display: block;
        white-space: normal;
        overflow: hidden;
        text-overflow: initial;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

.product-price {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 500;
    color: rgba(17, 17, 17, .62);
}

/* Apple 风先弱化操作按钮，保留结构 */
.product-actions {
    display: none;
}

/* =========================================================
   EMPTY
   ========================================================= */

.muted-inline {
    color: rgba(17, 17, 17, .56);
    font-size: 14px;
}

/* =========================================================
   PAGER
   ========================================================= */

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 44px;
}

    .pager a,
    .pager span {
        min-width: 38px;
        height: 38px;
        padding: 0 12px;
        border-radius: 999px;
        border: 1px solid rgba(0, 0, 0, .08);
        background: #f5f5f7;
        color: #111;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 500;
    }

        .pager a:hover {
            background: #ededf0;
        }

    .pager .current {
        background: #111;
        color: #fff;
        border-color: #111;
    }

/* =========================================================
   MOBILE MODES
   ========================================================= */

@media (max-width: 768px) {
    .catalog-page,
    .shop-page {
        padding: 24px 0 48px;
    }

    .wrap {
        padding: 0 16px;
    }

    .shop-hero {
        padding: 18px 0 10px;
    }

    .shop-hero__head {
        margin-bottom: 16px;
    }

    .shop-hero__title {
        font-size: clamp(30px, 9vw, 42px);
    }

    .shop-filter {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .shop-filter__field {
        min-width: 100%;
    }

    .shop-filter__btn {
        width: 100%;
    }

    /* 手机隐藏分页，按你原逻辑保留 */
    .pager {
        display: none;
    }

    /* ===== Waterfall ===== */
    .product-grid.product-grid--mobile-waterfall {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 18px 12px !important;
        overflow: visible !important;
        margin-top: 24px;
    }

        .product-grid.product-grid--mobile-waterfall .product-card {
            width: 100% !important;
            min-width: 0 !important;
            margin: 0 !important;
        }

    /* ===== Swipe ===== */
    .product-grid.product-grid--mobile-swipe {
        display: flex !important;
        gap: 12px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 2px 6px 6px 0;
        margin-top: 24px;
    }

        .product-grid.product-grid--mobile-swipe::-webkit-scrollbar {
            display: none;
        }

        .product-grid.product-grid--mobile-swipe .product-card {
            flex: 0 0 78% !important;
            min-width: 78% !important;
            width: 78% !important;
            scroll-snap-align: start;
            margin: 0 !important;
        }

    .product-media {
        border-radius: 20px;
    }

        .product-media img {
            padding: 16px;
        }

    .product-body {
        padding-top: 10px;
    }

    .product-name a,
    .product-name {
        font-size: 14px;
    }

    .product-price {
        font-size: 13px;
    }
}

/* =========================================================
   SMALL TABLET
   ========================================================= */

@media (min-width: 769px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-filter {
        grid-template-columns: 1fr 1fr;
    }
}
