* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f0f0;
    color: #333;
    line-height: 1.5;
}

.page-container {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
}

.hidden { display: none !important; }

/* Hero */
.hero-image { width: 100%; display: block; }
.hero-placeholder { height: 180px; background: #ddd; }

/* Intro text */
.intro-section { padding: 0 16px 12px; }
.intro-text { word-wrap: break-word; white-space: pre-wrap; color: #444; }

/* Section titles */
.section-title {
    font-size: 16px;
    font-weight: 700;
    padding: 12px 16px 8px;
}

/* Location */
.location-section { padding-bottom: 8px; border-bottom: 1px solid #eee; }
.location-block { padding: 0 16px 16px; }
.location-status {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #c62828;
    line-height: 1.6;
}
.location-status.success { color: #333; }
.location-prefix { font-weight: 600; }
.pin-icon { flex-shrink: 0; font-size: 16px; }

/* Stores */
.stores-section { border-bottom: 8px solid #f5f5f5; }
.store-table-header {
    display: grid;
    grid-template-columns: 1fr 1.2fr 90px;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    background: #fafafa;
}
.no-location-prompt {
    margin: 16px;
    padding: 40px 20px;
    background: #e8e8e8;
    text-align: center;
    font-size: 14px;
    color: #666;
    border-radius: 4px;
}
.store-loading { text-align: center; padding: 24px; }
.spinner {
    width: 28px; height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: #2196F3;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.store-error {
    margin: 12px 16px;
    padding: 10px;
    background: #ffebee;
    color: #c62828;
    font-size: 13px;
    border-radius: 4px;
}
.store-list { list-style: none; }
.store-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr 90px;
    gap: 8px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}
.store-col-name { font-weight: 600; word-break: break-word; }
.store-col-addr { color: #666; word-break: break-word; }

/* Bottom section */
.bottom-section { padding: 16px; border-top: 1px solid #eee; }
.bottom-flex {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}
.bottom-left { flex: 1; min-width: 0; }
.bottom-field { margin-bottom: 8px; line-height: 1.5; }
.bottom-label { font-weight: 700; margin-right: 6px; }
.selected-provider { text-decoration: underline; font-weight: 600; word-break: break-word; }

/* Buttons */
.btn {
    border: none;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
}
.btn:active { opacity: .85; }
.btn-pill { border-radius: 24px; padding: 10px 24px; display: inline-block; }
.btn-blue { background: #2196F3; color: #fff; }
.btn-green { background: #4CAF50; color: #fff; }
.btn-choose { padding: 8px 10px; font-size: 12px; white-space: nowrap; border-radius: 20px; }
.btn-choose.selected { background: #2e7d32; }
.btn-coupon-side {
    flex-shrink: 0;
    padding: 16px 14px;
    font-weight: 700;
    border-radius: 8px;
    min-width: 100px;
    line-height: 1.3;
}

/* Footer */
.footer {
    padding: 16px;
    font-size: 12px;
    color: #888;
    white-space: pre-wrap;
    text-align: center;
}

/* Modal alert */
.modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
.modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
}
.modal-content p { margin-bottom: 16px; font-size: 15px; }

/* ===== Cart Page ===== */
.cart-page { padding-bottom: 32px; }
.cart-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}
.cart-header h1 { font-size: 18px; font-weight: 600; }
.back-btn { font-size: 22px; text-decoration: none; color: #333; }

.cart-items { padding: 0 16px; }
.cart-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}
.cart-item-img {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; margin-bottom: 8px; }
.cart-item-price { font-size: 15px; font-weight: 600; text-align: right; color: #e53935; }
.empty-cart { padding: 24px; text-align: center; color: #999; }

.cart-provider {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.receipt-section { padding: 16px; }
.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}
.receipt-row.total { font-weight: 700; font-size: 15px; margin-top: 4px; }

.btn-pay {
    margin: 16px;
    width: calc(100% - 32px);
    background: #00897b;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 16px;
    border-radius: 8px;
}

.cart-footer {
    padding: 0 16px 24px;
    font-size: 12px;
    color: #666;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Image lightbox */
.image-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.85);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000; padding: 20px;
}
.image-modal img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
}
.image-modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(255,255,255,.9);
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

@media (min-width: 481px) {
    .page-container { box-shadow: 0 0 20px rgba(0,0,0,.1); }
}

/* Email page */
.email-page .cart-header h1 { font-size: 16px; }
.email-form-section { padding: 24px 16px; }
.email-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.email-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    margin-bottom: 20px;
}
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 24px;
    cursor: pointer;
}
.checkbox-row input { margin-top: 3px; flex-shrink: 0; }
.checkbox-row a { color: #2196F3; }
.btn-submit { padding: 16px; font-weight: 700; font-size: 15px; border-radius: 8px; }
.btn-disabled, .btn-submit:disabled {
    background: #bdbdbd !important;
    cursor: not-allowed;
    opacity: 1;
}

/* Policy page */
.policy-list { padding: 0 16px 24px; }
.policy-item { border-bottom: 1px solid #eee; }
.policy-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.policy-icon { font-size: 20px; color: #666; }
.policy-content { padding: 0 0 16px; font-size: 14px; color: #555; line-height: 1.6; white-space: pre-wrap; }
