/* === Lazy Sheep 伺服器補償與獎勵商店樣式 === */

body {
    background-color: #141414;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    color: #dcdcdc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.market-container {
    max-width: 1100px;
    margin: 0 auto 50px auto;
    padding: 0 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* 頁面標頭區塊 */
.market-header {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 30px;
    background-color: rgba(37, 37, 37, 0.92);
    border: 4px solid #000000;
    box-shadow: inset -4px -4px 0px #151515, inset 4px 4px 0px #444444, 0 8px 20px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 2;
}

.market-title {
    font-family: 'Press Start 2P', cursive, sans-serif;
    color: #ffaa00;
    font-size: 1.6rem;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 0px #3f2a00;
}

.market-subtitle {
    color: #aaaaaa;
    font-size: 0.95rem;
    margin: 0;
}

/* 分類過濾按鈕 */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: #2a2a2a;
    color: #cccccc;
    border: 3px solid #000000;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: inset -2px -2px 0px #111, inset 2px 2px 0px #444;
    transition: all 0.15s ease;
}

.filter-btn:hover, .filter-btn.active {
    background-color: #ffaa00;
    color: #000000;
    font-weight: bold;
    box-shadow: inset -2px -2px 0px #b37700, inset 2px 2px 0px #ffdd80;
}

/* 商品卡片網格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* 單一商品卡片 */
.product-card {
    background-color: rgba(34, 34, 34, 0.95);
    border: 4px solid #000000;
    box-shadow: inset -4px -4px 0px #111111, inset 4px 4px 0px #3a3a3a, 0 6px 16px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.product-image-box {
    width: 100%;
    height: 180px;
    background-color: #101010;
    border-bottom: 3px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-image {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

/* 圖片缺省顯示標籤 */
.product-image-fallback {
    font-size: 3rem;
    color: #444;
}

.badge-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #000000;
    color: #ffff55;
    border: 2px solid #ffaa00;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-price {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #28a745;
    color: #ffffff;
    border: 2px solid #000;
    padding: 2px 8px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* 商品內容詳情 */
.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-name {
    font-size: 1.15rem;
    color: #ffaa00;
    margin: 0 0 10px 0;
    font-weight: bold;
}

.product-meta {
    font-size: 0.85rem;
    color: #aaaaaa;
    margin-bottom: 8px;
}

.product-meta span {
    color: #ffff55;
}

.product-desc {
    font-size: 0.88rem;
    color: #bbbbbb;
    margin-bottom: 16px;
    flex-grow: 1;
}

.expire-tag {
    font-size: 0.8rem;
    color: #ff5555;
    background-color: #1a0000;
    border: 1px solid #aa0000;
    padding: 4px 8px;
    margin-bottom: 12px;
    text-align: center;
}

/* 領取按鈕 */
.claim-btn {
    width: 100%;
    background-color: #ffaa00;
    color: #000000;
    border: 3px solid #000000;
    padding: 10px 0;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: inset -2px -2px 0px #b37700, inset 2px 2px 0px #ffdd80;
    transition: background-color 0.1s;
}

.claim-btn:hover {
    background-color: #ffff55;
}

.claim-btn:disabled {
    background-color: #555555;
    color: #888888;
    border-color: #000000;
    box-shadow: none;
    cursor: not-allowed;
}

/* === 彈出視窗 (Modal) 樣式 === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background-color: #222222;
    border: 4px solid #000000;
    box-shadow: inset -4px -4px 0px #111, inset 4px 4px 0px #444, 0 10px 30px rgba(0,0,0,0.8);
    width: 90%;
    max-width: 450px;
    padding: 24px;
    box-sizing: border-box;
    position: relative;
}

.modal-title {
    font-family: 'Press Start 2P', cursive, sans-serif;
    color: #ffaa00;
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 8px;
    border-bottom: 2px dashed #ffaa00;
    padding-bottom: 10px;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: #ffff55;
    margin-bottom: 18px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    color: #dddddd;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px;
    background-color: #101010;
    border: 2px solid #000000;
    color: #ffffff;
    box-shadow: inset 2px 2px 0px #000000, inset -1px -1px 0px #333333;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.form-input:focus {
    outline: none;
    border-color: #ffaa00;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.btn-submit {
    flex: 1;
    background-color: #28a745;
    color: #ffffff;
    border: 3px solid #000;
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: inset -2px -2px 0px #145a23, inset 2px 2px 0px #52d672;
}

.btn-submit:hover {
    background-color: #32c855;
}

.btn-cancel {
    flex: 1;
    background-color: #dc3545;
    color: #ffffff;
    border: 3px solid #000;
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: inset -2px -2px 0px #741a22, inset 2px 2px 0px #f16875;
}

.btn-cancel:hover {
    background-color: #ed4353;
}

/* Toast 浮動通知 */
.toast-msg {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #101010;
    color: #ffaa00;
    border: 3px solid #ffaa00;
    padding: 12px 24px;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.8);
    display: none;
    z-index: 10000;
}

@media (max-width: 600px) {
    .market-title {
        font-size: 1.2rem;
    }
}