/* style.css - 煒昕電玩 徹底修復版 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700;900&family=Noto+Sans+Mono:wght@400;700&display=swap');

:root {
    --navy: #4a5568;
    --sage: #849b89;
    --bg: #f2f6f9;
    --white: #ffffff;
}

* { box-sizing: border-box; }

body {
    font-family: 'Noto Sans TC', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg);
    margin: 0;
    padding: 24px 18px 40px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100vh;
}

/* 破框：頂部置中、展示櫃寬版、表單窄版 */
.top-container{
    max-width: 900px;
    margin: 0 auto 18px auto;
    width: 100%;
}
.gallery-container{
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 20px 6px 10px;
}
.form-container{
    max-width: 600px;
    margin: 40px auto 0;
    width: 100%;
    padding: 22px 18px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 34px rgba(15,23,42,0.08);
}

.header {
    background-color: var(--navy);
    color: white;
    text-align: center;
    padding: 30px 20px;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.10);
}

form { padding: 0; }

/* ======= Tabs + 產品展示（雙館分頁） ======= */
.wm-tabs-container{
    display:flex;
    justify-content:center;
    gap:12px;
    padding: 18px 20px 0 20px;
    margin: 0 0 22px 0;
}
.wm-tab-btn{
    padding: 10px 24px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: 900;
    transition: all 0.3s ease;
    background: #eef2f7;
    color: #334155;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.wm-tab-btn:hover{ transform: translateY(-2px); filter: brightness(1.02); }
.wm-tab-btn.active{
    background: #475569;
    color: #fff;
    box-shadow: 0 14px 26px rgba(71, 85, 105, 0.30);
}
.wm-product-section {
    display: grid !important;
    /* 螢幕夠寬就並排 3~4 張，螢幕小就自動減少並排數量 */
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 24px !important;
    align-items: stretch;
    padding: 20px 0 !important;
}
.wm-product-section[style*="display:none"]{ display:none !important; }

/* ======= Card Layout（依需求固定結構） ======= */
.product-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: visible;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.store-front-container .product-card {
    height: auto;
    max-height: none;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}
.card-img-box {
    width: 100%;
    height: 220px; /* 固定圖片展示區高度 */
    background: #ffffff;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f1f5f9;
}
.card-img-box.product-img-container {
    position: relative;
}
.pre-order-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.72);
    padding: 4px 7px;
    border-radius: 4px;
    line-height: 1;
    pointer-events: none;
}
.card-price {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
}
.preorder-date,
.preorder-deposit {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.preorder-date {
    margin: 0;
}
.preorder-deposit {
    margin: 0;
}
.preorder-date + .preorder-deposit {
    margin-top: 6px;
}
.wm-product-section .product-card--preorder,
.carousel-track .product-card--preorder {
    min-height: 100%;
}
.card-img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important; /* 絕對不裁切圖片 */
}
.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 12px;
}
.card-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    color: #1e293b;
    line-height: 1.4;
}
.card-desc {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}
.card-btn {
    margin-top: auto;
    background: var(--pos-btn-bg, var(--button-color, #475569));
    color: var(--btn-text-color, #ffffff);
    text-align: center;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: background 0.2s, filter 0.2s;
}
.card-btn:hover {
    filter: brightness(0.92);
    background: var(--pos-btn-bg, var(--button-color, #475569));
}
.card-btn.instock{ background: var(--sage); }
.card-btn.instock:hover{ filter: brightness(1.04); background: var(--sage); }

.wm-empty{ grid-column: 1 / -1; padding: 18px 6px; color:#64748b; font-size: 14px; text-align:center; }

@media (max-width: 520px){
    body{ padding: 18px 12px 34px; }
    .gallery-container{ padding: 14px 0 6px; }
    .form-container{ margin-top: 26px; padding: 18px 14px; }
    .wm-product-section{ grid-template-columns: 1fr !important; padding: 12px 0 !important; }
    .card-img-box{ height: 240px; }
    .preorder-date,
    .preorder-deposit { line-height: 1.55; }
}

button, input, select, textarea { font-family: inherit; }
input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}
input:focus, select:focus, textarea:focus{
    border-color: #475569;
    box-shadow: 0 0 0 4px rgba(71, 85, 105, 0.14);
}

.submit-btn {
    background-color: var(--sage);
    color: white;
    border: none;
    padding: 18px;
    width: 100%;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 900;
    font-size: 16px;
    transition: filter .18s ease, transform .18s ease;
}
.submit-btn:hover{ filter: brightness(1.05); transform: translateY(-2px) scale(1.03); }

/* 表單與商品區拉開距離（交由 form-container 負責） */
.preorder-form{ margin-top: 0; padding-top: 0; border-top: none; }

/* 頁腳修正：變透明，且不設背景 */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 0.8rem;
    color: #a0aec0;
    width: 100%;
    background: transparent !important;
}
/* 檔案最後面只能有一個大括號，不要多！ */