/* ============================================================
   Tokmart - Balance row, policy section, Google button, toast, lightbox
   ============================================================ */

.balance-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 18px;
    box-shadow: var(--shadow);
}

/* ============================================================
   Account page menu rows (favorites/orders/recharge/settings/...).
   Every child here used to carry its own inline style; missing this
   block left the rows and their icon circles with no layout at all -
   an .icon-box with no width/height stretches to fill the row.
   ============================================================ */
.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    margin-bottom: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.settings-item:active { transform: scale(0.98); }

.settings-item.admin-item {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-color: rgba(255,255,255,.1);
}
.settings-item.admin-item .title,
.settings-item.admin-item .subtitle { color: #fff; }

.settings-item .left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.settings-item .icon-box {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.settings-item .title { font-weight: 700; font-size: 13.5px; color: var(--text2); }
.settings-item .subtitle { font-size: 10.5px; color: var(--text3); margin-top: 1px; }

.settings-item .right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.settings-item .count-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--text3);
    background: var(--bg2);
    padding: 2px 10px;
    border-radius: 12px;
}
.settings-item .count-badge:empty { display: none; }
.settings-item .chevron {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg2);
    display: grid;
    place-items: center;
    font-size: 12px;
    color: var(--text3);
}
.settings-item .status-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(46,204,113,.15);
    color: var(--green);
}
.settings-item .account-lang-display {
    font-size: 12px;
    font-weight: 600;
    color: var(--text3);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
}
.lang-option:active { transform: scale(0.98); }
.lang-option.selected {
    border-color: var(--primary);
    background: var(--acSh);
}
.lang-option .lang-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 18px;
    color: var(--primary);
    background: var(--acSh);
    flex-shrink: 0;
}
.lang-option .lang-text { flex: 1; min-width: 0; }
.lang-option .lang-name { font-weight: 700; font-size: 15px; color: var(--text2); }
.lang-option .lang-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }
.lang-option .lang-check {
    font-size: 20px;
    color: var(--primary);
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s var(--ease-spring);
}
.lang-option.selected .lang-check {
    opacity: 1;
    transform: scale(1);
}

.policy-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.policy-content.open {
    max-height: 500px !important;
}

.g_id_signin {
    margin: 10px 0;
    display: flex;
    justify-content: center;
    min-height: 50px;
}

.g_id_signin > div {
    width: 100% !important;
    max-width: 320px !important;
}

/* ============================================================
   اقتراح تثبيت التطبيق (PWA) - يظهر تلقائياً، ليس عبر قائمة الإعدادات
   ============================================================ */
.pwa-install-banner {
    display: none;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(100px + var(--safe-area-bottom));
    z-index: var(--z-modal);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    margin: 0 auto;
    animation: pwaBannerIn 0.4s var(--ease-out);
}
.pwa-install-banner.show { display: flex; }

@keyframes pwaBannerIn {
    0% { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}

.pwa-install-banner .icon-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #058693, #0AA6B5);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 17px;
    flex-shrink: 0;
}
.pwa-install-banner .text-block { flex: 1; min-width: 0; }
.pwa-install-banner .title { font-weight: 700; font-size: 13.5px; color: var(--text2); }
.pwa-install-banner .subtitle { font-size: 11px; color: var(--text3); margin-top: 1px; }
.pwa-install-banner .pwa-install-btn {
    flex-shrink: 0;
    border: none;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 12.5px;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
}
.pwa-install-banner .pwa-dismiss-btn {
    flex-shrink: 0;
    border: none;
    background: none;
    color: var(--text3);
    font-size: 15px;
    padding: 6px;
    cursor: pointer;
}

/* ============================================================
   تصميم الإشعار المنبثق (toast) الموحد - نفس هوية إشعار لوحة الإدارة
   ============================================================ */
#toast {
    position: fixed;
    bottom: calc(100px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-sm);
    padding: 14px 24px;
    box-shadow: var(--shadow-lg);
    font-size: var(--fs-md);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 88%;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    z-index: var(--z-snackbar);
    transition: all 0.3s var(--ease-spring);
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== LIGHTBOX ===== */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: var(--z-dialog);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
    padding: var(--safe-area-top) var(--safe-area-right) var(--safe-area-bottom) var(--safe-area-left);
}

#lightbox.active {
    display: flex;
}
