/* ===== OK MART - PROFILE PAGE STYLES ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2ecc71;
  --primary-dark: #27ae60;
  --primary-light: #e8f8ef;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1a1e2b;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,.06);
  --radius: 16px;
  --transition: all .2s;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-container { max-width: 480px; margin: 0 auto; position: relative; min-height: 100vh; }

/* ===== HEADER ===== */
.profile-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95); backdrop-filter: blur(10px);
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.back-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 1.3rem; font-weight: 600; color: var(--text);
}
.back-btn:active { background: var(--border); transform: scale(.92); }
.header-title { font-size: 1.2rem; font-weight: 700; }

/* ===== MAIN ===== */
.profile-main { padding: 0 14px 40px; }

/* ===== PROFILE CARD ===== */
.profile-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 20px; padding: 20px; margin: 14px 0;
  display: flex; align-items: center; gap: 14px; color: white;
  box-shadow: 0 8px 20px rgba(46,204,113,.25);
}
.profile-avatar {
  width: 60px; height: 60px; background: rgba(255,255,255,.2);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 2rem; flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 2px; }
.profile-phone { font-size: .85rem; opacity: .9; }
.edit-profile-btn {
  background: rgba(255,255,255,.2); color: white; border: 1px solid rgba(255,255,255,.3);
  padding: 8px 14px; border-radius: 30px; font-weight: 600; font-size: .8rem; cursor: pointer;
}
.edit-profile-btn:active { background: rgba(255,255,255,.3); }

/* ===== STATS ROW ===== */
.stats-row { display: flex; gap: 10px; margin-bottom: 20px; }
.stat-card {
  flex: 1; background: var(--card); border-radius: var(--radius);
  padding: 14px; text-align: center; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border); cursor: pointer; transition: var(--transition);
}
.stat-card:active { transform: scale(.96); }
.stat-value { display: block; font-weight: 800; font-size: 1.3rem; color: var(--primary-dark); }
.stat-label { font-size: .7rem; color: var(--muted); font-weight: 500; }

/* ===== MENU SECTIONS ===== */
.menu-sections { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

.menu-section {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden;
}

.menu-header, .menu-header-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; cursor: pointer; transition: background .15s;
  text-decoration: none; color: var(--text);
}
.menu-header:active, .menu-header-link:active { background: var(--bg); }

.menu-left { display: flex; align-items: center; gap: 12px; }
.menu-icon { font-size: 1.3rem; width: 28px; text-align: center; }
.menu-label { font-weight: 500; font-size: .95rem; }
.menu-right { display: flex; align-items: center; gap: 8px; }
.menu-badge {
  background: var(--primary); color: white; padding: 2px 8px;
  border-radius: 20px; font-size: .7rem; font-weight: 600;
}
.menu-arrow { color: var(--muted); font-size: 1.3rem; transition: transform .3s; }
.menu-arrow.open { transform: rotate(90deg); }

/* Menu Content */
.menu-content { padding: 0 18px 16px; animation: slideDown .3s ease; }
@keyframes slideDown { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 1000px; } }

/* ===== ORDERS LIST ===== */
.orders-loading, .offers-loading { color: var(--muted); padding: 16px 0; font-size: .9rem; }

.order-mini-card {
  background: var(--bg); border-radius: 12px; padding: 12px;
  margin-bottom: 8px; cursor: pointer; transition: var(--transition);
  border: 1px solid var(--border);
}
.order-mini-card:active { background: var(--primary-light); }
.order-mini-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.order-mini-id { font-weight: 700; font-family: monospace; color: var(--primary-dark); font-size: .9rem; }
.order-mini-total { font-weight: 700; }
.order-mini-date { font-size: .75rem; color: var(--muted); }

.status-dot {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .65rem; font-weight: 600;
}
.status-received { background: #fef3c7; color: #92400e; }
.status-preparing { background: #dbeafe; color: #1e40af; }
.status-outfordelivery { background: #d1fae5; color: #065f46; }
.status-delivered { background: #e0e7ff; color: #3730a3; }

.no-orders { text-align: center; padding: 20px 0; color: var(--muted); }
.shop-link { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ===== OFFERS LIST ===== */
.offer-mini-card {
  background: var(--bg); border-radius: 12px; padding: 12px;
  margin-bottom: 8px; border: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.offer-code { font-weight: 700; color: var(--primary-dark); font-family: monospace; }
.offer-desc { font-size: .8rem; color: var(--muted); }
.offer-value { font-weight: 700; color: #10b981; }

/* ===== LOGOUT ===== */
.logout-btn {
  width: 100%; padding: 16px; background: var(--card);
  border: 1.5px solid #fee2e2; border-radius: var(--radius);
  color: #dc2626; font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: var(--transition);
}
.logout-btn:active { background: #fee2e2; }

.app-version { text-align: center; color: var(--muted); font-size: .75rem; padding: 16px 0; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 200;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-card {
  background: var(--card); border-radius: 24px; width: 90%; max-width: 400px;
  overflow: hidden; animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.modal-header {
  display: flex; justify-content: space-between; padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%; background: var(--bg);
  border: none; font-size: 1.2rem; cursor: pointer;
}
.modal-body { padding: 20px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.form-group input, .form-group textarea {
  width: 100%; padding: 14px; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 12px; font-size: .9rem; font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 60px; }
.save-btn {
  width: 100%; padding: 14px; background: var(--primary); color: white;
  border: none; border-radius: 12px; font-weight: 700; cursor: pointer; margin-top: 8px;
}
.save-btn:active { background: var(--primary-dark); }

/* ===== TOAST ===== */
.toast-message {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(100px);
  padding: 12px 24px; border-radius: 40px; font-weight: 500; z-index: 999;
  opacity: 0; transition: all .3s; white-space: nowrap; pointer-events: none;
}
.toast-message.show { transform: translateX(-50%) translateY(0); opacity: 1; }
