/* MommyHana Platinum — Member PWA Styles */

/* ── Layout ──────────────────────────────── */
.member-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.header-name {
    font-size: 13px;
    opacity: 0.85;
}

.member-main {
    padding: 16px;
    padding-bottom: 80px;
    max-width: 600px;
    margin: 0 auto;
    min-height: calc(100vh - 56px - 64px);
}

/* ── Bottom Navigation ───────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 env(safe-area-inset-bottom, 8px);
    z-index: 100;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    text-decoration: none;
    color: var(--gray-400);
    font-size: 10px;
    font-weight: 500;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.nav-item.active {
    color: var(--primary);
}
.nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Login Page ──────────────────────────── */
.login-bg { background: linear-gradient(135deg, #581C87 0%, #9333EA 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--white); border-radius: 16px; padding: 32px 24px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo h1 { color: var(--primary); font-size: 22px; margin-bottom: 4px; }
.login-logo p { color: var(--gray-500); font-size: 13px; }
.login-card .form-group { margin-bottom: 16px; }
.login-card .form-group label { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; display: block; }
.login-card .form-control { padding: 12px; font-size: 16px; border-radius: var(--radius); }
.phone-input-wrap { display: flex; align-items: center; gap: 8px; }
.phone-prefix { background: var(--gray-100); border: 1px solid var(--gray-300); border-radius: var(--radius); padding: 12px; font-size: 16px; font-weight: 600; color: var(--gray-600); white-space: nowrap; }
.phone-input-wrap .form-control { flex: 1; }
.otp-section { display: none; }
.otp-section.visible { display: block; }
.otp-input { text-align: center; font-size: 24px; letter-spacing: 8px; font-weight: 700; }
.otp-timer { text-align: center; font-size: 13px; color: var(--gray-500); margin-top: 8px; }
.otp-timer .resend-link { color: var(--primary); cursor: pointer; font-weight: 600; }
.login-btn { width: 100%; padding: 14px; font-size: 16px; font-weight: 600; border-radius: var(--radius); }
.login-error { background: #FEE2E2; color: #991B1B; padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; display: none; }
.login-error.visible { display: block; }
.login-success { background: #E8F5E9; color: #1B5E20; padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.login-links { text-align: center; margin-top: 16px; font-size: 13px; display: flex; justify-content: center; gap: 16px; }
.login-links .link { color: var(--primary); cursor: pointer; text-decoration: none; }
.login-links .link:hover { text-decoration: underline; }

/* ── Balance Card ────────────────────────── */
.balance-card {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    color: var(--white);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}
.balance-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.balance-label {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 4px;
}
.balance-amount {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.balance-sub {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
}

/* ── Quick Actions ───────────────────────── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.quick-action {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 8px;
    text-align: center;
    text-decoration: none;
    color: var(--gray-700);
    transition: transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.quick-action:active {
    transform: scale(0.97);
}
.quick-action-icon {
    font-size: 24px;
    margin-bottom: 4px;
    color: var(--primary);
}
.quick-action-label {
    font-size: 12px;
    font-weight: 600;
}

/* ── Section ─────────────────────────────── */
.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 12px;
}

/* ── Product Grid ────────────────────────── */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.product-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.product-card.in-cart { border: 2px solid var(--primary); }
.product-img { width: 100%; height: 100px; object-fit: cover; background: var(--gray-100); display: block; }
.product-info { padding: 10px; }
.product-name { font-size: 12px; font-weight: 600; color: var(--gray-800); margin-bottom: 4px; line-height: 1.3; }
.product-price { font-size: 14px; font-weight: 700; color: var(--primary); }
.product-qty { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.qty-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--gray-300); background: var(--white); font-size: 16px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.qty-btn:active { background: var(--gray-100); }
.qty-value { font-size: 16px; font-weight: 700; min-width: 20px; text-align: center; }

/* ── Cart Bar ────────────────────────────── */
.cart-bar {
    position: fixed;
    bottom: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 12px 16px;
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 90;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}
.cart-bar.visible {
    display: flex;
}
.cart-summary {
    font-size: 14px;
}
.cart-total {
    font-weight: 700;
    color: var(--primary);
}

/* ── Order List ──────────────────────────── */
.order-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-id { font-weight: 700; font-size: 14px; }
.order-date { font-size: 12px; color: var(--gray-500); }
.order-amount { font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.order-items { font-size: 12px; color: var(--gray-500); margin-top: 8px; border-top: 1px solid var(--gray-100); padding-top: 8px; }
.order-item-row { display: flex; justify-content: space-between; padding: 2px 0; }
.order-tracking { font-size: 12px; color: var(--info); margin-top: 4px; }

/* ── QR Card ─────────────────────────────── */
.qr-card { background: var(--white); border-radius: 16px; box-shadow: var(--shadow-md); padding: 32px 24px; text-align: center; margin-bottom: 20px; }
.qr-image { width: 200px; height: 200px; margin: 0 auto 16px; }
.qr-image img, .qr-image svg { width: 100%; height: 100%; }
.qr-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.qr-phone { font-size: 14px; color: var(--gray-500); margin-bottom: 12px; }
.qr-validity { font-size: 12px; color: var(--gray-500); }
.qr-hint { font-size: 12px; color: var(--gray-400); margin-top: 16px; font-style: italic; }

/* ── Profile ─────────────────────────────── */
.profile-field { margin-bottom: 16px; }
.profile-label { font-size: 12px; color: var(--gray-500); font-weight: 500; margin-bottom: 2px; }
.profile-value { font-size: 15px; font-weight: 500; color: var(--gray-800); }
.logout-btn { width: 100%; margin-top: 24px; padding: 14px; font-size: 15px; }

/* ── Referral ────────────────────────────── */
.referral-code-box { background: var(--gray-50); border: 2px dashed var(--primary-light); border-radius: var(--radius); padding: 20px; text-align: center; margin-bottom: 20px; }
.referral-code-value { font-size: 28px; font-weight: 800; color: var(--primary); letter-spacing: 2px; margin-bottom: 8px; }
.referral-link-text { font-size: 11px; color: var(--gray-500); word-break: break-all; margin-bottom: 12px; }
.copy-btn { padding: 8px 20px; font-size: 13px; }
.copy-btn.copied { background: var(--success); }
.stats-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-mini { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-align: center; }
.stat-mini-value { font-size: 20px; font-weight: 700; color: var(--primary); }
.stat-mini-label { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.bank-form .form-group { margin-bottom: 12px; }

/* ── Empty / Gift ────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-400); }
.empty-icon { font-size: 48px; margin-bottom: 8px; }
.empty-text { font-size: 14px; }
.gift-banner { background: linear-gradient(135deg, #D97706 0%, #F59E0B 100%); color: var(--white); border-radius: 16px; padding: 20px; margin-bottom: 20px; text-align: center; }
.gift-banner h2 { font-size: 18px; margin-bottom: 4px; }
.gift-banner p { font-size: 13px; opacity: 0.9; }
.gift-ineligible { text-align: center; padding: 40px 20px; }
.gift-ineligible p { color: var(--gray-500); font-size: 14px; }

/* ── Utility ─────────────────────────────── */
.mb-2 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }
.text-xs { font-size: 12px; }
.text-gray { color: var(--gray-500); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
