﻿/* 檔名：wwwroot/css/market.css
 * 日期：2025-12-23
 * 描述：格外品市集專用樣式（獨立模組，不污染其他頁）
 * 目錄：
 *   1) Layout / Header
 *   2) Filter
 *   3) Card Grid
 *   4) Chips
 *   5) Details
 *   6) Upsert + Preview
 */

.market-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 16px 60px;
}

.market-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.market-kicker {
    font-size: 12px;
    letter-spacing: .18em;
    color: #64748b;
    margin-bottom: 4px;
}

.market-title h1 {
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 6px;
}

.muted {
    color: #64748b;
    font-size: 14px;
}

.market-btn-pill {
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
}

.market-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin: 4px 0 16px;
}

/* ========== Filter ========== */
.market-filter {
    background: #ffffff;
    border-radius: 18px;
    padding: 14px 14px 12px;
    box-shadow: 0 10px 26px rgba(15,23,42,.06);
    border: 1px solid rgba(148,163,184,.28);
    margin-bottom: 18px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.filter-item .filter-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

/* Pills */
.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,.40);
    background: #fff;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
}

    .pill input {
        width: 16px;
        height: 16px;
    }

    .pill.is-on {
        border-color: rgba(14,116,144,.35);
        background: rgba(224,242,254,.65);
    }

/* ========== Grid Cards ========== */
.market-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.market-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(148,163,184,.28);
    box-shadow: 0 10px 26px rgba(15,23,42,.06);
    transition: transform .12s ease, box-shadow .12s ease;
}

    .market-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 40px rgba(15,23,42,.10);
    }

.card-media {
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
}

    .card-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.card-body {
    padding: 12px 12px 12px;
}

.card-title {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.35;
    margin-top: 8px;
    min-height: 40px;
}

.card-meta {
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-dot {
    opacity: .7;
}

.card-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.price {
    font-weight: 900;
    font-size: 16px;
}

.seller {
    font-size: 12px;
    color: #64748b;
}

/* ========== Chips（從你首頁的 chip 視覺延伸，但放進獨立 css） ========== */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.card-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.details-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.preview-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.chip-soft {
    background: #e0f2fe;
    color: #0369a1;
}

.chip-temp {
    background: #ecfdf5;
    color: #047857;
}

.chip-ship {
    background: #fef9c3;
    color: #92400e;
}

/* ========== Empty State ========== */
.market-empty {
    background: #fff;
    border-radius: 18px;
    padding: 26px 18px;
    border: 1px dashed rgba(148,163,184,.55);
    text-align: center;
}

.empty-title {
    font-weight: 900;
    font-size: 16px;
    margin-bottom: 6px;
}

.empty-desc {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 12px;
}

/* ========== Details ========== */
.details-wrap {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 16px;
}

.details-gallery {
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,.28);
    box-shadow: 0 10px 26px rgba(15,23,42,.06);
    padding: 12px;
}

.gallery-main {
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    border-radius: 14px;
    overflow: hidden;
}

    .gallery-main img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow: auto;
    padding-bottom: 4px;
}

.thumb-btn {
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    cursor: pointer;
    border: 1px solid rgba(148,163,184,.35);
}

    .thumb-btn img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.gallery-video {
    margin-top: 12px;
}

.video-label {
    font-weight: 900;
    margin: 6px 0;
}

.gallery-video video {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(148,163,184,.28);
}

.details-panel {
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,.28);
    box-shadow: 0 10px 26px rgba(15,23,42,.06);
    padding: 14px;
}

.details-title {
    font-weight: 900;
    font-size: 22px;
    margin: 0 0 10px;
}

.details-price {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148,163,184,.28);
    margin-bottom: 10px;
}

.price-big {
    font-size: 24px;
    font-weight: 900;
}

.details-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(148,163,184,.18);
}

.row-k {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.row-v {
    font-size: 14px;
}

.details-desc {
    margin-top: 12px;
}

.desc-title {
    font-weight: 900;
    margin-bottom: 6px;
}

.desc-body {
    color: #334155;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.details-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
}

/* ========== Upsert ========== */
.upsert-wrap {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    align-items: start;
}

.upsert-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,.28);
    box-shadow: 0 10px 26px rgba(15,23,42,.06);
    padding: 14px;
    margin-bottom: 12px;
}

.upsert-section-title {
    font-weight: 900;
    margin-bottom: 10px;
}

.hint {
    color: #64748b;
    font-size: 12px;
    margin-top: 6px;
}

.existing-media {
    margin-top: 10px;
}

.existing-title {
    font-weight: 900;
    font-size: 13px;
    margin-bottom: 6px;
}

.existing-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

    .existing-grid img {
        width: 100%;
        aspect-ratio: 1/1;
        object-fit: cover;
        border-radius: 12px;
        border: 1px solid rgba(148,163,184,.28);
    }

.existing-media video {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(148,163,184,.28);
}

.upsert-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 4px 0 6px;
}

/* Preview */
.upsert-preview {
    position: sticky;
    top: 16px;
    background: transparent;
}

.preview-title {
    font-weight: 900;
    margin-bottom: 10px;
}

.preview-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,.28);
    box-shadow: 0 10px 26px rgba(15,23,42,.06);
    overflow: hidden;
}

.preview-cover {
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
}

    .preview-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.preview-body {
    padding: 12px;
}

.preview-title-text {
    font-weight: 900;
    font-size: 15px;
    margin: 6px 0 4px;
}

.preview-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.preview-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-gallery {
    margin-top: 12px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,.28);
    box-shadow: 0 10px 26px rgba(15,23,42,.06);
    padding: 12px;
}

.preview-subtitle {
    font-weight: 900;
    font-size: 13px;
    margin-bottom: 8px;
}

.preview-thumb-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

    .preview-thumb-grid img {
        width: 100%;
        aspect-ratio: 1/1;
        object-fit: cover;
        border-radius: 12px;
        border: 1px solid rgba(148,163,184,.28);
    }

/* ===== Seller Center (MyListings) ===== */
.seller-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 8px 0 14px;
}

.seller-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,.35);
    background: #fff;
    text-decoration: none;
    color: inherit;
    font-weight: 800;
    font-size: 13px;
}

    .seller-tab.is-on {
        background: rgba(224,242,254,.65);
        border-color: rgba(14,116,144,.35);
    }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.seller-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.seller-row {
    display: grid;
    grid-template-columns: 140px 1fr 320px;
    gap: 12px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,.28);
    box-shadow: 0 10px 26px rgba(15,23,42,.06);
    overflow: hidden;
}

.seller-cover {
    background: #f1f5f9;
}

    .seller-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.seller-info {
    padding: 12px 0;
    padding-right: 12px;
}

.seller-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.seller-title {
    font-weight: 900;
    font-size: 16px;
    line-height: 1.35;
}

.seller-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.seller-bottom {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.seller-actions {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

    .seller-actions form {
        margin: 0;
    }

@media (max-width: 1100px) {
    .seller-row {
        grid-template-columns: 120px 1fr;
    }

    .seller-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

/* ===== Cart ===== */
.cart-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,.28);
    box-shadow: 0 10px 26px rgba(15,23,42,.06);
    overflow: hidden;
}

.cart-cover {
    background: #f1f5f9;
}

    .cart-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.cart-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-title {
    font-weight: 900;
    font-size: 16px;
}

.cart-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.cart-actions {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-summary {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 10px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,.28);
    box-shadow: 0 10px 26px rgba(15,23,42,.06);
}

.cart-total {
    font-size: 20px;
    font-weight: 900;
}

.cart-checkout {
}


/* ========== RWD ========== */
@media (max-width: 1100px) {
    .market-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .upsert-wrap {
        grid-template-columns: 1fr;
    }

    .upsert-preview {
        position: relative;
        top: auto;
    }

    .details-wrap {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .market-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 420px) {
    .market-grid {
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }
}
