*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: 'Inter', sans-serif; background: #f7f5f2; color: #1a1a1a; min-height: 100vh; }

/* NAV */
.pnav { display: flex; align-items: center; justify-content: space-between; padding: 0 40px; height: 64px; background: #fff; border-bottom: 1px solid #e8e4de; position: sticky; top: 0; z-index: 100; }
.pnav .logo { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 1.2rem; letter-spacing: 0.1em; text-decoration: none; color: #1a1a1a; }
.logout-btn { background: none; border: 1px solid #ddd; border-radius: 8px; padding: 8px 16px; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; }
.logout-btn:hover { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }

/* LAYOUT */
.profile-main { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 64px); max-width: 1200px; margin: 0 auto; gap: 0; padding: 40px 24px; gap: 32px; }

/* SIDEBAR */
.profile-sidebar { position: sticky; top: 96px; height: fit-content; }
.avatar-wrap { background: #fff; border-radius: 16px; padding: 28px 20px; text-align: center; margin-bottom: 12px; border: 1px solid #e8e4de; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: #E8622A; color: #fff; font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 1.8rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.user-name { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.user-phone { font-size: 0.85rem; color: #888; }

.profile-nav { background: #fff; border-radius: 16px; padding: 8px; border: 1px solid #e8e4de; }
.pnav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: none; background: none; border-radius: 10px; font-size: 0.9rem; font-family: 'Inter', sans-serif; color: #555; cursor: pointer; transition: all 0.2s; text-align: left; }
.pnav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.pnav-item:hover { background: #f7f5f2; color: #1a1a1a; }
.pnav-item.active { background: #1a1a1a; color: #fff; }

/* CONTENT */
.profile-content { min-width: 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-title { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 1.6rem; margin-bottom: 24px; }
.section-mini-title { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1rem; margin: 32px 0 16px; color: #555; letter-spacing: 0.05em; text-transform: uppercase; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 8px; }
.stat-card { background: #fff; border-radius: 16px; padding: 24px 20px; border: 1px solid #e8e4de; text-align: center; }
.stat-num { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 1.8rem; color: #E8622A; margin-bottom: 6px; }
.stat-label { font-size: 0.8rem; color: #888; }

/* ORDERS */
.orders-list { display: flex; flex-direction: column; gap: 12px; }
.order-card { background: #fff; border-radius: 14px; padding: 20px 24px; border: 1px solid #e8e4de; display: flex; align-items: center; gap: 20px; }
.order-img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #f0ece6; flex-shrink: 0; }
.order-img-placeholder { width: 64px; height: 64px; border-radius: 10px; background: #f0ece6; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.order-info { flex: 1; min-width: 0; }
.order-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-meta { font-size: 0.8rem; color: #888; }
.order-right { text-align: right; flex-shrink: 0; }
.order-amount { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.status-paid    { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.status-cancelled { background: #f8d7da; color: #721c24; }
.empty-state { text-align: center; padding: 60px 20px; color: #aaa; font-size: 0.95rem; }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.3; display: block; margin: 0 auto 12px; }

/* WISHLIST */
.wishlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.wishlist-card { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid #e8e4de; transition: transform 0.2s; }
.wishlist-card:hover { transform: translateY(-3px); }
.wishlist-card img { width: 100%; height: 160px; object-fit: cover; display: block; background: #f0ece6; }
.wishlist-card-body { padding: 14px; }
.wishlist-card-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.wishlist-card-price { font-family: 'Montserrat', sans-serif; font-weight: 700; color: #E8622A; font-size: 0.95rem; margin-bottom: 10px; }
.wishlist-actions { display: flex; gap: 8px; }
.btn-shop { flex: 1; padding: 8px; background: #1a1a1a; color: #fff; border: none; border-radius: 8px; font-size: 0.8rem; font-weight: 600; cursor: pointer; text-decoration: none; display: block; text-align: center; }
.btn-remove-wish { padding: 8px 10px; background: none; border: 1px solid #ddd; border-radius: 8px; cursor: pointer; color: #999; font-size: 0.8rem; transition: all 0.2s; }
.btn-remove-wish:hover { background: #fee; color: #c00; border-color: #fcc; }

/* ADDRESSES */
.address-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.address-card { background: #fff; border-radius: 14px; padding: 18px 20px; border: 1px solid #e8e4de; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.address-card-info { flex: 1; }
.address-label { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.address-detail { font-size: 0.85rem; color: #666; }
.btn-del-addr { background: none; border: none; color: #ccc; cursor: pointer; padding: 6px; border-radius: 8px; transition: color 0.2s; }
.btn-del-addr:hover { color: #c00; }
.btn-del-addr svg { width: 18px; height: 18px; display: block; }
.btn-add { padding: 12px 20px; background: none; border: 2px dashed #ddd; border-radius: 12px; font-size: 0.9rem; color: #888; cursor: pointer; width: 100%; transition: all 0.2s; font-family: 'Inter', sans-serif; }
.btn-add:hover { border-color: #E8622A; color: #E8622A; }
.addr-form { background: #fff; border-radius: 14px; padding: 20px; border: 1px solid #e8e4de; margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.addr-form input { padding: 12px 14px; border: 1px solid #e0dbd4; border-radius: 10px; font-size: 0.9rem; font-family: 'Inter', sans-serif; outline: none; }
.addr-form input:focus { border-color: #E8622A; }
.form-actions { display: flex; gap: 10px; }
.hidden { display: none !important; }

/* SETTINGS */
.settings-form { background: #fff; border-radius: 16px; padding: 32px; border: 1px solid #e8e4de; max-width: 480px; display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: #555; }
.form-group input { padding: 12px 14px; border: 1px solid #e0dbd4; border-radius: 10px; font-size: 0.95rem; font-family: 'Inter', sans-serif; outline: none; background: #fff; }
.form-group input:focus { border-color: #E8622A; }
.form-group input:disabled { background: #f7f5f2; color: #aaa; }
.save-msg { color: #2a7a4b; font-size: 0.85rem; font-weight: 600; }

/* BUTTONS */
.btn-primary { padding: 12px 24px; background: #1a1a1a; color: #fff; border: none; border-radius: 10px; font-size: 0.9rem; font-weight: 700; font-family: 'Montserrat', sans-serif; cursor: pointer; transition: background 0.2s; }
.btn-primary:hover { background: #E8622A; }
.btn-ghost { padding: 12px 24px; background: none; border: 1px solid #ddd; border-radius: 10px; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif; }
.btn-ghost:hover { background: #f7f5f2; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .profile-main { grid-template-columns: 1fr; padding: 20px 16px; gap: 20px; }
  .profile-sidebar { position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .pnav { padding: 0 20px; }
}

/* ── AVATAR UPLOAD ───────────────────────────────────────────── */
.avatar-container { position: relative; width: 72px; height: 72px; margin: 0 auto 12px; }
.avatar-container .avatar { margin: 0; width: 72px; height: 72px; overflow: hidden; }
.avatar-container .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-edit-btn { position: absolute; bottom: 0; right: 0; width: 24px; height: 24px; background: #E8622A; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid #fff; }
.avatar-edit-btn svg { width: 12px; height: 12px; stroke: #fff; }
