/* =========================================================
   Bella — PWA install / offline / account-panel styles.
   Kept separate from style.css (the approved stylesheet) and built
   entirely from its existing design tokens (--color-*, --radius-*,
   --shadow-card, --transition-*, --drawer-width) so nothing here
   introduces a new visual language.
   ========================================================= */

/* ---------- Mobile nav drawer "account" row -- same look as the existing
   <a> nav items (style.css .mobile-nav-list a), just for a <button> since
   this one opens the account drawer via JS instead of navigating. ---------- */
.mobile-nav-list button.mobile-nav-account-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: start;
  background: none;
  border: none;
  padding: 12px 4px;
  font: inherit;
  font-weight: 600;
  color: inherit;
  border-bottom: 1px solid var(--color-border);
}
.mobile-nav-row-icon { flex: none; color: var(--color-accent); }
.mobile-nav-install-btn.is-disabled {
  color: var(--color-text-muted);
  cursor: default;
}
.mobile-nav-install-btn.is-disabled .mobile-nav-row-icon { color: var(--color-text-muted); }

/* ---------- Offline fallback page ---------- */
.offline-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  gap: 14px;
}
.offline-logo { width: min(220px, 60vw); height: auto; margin-bottom: 8px; }
.offline-screen h1 { font-size: var(--fs-h2); font-family: var(--font-display); }
.offline-screen p { color: var(--color-text-muted); max-width: 440px; }

/* ---------- Bottom-sheet base (install prompt + iOS instructions) ---------- */
.bella-sheet-overlay {
  position: fixed; inset: 0; background: var(--color-overlay);
  opacity: 0; visibility: hidden; transition: opacity var(--transition-base);
  z-index: 200;
}
.bella-sheet-overlay.is-open { opacity: 1; visibility: visible; }

.bella-sheet {
  position: fixed; inset-inline: 0; bottom: 0;
  max-width: 480px; margin-inline: auto;
  background: var(--color-surface);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-card);
  padding: 22px 22px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(105%);
  transition: transform var(--transition-base);
  z-index: 201;
}
.bella-sheet.is-open { transform: translateY(0); }

.bella-sheet-handle {
  width: 40px; height: 4px; border-radius: var(--radius-pill);
  background: var(--color-border); margin: 0 auto 16px;
}
.bella-sheet-icon { width: 56px; height: 56px; border-radius: 14px; display: block; margin-bottom: 14px; }
.bella-sheet h2 { font-size: 1.1rem; font-family: var(--font-display); margin-bottom: 6px; }
.bella-sheet p { color: var(--color-text-muted); font-size: var(--fs-small); line-height: 1.6; }
.bella-sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.bella-sheet-actions .btn { flex: 1; }

/* iOS step list */
.bella-ios-steps { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bella-ios-steps li { display: flex; align-items: center; gap: 12px; font-size: var(--fs-small); }
.bella-ios-step-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--color-accent-light); color: var(--color-accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
}

/* ---------- SW update-available banner ---------- */
.bella-update-banner {
  position: fixed; inset-inline: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--color-accent-dark); color: #fff;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform var(--transition-base);
  z-index: 199;
}
.bella-update-banner.is-open { transform: translateY(0); }
.bella-update-banner span { font-size: var(--fs-small); }
.bella-update-banner .btn { height: 36px; padding-inline: 16px; font-size: var(--fs-small); }
.bella-update-banner .btn-outline { color: #fff; border-color: rgba(255,255,255,0.6); }
.bella-update-banner .btn-outline:hover { background: rgba(255,255,255,0.12); }

/* ---------- Account drawer (reuses .drawer / .overlay from style.css,
   just needs the end-anchored slide-in this class list doesn't include) ---------- */
.drawer-account { inset-inline-start: auto; inset-inline-end: 0; transform: translateX(105%); }
[dir="rtl"] .drawer-account { transform: translateX(-105%); }
.drawer-account.is-open { transform: translateX(0); }

.account-block { margin-bottom: 20px; }
.account-block label:not(.account-checkbox-row) {
  font-size: var(--fs-small); font-weight: 700; margin-bottom: 4px; display: block;
}
.account-block input[type="text"],
.account-block input[type="email"],
.account-block input[type="tel"],
.account-block input[type="password"],
.account-block select {
  width: 100%; height: 44px; padding-inline: 12px;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  /* 16px, not var(--fs-body) (15.2px) -- anything smaller makes iOS Safari
     zoom the whole page in on focus. */
  font: inherit; font-size: 16px; color: var(--color-text); background: var(--color-surface);
  margin-bottom: 10px;
}
.account-block input:invalid[data-touched="true"],
.account-block select:invalid[data-touched="true"] { border-color: var(--color-error); }
.account-checkbox-row { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-small); cursor: pointer; margin-bottom: 14px; }
.account-checkbox-row input { width: 16px; height: 16px; accent-color: var(--color-accent); margin-top: 2px; }
.account-checkbox-row a { color: var(--color-accent); text-decoration: underline; }

.account-field-error { color: var(--color-error); font-size: var(--fs-small); margin: -6px 0 10px; display: none; }
.account-field-error.is-visible { display: block; }

.account-form-msg { font-size: var(--fs-small); margin-top: 10px; min-height: 1.2em; }
.account-form-msg.is-error { color: var(--color-error); }
.account-form-msg.is-success { color: var(--color-success); }

.account-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--color-accent-light); border-radius: var(--radius-pill); padding: 4px; }
.account-tab-btn {
  flex: 1; border: none; background: transparent; border-radius: var(--radius-pill);
  height: 36px; font-size: var(--fs-small); font-weight: 600; color: var(--color-text-muted);
}
.account-tab-btn.is-active { background: var(--color-surface); color: var(--color-accent-dark); box-shadow: var(--shadow-card); }

.account-link-row { text-align: center; margin-top: 4px; }
.account-link-row button { background: none; border: none; color: var(--color-accent); font-size: var(--fs-small); text-decoration: underline; padding: 4px; }

.account-profile-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--color-border); font-size: var(--fs-small); }
.account-profile-row:last-child { border-bottom: none; }
.account-profile-row .account-profile-label { color: var(--color-text-muted); }

.account-order-card { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; }
.account-order-card .account-order-head { display: flex; justify-content: space-between; font-weight: 700; font-size: var(--fs-small); margin-bottom: 6px; }
.account-order-empty { text-align: center; color: var(--color-text-muted); font-size: var(--fs-small); padding: 32px 12px; }

.account-danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.account-danger-zone .btn-outline { color: var(--color-error); border-color: var(--color-error); }
.account-danger-zone .btn-outline:hover { background: #fbeceA; }

/* ---------- Account "Profile" tab accordion (My Profile / Shipping Address /
   Security / Account Settings) -- replaces one long scroll of stacked forms
   with collapsible sections, only "My Profile" open by default. ---------- */
.account-accordion { display: flex; flex-direction: column; gap: 10px; }
.account-acc-item { border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; }
.account-acc-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px; background: var(--color-surface-alt);
  border: none; font: inherit; font-size: var(--fs-body); font-weight: 700; color: var(--color-text);
  cursor: pointer; text-align: start;
}
.account-acc-chevron { flex-shrink: 0; color: var(--color-text-muted); transform: rotate(0deg); transition: transform var(--transition-fast); }
.account-acc-header.is-open .account-acc-chevron { transform: rotate(90deg); }
.account-acc-body { padding: 16px; border-top: 1px solid var(--color-border); }
.account-acc-body[hidden] { display: none; }
