/* ===== PAC.CO Store — Account & Orders ===== */
/* Store design language: rounded edge, flat, no shadow, clean consumer UI */

/* --- Layout --- */
.acct-main { background: #fbfbfd; }
.acct-container { padding-top: 40px; padding-bottom: 80px; max-width: 1100px; }
.acct-header { margin-bottom: 32px; }
.acct-header h1 { margin: 0; font-size: 2.2rem; font-weight: 950; letter-spacing: -0.02em; }
.acct-grid { display: grid; grid-template-columns: 260px 1fr; gap: 40px; height: auto; }

/* --- Sidebar --- */
.acct-sidebar { display: flex; flex-direction: column; gap: 32px; align-self: start; }
.acct-profile-card { background: var(--paper); border: 2px solid #ededf0; border-radius: 24px; padding: 24px; text-align: center; position: relative; }
.acct-profile-avatar { width: 88px; height: 88px; border-radius: 999px; overflow: hidden; background: var(--soft); margin: 0 auto 16px; position: relative; border: 2px solid #ededf0; }
.acct-profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: none; }
.acct-profile-initials { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 900; color: var(--ink); }
.acct-profile-hover { position: absolute; inset: 0; background: rgba(0,0,0,0.4); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; cursor: pointer; font-size: 0.8rem; font-weight: 800; }
.acct-profile-card:hover .acct-profile-hover { opacity: 1; }
.acct-profile-name { margin: 0 0 4px; font-size: 1.2rem; font-weight: 900; }
.acct-profile-email { margin: 0; color: var(--muted); font-size: 0.9rem; font-weight: 600; }

/* --- Nav --- */
.acct-nav { display: flex; flex-direction: column; gap: 8px; }
.acct-nav-btn { text-align: left; padding: 14px 18px; border-radius: 14px; border: none; background: transparent; font-weight: 850; cursor: pointer; transition: all 0.2s; color: var(--muted); }
.acct-nav-btn:hover { background: #f0f0f2 !important; color: var(--ink) !important; }
.acct-nav-btn.active { background: #f7f7f8; color: var(--ink); }
.acct-signout-btn { margin-top: 24px; text-align: left; padding: 14px 18px; border-radius: 14px; border: none; background: transparent; font-weight: 850; cursor: pointer; transition: all 0.2s; color: var(--danger); display: flex; align-items: center; gap: 10px; }
.acct-signout-btn:hover { background: #fff0f0 !important; color: var(--danger) !important; }

/* --- Main Content --- */
.acct-content { background: var(--paper); border: 2px solid #ededf0; border-radius: 32px; padding: 40px; }
.acct-tab-title { margin: 0 0 8px; font-size: 2rem; font-weight: 950; letter-spacing: -0.02em; }
.acct-tab-subtitle { margin: 0 0 32px; color: var(--muted); font-size: 1rem; max-width: 500px; }
.acct-section-title { margin: 0 0 8px; font-size: 1.6rem; font-weight: 900; }
.acct-section-subtitle { margin: 0 0 32px; color: var(--muted); font-size: 0.95rem; }

/* --- Orders List --- */
.acct-orders-list { display: flex; flex-direction: column; gap: 24px; }

/* --- Order Card --- */
.acct-order-card { border: 2px solid #ededf0; border-radius: 24px; padding: 24px; background: #fff; }
.acct-order-card:hover { border-color: #e2e2e5; }
.acct-order-card.new-highlight { border-color: #fef08a !important; }
.acct-order-card.new-highlight .order-status-pill.status-new { display: inline-flex; }
.acct-order-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid #ededf0; }
.acct-order-id { display: block; font-size: 1.2rem; font-weight: 950; margin-bottom: 4px; }
.acct-order-date { color: var(--muted); font-size: 0.9rem; font-weight: 750; }

/* --- Order Status Pills (Store style) --- */
.order-status-pill { display: inline-flex; align-items: center; padding: 6px 16px; border-radius: 999px; font-size: 0.8rem; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; border: 2px solid transparent; }
.status-new { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.status-awaiting_review { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.status-review { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.status-preparing { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.status-paid { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.status-pending { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.status-shipped { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.status-delivered { background: #e8f5e9; color: #2e7d32; border-color: #81c784; }
.status-done { background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.status-cancelled { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* --- Order Items --- */
.acct-order-items { margin-bottom: 24px; padding-bottom: 8px; }
.acct-order-item-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px dashed #ededf0; }
.acct-order-item-row:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.acct-order-item-info { display: flex; align-items: center; gap: 16px; }
.acct-order-thumb { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: #f7f7f8; border: 1px solid #ededf0; padding: 4px; }
.acct-order-thumb-empty { width: 56px; height: 56px; border-radius: 14px; background: #f7f7f8; border: 1px solid #ededf0; }
.acct-order-item-name { display: block; font-size: 1rem; font-weight: 900; margin-bottom: 2px; color: var(--ink); }
.acct-order-item-meta { display: flex; gap: 8px; font-size: 0.85rem; color: var(--muted); font-weight: 750; }
.acct-order-item-price { font-size: 1rem; font-weight: 950; }

/* --- Order Footer --- */
.acct-order-footer { display: flex; justify-content: space-between; align-items: flex-end; border-top: 2px solid #ededf0; padding-top: 20px; margin-top: 16px; }
.acct-payment-method { display: flex; flex-direction: column; gap: 4px; }
.acct-payment-label { font-size: 0.8rem; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.acct-payment-detail { display: flex; align-items: center; gap: 8px; }
.acct-payment-icon { width: 32px; height: 24px; border-radius: 6px; background: #f1f1f4; display: flex; align-items: center; justify-content: center; }
.acct-payment-name { font-size: 0.95rem; font-weight: 900; }
.acct-total-section { text-align: right; }
.acct-total-label { font-size: 0.8rem; font-weight: 900; color: var(--muted); text-transform: uppercase; display: block; margin-bottom: 4px; letter-spacing: 0.05em; }
.acct-total-amount { font-size: 1.6rem; font-weight: 950; line-height: 1; }

/* --- Order Actions --- */
.acct-order-actions { margin-top: 24px; display: flex; gap: 12px; }
.acct-order-actions .button { flex: 1; border-radius: 14px; height: 48px; font-size: 0.9rem; font-weight: 900; }
.acct-order-actions .minimal-btn { background: #f7f7f8; }
.acct-order-actions .primary-cta { flex: 1; }

/* --- Empty State --- */
.acct-empty-state { padding: 40px; text-align: center; background: #fbfbfd; border-radius: 24px; border: 2px dashed #ededf0; }
.acct-empty-state p { color: var(--muted); font-weight: 800; font-size: 1.1rem; margin-bottom: 16px; }
.acct-empty-icon { display: flex; justify-content: center; margin-bottom: 12px; color: var(--muted); }
.acct-empty-title { margin: 0 0 8px 0; font-size: 1.35rem; font-weight: 900; color: var(--ink); letter-spacing: -0.01em; }
.acct-empty-desc { color: var(--muted); font-weight: 600; font-size: 1rem; margin: 0 0 20px 0; }

/* --- Order Details Modal --- */
.acct-details-panel { width: min(720px, 94vw); border-radius: 32px; padding: 0; overflow: hidden; }
.acct-details-head { padding: 24px 32px; border-bottom: 1px solid #f0f0f2; display: flex; justify-content: space-between; align-items: flex-start; }
.acct-details-head h2 { font-size: 1.4rem; margin: 0 0 4px; font-weight: 950; }
.acct-details-head p { margin: 0; color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.acct-details-body { padding: 0; max-height: 80vh; overflow-y: auto; }
.acct-details-inner { padding: 24px 32px; }
.acct-details-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; }
.acct-details-col { display: flex; flex-direction: column; gap: 24px; }
.acct-details-subhead { font-size: 0.85rem; font-weight: 950; margin: 0 0 16px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.acct-detail-summary { padding: 20px; background: #fbfbfd; border-radius: 20px; border: 1px solid #f0f0f2; }
.acct-summary-row { display: flex; justify-content: space-between; font-size: 0.9rem; }
.acct-summary-row + .acct-summary-row { margin-top: 8px; }
.acct-summary-label { color: var(--muted); font-weight: 700; }
.acct-summary-value { font-weight: 850; }
.acct-summary-total { display: flex; justify-content: space-between; font-size: 1.1rem; margin-top: 4px; padding-top: 8px; border-top: 1px dashed #e2e2e5; }
.acct-summary-total strong { font-weight: 950; }
.acct-summary-total strong:last-child { color: var(--ink); }
.acct-details-foot { padding: 24px 32px; background: #fbfbfd; border-top: 1px solid #f0f0f2; display: flex; gap: 16px; }
.acct-details-foot .button { flex: 1; border-radius: 16px; height: 54px; font-weight: 900; }
.acct-details-foot .minimal-btn { background: #fff; }

/* --- Order Details Modal — Items Section --- */
.acct-det-items { display: flex; flex-direction: column; gap: 16px; }
.acct-det-item { display: flex; align-items: center; gap: 20px; }
.acct-det-item.large { gap: 24px; }
.acct-det-item.large .acct-det-thumb { width: 92px; height: 92px; border-radius: 20px; }
.acct-det-item.large strong { font-size: 1.2rem; }
.acct-det-item.large .acct-det-variant { font-size: 0.95rem; }
.acct-det-thumb { width: 60px; height: 60px; border-radius: 14px; object-fit: contain; background: #f7f7f8; border: 1px solid #f0f0f2; padding: 6px; flex-shrink: 0; }
.acct-det-info { flex: 1; }
.acct-det-name { display: block; font-size: 0.95rem; font-weight: 950; margin-bottom: 2px; color: var(--ink); }
.acct-det-variant { font-size: 0.8rem; color: var(--muted); font-weight: 750; margin-bottom: 4px; }
.acct-det-price { font-size: 0.9rem; font-weight: 900; color: var(--ink); }

/* --- Order Details Status Box --- */
.acct-det-status-box { display: flex; flex-direction: column; gap: 20px; }
.acct-det-status-card { padding: 16px; border: 1px solid #f0f0f2; border-radius: 16px; background: #fff; }
.acct-det-status-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.acct-det-status-head .order-status-pill { font-size: 0.7rem; padding: 4px 10px; }
.acct-det-status-meta { font-size: 0.8rem; font-weight: 800; color: var(--muted); }

/* --- Timeline (Buyer) --- */
.acct-timeline { position: relative; padding-left: 24px; margin-top: 8px; }
.acct-timeline::before { content: ""; position: absolute; left: 7px; top: 5px; bottom: 5px; width: 2px; background: #ededf0; }
.acct-timeline-item { position: relative; padding-bottom: 12px; }
.acct-timeline-item:last-child { padding-bottom: 0; }
.acct-timeline-dot { position: absolute; left: -24px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #ededf0; z-index: 2; }
.acct-timeline-item.active .acct-timeline-dot { border-color: var(--ink); background: var(--ink); }
.acct-timeline-label { font-size: 11px; font-weight: 850; display: block; color: var(--ink); }
.acct-timeline-time { font-size: 11px; color: var(--muted); font-weight: 600; }

/* --- Tracking / Info Card --- */
.acct-tracking-card { padding: 12px 16px; background: #fbfbfd; border: 1px solid #f0f0f2; border-radius: 14px; }
.acct-tracking-head { font-size: 0.7rem; font-weight: 950; margin: 0 0 6px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; }
.acct-tracking-body { display: flex; justify-content: space-between; align-items: center; }
.acct-tracking-num { font-size: 0.85rem; font-weight: 950; color: var(--ink); }
.acct-tracking-carrier { font-size: 0.7rem; color: var(--muted); font-weight: 700; }
.acct-pending-card { padding: 12px 16px; background: #fbfbfd; border: 1px dashed #ededf0; border-radius: 14px; }
.acct-pending-card p { margin: 0; font-size: 0.75rem; color: var(--muted); font-weight: 700; }

/* --- Archive Order Button --- */
.acct-archive-btn { width: 100%; border-radius: 12px; height: 40px; font-size: 0.85rem; font-weight: 900; background: #fff; border: 2px solid #fee2e2; color: #991b1b; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.acct-archive-btn:hover { background: #fee2e2; border-color: #991b1b; }

/* --- Profile Form --- */
.acct-profile-form { display: flex; flex-direction: column; gap: 20px; max-width: 500px; }
.acct-field-label { font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.acct-field-input { border-radius: 12px; }
.acct-save-btn { margin-top: 16px; width: fit-content; border-radius: 14px; padding: 0 32px; }

/* --- Addresses --- */
.acct-addresses { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.acct-addresses h2 { margin: 0; font-size: 1.6rem; font-weight: 900; }
.acct-add-addr-btn { border-radius: 12px; font-size: 0.9rem; padding: 0 16px; height: 40px; }

/* --- Address Modal --- */
.acct-addr-panel { width: min(500px, 92vw); border-radius: 28px; }
.acct-addr-modal-title { font-size: 1.4rem; }
.acct-addr-form-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
.acct-addr-full { grid-column: 1 / -1; }
.acct-addr-check-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.acct-addr-check-row input[type="checkbox"] { width: 20px; height: 20px; }
.acct-addr-check-row span { font-weight: 800; }
.acct-addr-actions { margin-top: 24px; display: flex; gap: 12px; }
.acct-addr-actions .button { flex: 1; border-radius: 14px; }

/* --- Address Card --- */
.acct-address-card { border: 2px solid #ededf0; border-radius: 16px; padding: 20px; }
.acct-address-card:hover { border-color: var(--ink); }
.acct-address-badge { display: inline-block; padding: 4px 10px; background: var(--ink); color: var(--paper); border-radius: 6px; font-size: 0.7rem; font-weight: 850; letter-spacing: 0.05em; margin-bottom: 12px; }
.acct-address-name { display: block; margin-bottom: 4px; font-size: 1.1rem; font-weight: 900; }
.acct-address-details { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.4; }
.acct-address-phone { display: inline-block; margin-top: 4px; }
.acct-address-actions { display: flex; gap: 12px; }

/* --- Address Empty --- */
.acct-addr-empty { padding: 32px; text-align: center; background: #fbfbfd; border-radius: 16px; border: 2px dashed #ededf0; }
.acct-addr-empty p { color: var(--muted); font-weight: 800; }

/* --- Responsive --- */
@media (max-width: 640px) {
  .acct-container { padding-top: 24px; padding-bottom: 48px; }
  .acct-grid { grid-template-columns: 1fr; gap: 24px; }
  .acct-content { padding: 24px; border-radius: 24px; }
  .acct-details-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
  .acct-details-head { padding: 16px 20px; }
  .acct-details-inner { padding: 16px 20px; }
  .acct-details-foot { padding: 16px 20px; flex-direction: column; }
  .acct-details-foot .button { height: 48px; }
  .acct-det-item { gap: 12px; }
  .acct-det-item.large { gap: 16px; }
  .acct-order-card { padding: 16px; }
  .acct-order-header { flex-direction: column; gap: 12px; }
  .acct-order-footer { flex-direction: column; gap: 16px; align-items: stretch; text-align: left; }
  .acct-total-section { text-align: left; }
  .acct-total-amount { font-size: 1.3rem; }
  .acct-order-actions { flex-direction: column; }
  .acct-order-actions .button { height: 44px; }
}

/* ===== Mobile Account Page (<768px) ===== */
@media (max-width: 767px) {
  /* One cohesive card: sidebar becomes the outer container */
  .acct-sidebar {
    border: 2px solid #ededf0 !important;
    border-radius: 24px !important;
    background: var(--paper, #fff) !important;
    overflow: hidden !important;
  }

  /* Profile card loses its own border — becomes top section */
  .acct-profile-card {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 14px 20px !important;
    text-align: left !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
  }
  .acct-profile-avatar {
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }
  .acct-profile-initials {
    font-size: 1.1rem !important;
  }
  .acct-profile-text {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
  }
  .acct-profile-name {
    font-size: 0.95rem !important;
    margin: 0 0 2px !important;
  }
  .acct-profile-email {
    font-size: 0.78rem !important;
    margin: 0 !important;
  }
  .acct-profile-hover {
    display: none !important;
  }

  /* Divider between profile and nav */
  .acct-sidebar > .acct-nav {
    border-top: 1px solid #ededf0 !important;
  }

  /* Nav in one row, no wrap */
  .acct-nav {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
  }
  .acct-nav-btn {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 12px 4px !important;
    font-size: 0.7rem !important;
    text-align: center !important;
    border-radius: 0 !important;
    border-right: 1px solid #ededf0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .acct-nav-btn:last-of-type {
    border-right: none !important;
  }
  .acct-signout-btn {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 12px 4px !important;
    font-size: 0.7rem !important;
    justify-content: center !important;
    border-radius: 0 !important;
    margin-top: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: var(--danger, #dc2626) !important;
    font-weight: 700 !important;
    gap: 0 !important;
  }
  .acct-signout-btn svg {
    display: none !important;
  }
  .acct-signout-btn:hover {
    color: var(--danger, #dc2626) !important;
  }

  /* Reduce sidebar gap */
  .acct-sidebar {
    gap: 12px !important;
  }

  /* Compact order cards */
  .acct-order-card {
    padding: 14px !important;
    border-radius: 18px !important;
  }
  .acct-order-header {
    margin-bottom: 12px !important;
    padding-bottom: 10px !important;
  }
  .acct-order-id {
    font-size: 1rem !important;
  }
  .acct-order-date {
    font-size: 0.8rem !important;
  }
  .acct-order-items {
    margin-bottom: 12px !important;
  }
  .acct-order-item-row {
    margin-bottom: 10px !important;
    padding-bottom: 10px !important;
  }
  .acct-order-thumb {
    width: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
  }
  .acct-order-item-name {
    font-size: 0.85rem !important;
  }
  .acct-order-item-meta {
    font-size: 0.75rem !important;
  }
  .acct-order-item-price {
    font-size: 0.85rem !important;
  }
  .acct-order-footer {
    padding-top: 12px !important;
    margin-top: 10px !important;
  }
  .acct-total-amount {
    font-size: 1.1rem !important;
  }
  .acct-order-actions {
    margin-top: 12px !important;
  }
  .acct-order-actions .button {
    height: 40px !important;
    font-size: 0.8rem !important;
    border-radius: 10px !important;
  }

  /* Status badges fit on mobile */
  .order-status-pill {
    font-size: 0.65rem !important;
    padding: 4px 10px !important;
  }

  /* Order details modal full-width on mobile — override desktop modal constraints */
  #orderDetailsModal.modal {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    overflow: hidden !important;
  }

  #orderDetailsModal .modal-panel {
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    height: 100% !important;
    height: 100dvh !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    transform: none !important;
    overflow-y: auto !important;
  }

  .acct-details-panel {
    width: 100% !important;
    max-width: none !important;
    border-radius: 0 !important;
    min-height: 100dvh !important;
  }
  .acct-details-head {
    padding: 16px !important;
  }
  .acct-details-inner {
    padding: 16px !important;
  }
  .acct-details-foot {
    padding: 16px !important;
  }
}

@keyframes shipped-pulse {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}
