/* ==========================================================================
   蟹·珍寶 · 前台商店樣式
   直接沿用 order.html 的原始設計（只加入長訊息 toast 換行）。
   ========================================================================== */

* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
        }

        body {
            background: #f5f2eb;
            background-image: radial-gradient(circle at 10% 20%, rgba(235, 215, 185, 0.3) 0%, transparent 30%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 1rem 0.75rem 2rem;
        }

        .app-container {
            max-width: 1100px;
            width: 100%;
        }

        /* header */
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 0.5rem 1.5rem;
            border-bottom: 2px solid #c49a6c;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
            gap: 0.8rem;
        }

        .logo-area {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .logo-icon {
            font-size: 2.2rem;
            color: #b45f2b;
            filter: drop-shadow(2px 4px 4px rgba(0,0,0,0.1));
        }

        .logo-text {
            font-size: 1.8rem;
            font-weight: 700;
            letter-spacing: 1px;
            color: #3e2c1b;
            line-height: 1.2;
        }

        .logo-text span {
            font-size: 1rem;
            font-weight: 400;
            color: #7a5a3a;
            display: block;
            letter-spacing: 2px;
        }

        .cart-icon-btn {
            background: #3e2c1b;
            color: #f9e9d2;
            border: none;
            border-radius: 50px;
            padding: 0.7rem 1.4rem;
            font-size: 1.1rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
            transition: all 0.2s;
        }

        .cart-icon-btn:hover {
            background: #5c3f24;
            transform: scale(1.02);
        }

        .cart-badge {
            background: #e6b17e;
            color: #2f1e0f;
            border-radius: 50%;
            width: 26px;
            height: 26px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
            font-weight: 700;
            margin-left: 6px;
        }

        /* category section */
        .category-section {
            margin-bottom: 2rem;
        }

        .category-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 1.5rem 0 1rem 0.25rem;
            padding-left: 12px;
            border-left: 5px solid #b45f2b;
        }

        .category-header h2 {
            font-size: 1.5rem;
            font-weight: 700;
            color: #3e2c1b;
        }

        .category-header .badge {
            background: #e9dac8;
            padding: 0.2rem 0.8rem;
            border-radius: 50px;
            font-size: 0.8rem;
            font-weight: 600;
            color: #6d513a;
        }

        /* product rows */
        .product-list {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .product-row {
            background: #fffffffa;
            border-radius: 20px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
            border: 1px solid #e9dac8;
            padding: 0.9rem 1.2rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            transition: box-shadow 0.2s;
        }

        .product-row:hover {
            box-shadow: 0 8px 20px rgba(90, 60, 30, 0.08);
        }

        .product-row-left {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex: 1;
            min-width: 0;
        }

        .product-icon {
            font-size: 2.2rem;
            width: 50px;
            text-align: center;
            flex-shrink: 0;
        }

        .product-details {
            flex: 1;
            min-width: 0;
        }

        .product-name {
            font-size: 1.1rem;
            font-weight: 700;
            color: #3e2c1b;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .product-name .weight-tag {
            background: #b45f2b;
            color: white;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 0.15rem 0.6rem;
            border-radius: 50px;
            letter-spacing: 0.5px;
        }

        .product-desc {
            font-size: 0.82rem;
            color: #7a6854;
            margin-top: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .product-price {
            font-size: 1.25rem;
            font-weight: 800;
            color: #b45f2b;
            flex-shrink: 0;
            margin-left: 0.5rem;
        }

        .product-price small {
            font-size: 0.75rem;
            font-weight: 400;
            color: #7a6854;
        }

        .product-row-right {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            flex-shrink: 0;
        }

        .stock-info {
            font-size: 0.75rem;
            background: #f1e6da;
            padding: 0.2rem 0.6rem;
            border-radius: 50px;
            color: #5a3f2a;
            font-weight: 500;
            white-space: nowrap;
        }

        .qty-control {
            display: flex;
            align-items: center;
            gap: 6px;
            background: #fbf7f1;
            border-radius: 50px;
            padding: 4px;
            border: 1px solid #e0cfbc;
        }

        .qty-btn {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            border: none;
            background: #ffffff;
            font-size: 1.2rem;
            font-weight: 600;
            color: #3e2c1b;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            transition: all 0.15s;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .qty-btn:hover {
            background: #b45f2b;
            color: white;
        }

        .qty-btn:disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }

        .qty-btn.plus {
            background: #b45f2b;
            color: white;
        }

        .qty-btn.plus:hover {
            background: #9a4b1f;
        }

        .qty-value {
            min-width: 28px;
            text-align: center;
            font-weight: 700;
            font-size: 1.05rem;
            color: #3e2c1b;
        }

        /* cart panel */
        .cart-panel {
            position: fixed;
            top: 0;
            right: -100%;
            width: 100%;
            max-width: 400px;
            height: 100vh;
            background: #ffffff;
            box-shadow: -8px 0 40px rgba(0, 0, 0, 0.2);
            z-index: 1000;
            display: flex;
            flex-direction: column;
            transition: right 0.3s ease-in-out;
            border-left: 2px solid #dbbd9a;
        }

        .cart-panel.open {
            right: 0;
        }

        .cart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.2rem 1.2rem;
            border-bottom: 2px solid #e9dac8;
            background: #fbf7f1;
        }

        .cart-header h3 {
            font-size: 1.35rem;
            color: #3e2c1b;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .close-cart {
            background: none;
            border: none;
            font-size: 1.8rem;
            cursor: pointer;
            color: #6d513a;
            line-height: 1;
            padding: 0 6px;
        }

        .cart-items {
            flex: 1;
            overflow-y: auto;
            padding: 1rem 1.2rem;
        }

        .cart-item {
            display: flex;
            gap: 12px;
            padding: 0.9rem 0;
            border-bottom: 1px solid #e6d6c5;
            align-items: center;
        }

        .cart-item-img {
            width: 55px;
            height: 55px;
            background: #eddcc9;
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
            color: #b48c62;
            flex-shrink: 0;
        }

        .cart-item-details {
            flex: 1;
        }

        .cart-item-title {
            font-weight: 700;
            color: #3e2c1b;
            font-size: 0.95rem;
        }

        .cart-item-price {
            font-size: 0.9rem;
            color: #b45f2b;
            font-weight: 600;
            margin-top: 3px;
        }

        .cart-item-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 5px;
        }

        .cart-item-actions button {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 1px solid #cba87b;
            background: #fff;
            font-size: 1.1rem;
            font-weight: 600;
            color: #3e2c1b;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            transition: all 0.1s;
        }

        .cart-item-actions button:hover {
            background: #b45f2b;
            color: white;
        }

        .cart-item-qty {
            font-weight: 600;
            min-width: 22px;
            text-align: center;
        }

        .cart-empty {
            text-align: center;
            padding: 3rem 1rem;
            color: #8a7764;
            font-size: 1rem;
        }

        .cart-empty i {
            font-size: 3rem;
            opacity: 0.5;
            margin-bottom: 1rem;
        }

        .cart-footer {
            padding: 1.2rem;
            border-top: 2px solid #e9dac8;
            background: #fbf7f1;
        }

        .cart-total {
            display: flex;
            justify-content: space-between;
            font-size: 1.2rem;
            font-weight: 800;
            margin-bottom: 1rem;
            color: #3e2c1b;
        }

        .cart-total span:last-child {
            color: #b45f2b;
        }

        .btn-checkout {
            background: #3e2c1b;
            color: #fff;
            border: none;
            border-radius: 50px;
            padding: 0.9rem;
            font-size: 1.1rem;
            font-weight: 700;
            width: 100%;
            cursor: pointer;
            transition: 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .btn-checkout:hover {
            background: #5c3f24;
        }

        .btn-checkout:disabled {
            background: #b3a18d;
            cursor: not-allowed;
        }

        /* overlay */
        .overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(2px);
            z-index: 999;
            display: none;
        }

        .overlay.active {
            display: block;
        }

        /* order modal */
        .modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            width: 90%;
            max-width: 550px;
            background: white;
            border-radius: 32px;
            z-index: 1100;
            padding: 1.8rem 1.5rem;
            box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
            display: none;
            opacity: 0;
            transition: 0.2s;
            max-height: 90vh;
            overflow-y: auto;
        }

        .modal.show {
            display: block;
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }

        .modal h2 {
            color: #3e2c1b;
            font-size: 1.6rem;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .modal-sub {
            color: #7a6854;
            margin-bottom: 1.5rem;
            font-size: 0.95rem;
        }

        .form-group {
            margin-bottom: 1rem;
        }

        .form-group label {
            display: block;
            font-weight: 600;
            color: #3e2c1b;
            font-size: 0.9rem;
            margin-bottom: 0.3rem;
        }

        .form-group input, .form-group textarea {
            width: 100%;
            padding: 0.8rem 1rem;
            border-radius: 30px;
            border: 1px solid #d6c3ae;
            font-size: 1rem;
            background: #fefcf9;
            transition: 0.2s;
        }

        .form-group input:focus, .form-group textarea:focus {
            outline: 2px solid #cba87b;
            border-color: transparent;
        }

        .form-group textarea {
            min-height: 80px;
            resize: vertical;
            border-radius: 20px;
        }

        /* payment method radio */
        .payment-options {
            display: flex;
            gap: 12px;
            margin-top: 6px;
            flex-wrap: wrap;
        }

        .payment-option {
            flex: 1;
            min-width: 140px;
            position: relative;
        }

        .payment-option input[type="radio"] {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .payment-option label {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 0.8rem 1rem;
            border-radius: 50px;
            border: 2px solid #e0cfbc;
            background: #fefcf9;
            font-weight: 600;
            font-size: 0.95rem;
            color: #5a3f2a;
            cursor: pointer;
            transition: all 0.2s;
            margin-bottom: 0;
            text-align: center;
        }

        .payment-option label i {
            font-size: 1.1rem;
        }

        .payment-option input[type="radio"]:checked + label {
            border-color: #b45f2b;
            background: #b45f2b;
            color: #fff;
            box-shadow: 0 4px 12px rgba(180, 95, 43, 0.3);
        }

        .payment-option label:hover {
            border-color: #b45f2b;
        }

        .modal-actions {
            display: flex;
            gap: 12px;
            margin-top: 1.8rem;
        }

        .btn-secondary {
            background: #e9dac8;
            border: none;
            border-radius: 50px;
            padding: 0.8rem;
            font-weight: 600;
            flex: 1;
            cursor: pointer;
            color: #3e2c1b;
            font-size: 1rem;
        }

        .btn-primary {
            background: #b45f2b;
            border: none;
            border-radius: 50px;
            padding: 0.8rem;
            font-weight: 700;
            flex: 1;
            cursor: pointer;
            color: white;
            font-size: 1rem;
        }

        .btn-primary:hover {
            background: #9a4b1f;
        }

        .toast {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            background: #2e2218;
            color: #f5e6d3;
            padding: 0.8rem 1.8rem;
            border-radius: 50px;
            font-weight: 500;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
            z-index: 1200;
            opacity: 0;
            transition: opacity 0.2s;
            pointer-events: none;
            white-space: nowrap;
            max-width: 90%;
            text-align: center;
        }

        .toast.show {
            opacity: 1;
        }

        /* responsiveness */
        @media (max-width: 640px) {
            .header {
                flex-direction: row;
                justify-content: space-between;
            }
            .logo-text {
                font-size: 1.4rem;
            }
            .logo-icon {
                font-size: 1.8rem;
            }
            .cart-panel {
                max-width: 100%;
            }
            .product-row {
                flex-wrap: wrap;
                padding: 0.9rem 1rem;
            }
            .product-row-left {
                flex-basis: 100%;
            }
            .product-row-right {
                width: 100%;
                justify-content: space-between;
                margin-top: 0.5rem;
                padding-top: 0.5rem;
                border-top: 1px dashed #e0cfbc;
            }
            .product-price {
                margin-left: 0;
            }
            .product-desc {
                white-space: normal;
            }
        }

        @media (max-width: 380px) {
            .product-name {
                font-size: 1rem;
            }
            .product-icon {
                font-size: 1.8rem;
                width: 40px;
            }
        }

/* 伺服器錯誤訊息可能較長，允許換行；不影響原本短訊息的外觀。 */
.toast {
    max-width: calc(100% - 2rem);
    white-space: normal;
    text-align: center;
    line-height: 1.5;
    padding: 0.7rem 1.2rem;
}

/* --------------------------------------------------------------------------
   品牌標語
   -------------------------------------------------------------------------- */
.store-tagline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #fffaf3 0%, #f3e4d0 100%);
    border: 1px solid #e7d3b9;
    border-radius: 24px;
    padding: 1.4rem 1.6rem;
    margin: 0 0 1.6rem;
    box-shadow: 0 8px 20px rgba(90, 60, 30, 0.06);
    position: relative;
    overflow: hidden;
}

.tagline-copy {
    min-width: 0;
}

.tagline-kicker {
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    color: #b45f2b;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.tagline-title {
    font-size: 1.6rem;
    line-height: 1.35;
    color: #3e2c1b;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.tagline-sub {
    margin-top: 0.4rem;
    font-size: 0.88rem;
    color: #7a6854;
}

.tagline-mark {
    font-size: 4.2rem;
    line-height: 1;
    opacity: 0.22;
    transform: rotate(-8deg);
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Footer / WhatsApp 聯絡
   -------------------------------------------------------------------------- */
.store-footer {
    border-top: 1px solid #e2d2be;
    margin-top: 2.2rem;
    padding: 1.4rem 0.4rem 0.4rem;
    color: #7a6854;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.footer-brand-icon {
    font-size: 1.7rem;
    line-height: 1;
}

.footer-brand strong {
    display: block;
    color: #3e2c1b;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.footer-brand-sub {
    font-size: 0.78rem;
    color: #8a7764;
    letter-spacing: 0.12em;
    margin-top: 1px;
}

.footer-contact {
    text-align: right;
}

.footer-label {
    font-size: 0.76rem;
    color: #8a7764;
    margin-bottom: 0.3rem;
}

.footer-wa {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #25d366;
    color: #073b1d;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.55rem 1rem;
    border-radius: 50px;
    transition: background 0.2s, transform 0.2s;
}

.footer-wa:hover {
    background: #1fbe5a;
    transform: translateY(-1px);
    color: #073b1d;
}

.footer-wa i {
    font-size: 1.15rem;
}

.footer-wa-muted {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    color: #8a7764;
}

.footer-wa-muted i {
    color: #25d366;
    font-size: 1.1rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    border-top: 1px solid #eee0cf;
    margin-top: 1rem;
    padding-top: 0.8rem;
    font-size: 0.74rem;
    color: #9b8874;
}

@media (max-width: 600px) {
    .store-tagline {
        padding: 1.1rem 1rem;
        border-radius: 18px;
        align-items: flex-start;
    }

    .tagline-title {
        font-size: 1.22rem;
    }

    .tagline-sub {
        font-size: 0.8rem;
    }

    .tagline-mark {
        font-size: 2.6rem;
        opacity: 0.18;
        align-self: flex-end;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
    }

    .footer-contact {
        text-align: left;
    }
}

