/**
 * 商品頁 V2 — 精緻極簡型錄
 * Kingpork 金園排骨 / Laravel 5.4
 *
 * 設計原則:溫暖中性主調、品牌暖橘為單一實色重點、克制的微互動。
 * 本檔案不依賴 variables.css(此頁未載入),自帶 scoped token。
 */

.pc-page,
.pc-nav,
.pc-cart-fab {
    --pc-bg: #faf8f5;
    --pc-surface: #ffffff;
    --pc-cream: #f5f0e8;
    --pc-ink: #2b2622;
    --pc-ink-2: #6f665f;
    --pc-muted: #a89e93;
    --pc-line: #ece7df;
    --pc-accent: #ec971f;
    --pc-accent-deep: #c97d1a;
    --pc-price: #b23b2e;
    --pc-shadow-sm: 0 1px 2px rgba(43, 38, 34, 0.04);
    --pc-shadow-md: 0 6px 20px rgba(43, 38, 34, 0.07);
    --pc-shadow-lg: 0 14px 40px rgba(43, 38, 34, 0.10);
    --pc-radius: 14px;
    --pc-radius-sm: 10px;
    --pc-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --pc-t: 250ms var(--pc-ease);
    --pc-serif: "Noto Serif TC", "Songti TC", "PingFang TC", serif;
}

/* 讓整頁的底色延伸(main.blade 的背景不受影響,僅此頁內容區) */
.pc-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 18px 96px;
    color: var(--pc-ink);
}

/* ==========================================
   1. 類別導航列
   ========================================== */
.pc-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 248, 245, 0.88);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--pc-line);
}

.pc-nav__track {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 18px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.pc-nav__track::-webkit-scrollbar {
    display: none;
}

.pc-nav__item {
    scroll-snap-align: start;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border: 1px solid var(--pc-line);
    border-radius: 999px;
    background: var(--pc-surface);
    color: var(--pc-ink-2);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--pc-t), border-color var(--pc-t), background var(--pc-t), transform var(--pc-t);
}

.pc-nav__item:hover,
.pc-nav__item:focus {
    text-decoration: none;
    color: var(--pc-ink);
    border-color: var(--pc-accent);
    transform: translateY(-1px);
}

.pc-nav__item.is-active {
    background: var(--pc-accent);
    border-color: var(--pc-accent);
    color: #fff;
}

.pc-nav__icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--pc-cream);
    flex-shrink: 0;
}

/* 有 icon 時,左側改小內距讓圓形圖示貼近邊緣 */
.pc-nav__item--has-icon {
    padding-left: 8px;
}

@media (min-width: 768px) {
    .pc-nav__track {
        flex-wrap: wrap;
        overflow-x: visible;
        justify-content: center;
    }
}

/* ==========================================
   2. 版面骨架
   ========================================== */
.pc-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 28px;
}

@media (min-width: 768px) {
    .pc-layout {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        gap: 48px;
        align-items: start;
    }
    .pc-layout--no-hero {
        grid-template-columns: minmax(0, 720px);
        justify-content: center;
    }
}

/* ---- 主視覺大圖 ---- */
.pc-hero__frame {
    position: relative;
    background: var(--pc-cream);
    border-radius: var(--pc-radius);
    overflow: hidden;
    box-shadow: var(--pc-shadow-md);
}

.pc-hero__frame img {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity var(--pc-t);
}

.pc-hero__frame.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 3px solid rgba(236, 151, 31, 0.25);
    border-top-color: var(--pc-accent);
    border-radius: 50%;
    animation: pc-spin 0.7s linear infinite;
}

@media (min-width: 768px) {
    .pc-hero {
        position: sticky;
        top: 88px;
    }
}

/* ==========================================
   3. 商品清單標題
   ========================================== */
.pc-list-head {
    margin-bottom: 22px;
}

.pc-list-head__eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0.22em;
    color: var(--pc-accent-deep);
    font-weight: 600;
    margin-bottom: 10px;
}

.pc-list-head__title {
    font-family: var(--pc-serif);
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--pc-ink);
    margin: 0;
    letter-spacing: 0.01em;
}

@media (min-width: 768px) {
    .pc-list-head__title {
        font-size: 38px;
    }
}

/* ==========================================
   4. 商品卡片
   ========================================== */
.pc-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pc-card {
    display: flex;
    gap: 16px;
    padding: 14px;
    background: var(--pc-surface);
    border: 1px solid var(--pc-line);
    border-radius: var(--pc-radius);
    box-shadow: var(--pc-shadow-sm);
    cursor: pointer;
    transition: transform var(--pc-t), box-shadow var(--pc-t), border-color var(--pc-t);
}

.pc-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--pc-shadow-md);
    border-color: #e3d8c8;
}

.pc-card.is-active {
    border-color: var(--pc-accent);
    box-shadow: 0 0 0 1px var(--pc-accent) inset, var(--pc-shadow-md);
}

/* ---- 縮圖 ---- */
.pc-card__media {
    flex: 0 0 auto;
}

.pc-card__thumb {
    width: 96px;
    height: 96px;
    border-radius: var(--pc-radius-sm);
    object-fit: cover;
    background: var(--pc-cream);
    display: block;
}

.pc-card__thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--pc-serif);
    font-size: 20px;
    color: var(--pc-muted);
    letter-spacing: 0.1em;
}

/* ---- 內容 ---- */
.pc-card__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.pc-card__name {
    margin: 2px 0 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--pc-ink);
    line-height: 1.4;
}

.pc-card__desc {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--pc-ink-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pc-card__foot {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.pc-card__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 8px;
    min-width: 0;
}

.pc-price {
    font-family: var(--pc-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--pc-price);
    line-height: 1;
}

.pc-price__was {
    font-size: 14px;
    color: var(--pc-muted);
}

.pc-price__avg {
    font-size: 12px;
    color: var(--pc-muted);
    flex-basis: 100%;
}

/* ---- 加入按鈕 ---- */
.pc-add {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: none;
    border-radius: 999px;
    background: var(--pc-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(236, 151, 31, 0.28);
    opacity: 0;
    transition: opacity var(--pc-t), background var(--pc-t), transform var(--pc-t), box-shadow var(--pc-t);
}

.pc-add.is-ready {
    opacity: 1;
}

.pc-add:hover {
    background: var(--pc-accent-deep);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(201, 125, 26, 0.32);
}

.pc-add:active {
    transform: translateY(0);
}

.pc-add img {
    width: 17px;
    height: 17px;
    filter: brightness(0) invert(1);
}

/* 已加入購物車(JS 加上 deleteKartBtn) */
.pc-add.deleteKartBtn {
    background: #efe9e0;
    color: var(--pc-ink-2);
    box-shadow: none;
}

.pc-add.deleteKartBtn:hover {
    background: #e6ded2;
}

.pc-add.deleteKartBtn img {
    filter: none;
    opacity: 0.55;
}

/* Loading */
.pc-add.loading {
    pointer-events: none;
    color: transparent;
}

.pc-add.loading img {
    opacity: 0;
}

.pc-add.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: transparent;
    border-radius: 50%;
    animation: pc-spin 0.6s linear infinite;
}

.pc-add {
    position: relative;
}

/* 空商品 */
.pc-empty {
    text-align: center;
    padding: 56px 20px;
    color: var(--pc-muted);
}

.pc-empty__lead {
    font-family: var(--pc-serif);
    font-size: 22px;
    color: var(--pc-ink-2);
    margin: 0 0 6px;
}

.pc-empty__sub {
    font-size: 15px;
    margin: 0;
}

@media (max-width: 400px) {
    .pc-card__thumb {
        width: 78px;
        height: 78px;
    }
    .pc-card__foot {
        flex-direction: column;
        align-items: stretch;
    }
    .pc-add {
        justify-content: center;
    }
}

/* ==========================================
   5. 加價購
   ========================================== */
.pc-addon {
    margin-top: 64px;
    padding-top: 40px;
    border-top: 1px solid var(--pc-line);
}

.pc-addon__title {
    text-align: center;
    margin: 0 0 26px;
}

.pc-addon__title span {
    font-family: var(--pc-serif);
    font-size: 24px;
    font-weight: 600;
    color: var(--pc-ink);
    position: relative;
    padding: 0 22px;
}

.pc-addon__title span::before,
.pc-addon__title span::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 34px;
    height: 1px;
    background: var(--pc-accent);
    opacity: 0.6;
}

.pc-addon__title span::before { right: 100%; }
.pc-addon__title span::after { left: 100%; }

.pc-list--addon {
    max-width: 720px;
    margin: 0 auto;
}

/* ==========================================
   6. 類別介紹內容(後台 HTML)
   ========================================== */
.pc-content {
    margin-top: 64px;
    padding-top: 40px;
    border-top: 1px solid var(--pc-line);
    line-height: 1.85;
    color: var(--pc-ink-2);
}

.pc-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--pc-radius-sm);
}

.pc-content h2,
.pc-content h3 {
    font-family: var(--pc-serif);
    color: var(--pc-ink);
    margin: 32px 0 14px;
}

/* ==========================================
   7. 前往結帳(FAB)
   ========================================== */
.pc-cart-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 14px 24px;
    border: none;
    border-radius: 999px;
    background: var(--pc-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(236, 151, 31, 0.38);
    transition: background var(--pc-t), transform var(--pc-t), box-shadow var(--pc-t);
}

.pc-cart-fab:hover {
    background: var(--pc-accent-deep);
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(201, 125, 26, 0.42);
}

.pc-cart-fab:active {
    transform: translateY(0);
}

.pc-cart-fab img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

@media (min-width: 768px) {
    .pc-cart-fab {
        right: 32px;
        bottom: 32px;
        padding: 15px 28px;
        font-size: 16px;
    }
}

/* ==========================================
   共用動畫
   ========================================== */
@keyframes pc-spin {
    to { transform: rotate(360deg); }
}
