/* ============================================================
   CARTONITE — ACCOUNT PAGE STYLES
   ============================================================ */

/* Prevent overflow */
.account-page, .auth-section, .order-card { max-width: 100%; overflow-x: hidden; }

.account-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

/* Auth gate */
.auth-section {
  text-align: center;
  padding: 60px 24px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  max-width: 440px;
  margin: 0 auto;
}

.auth-section-icon {
  width: 72px;
  height: 72px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.auth-section h2 {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}

.auth-section p {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 24px;
  line-height: 1.6;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  color: var(--black);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  border: 2px solid var(--gray-200);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-main);
  width: 100%;
  justify-content: center;
}

.btn-google:hover {
  border-color: var(--accent);
  background: #fef3f2;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* OR divider */
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--gray-400);
  font-size: 13px;
}

.auth-or::before, .auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* Order code lookup */
.order-lookup {
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: left;
}

.order-lookup h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--black);
}

.lookup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lookup-form input {
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-main);
  outline: none;
  transition: border-color var(--transition);
  background: var(--white);
}

.lookup-form input:focus { border-color: var(--accent); }

.lookup-form button {
  background: var(--black);
  color: white;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-main);
}

.lookup-form button:hover { background: var(--black-3); }

/* Profile header */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gray-200);
}

.profile-avatar-fallback {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-info h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.profile-info p { font-size: 14px; color: var(--gray-600); }

.btn-signout {
  margin-left: auto;
  background: none;
  border: 2px solid var(--gray-200);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-main);
  white-space: nowrap;
}

.btn-signout:hover { border-color: var(--accent); color: var(--accent); }

/* Tabs */
.account-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  background: none;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.tab-btn:hover { color: var(--black); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

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

.order-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.order-card:hover { box-shadow: var(--shadow-md); }

.order-card-head {
  background: var(--gray-100);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--gray-200);
}

.order-code {
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
}

.order-date { font-size: 12px; color: var(--gray-600); }

.order-status {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: capitalize;
}

.order-status.confirmed { background: #dcfce7; color: #15803d; }
.order-status.pending { background: #fef3c7; color: #b45309; }
.order-status.shipped { background: #dbeafe; color: #1d4ed8; }
.order-status.delivered { background: #dcfce7; color: #15803d; }

.order-card-body { padding: 14px 18px; }

.order-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.order-item-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--gray-100);
  flex-shrink: 0;
}

.order-item-img img { width: 100%; height: 100%; object-fit: cover; }

.order-item-detail p { font-size: 14px; font-weight: 600; }
.order-item-detail span { font-size: 12px; color: var(--gray-600); }

.order-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
  margin-top: 4px;
}

.order-total-row span:first-child { font-size: 13px; color: var(--gray-600); }
.order-total-row span:last-child { font-size: 16px; font-weight: 800; }

.no-orders {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.no-orders svg { margin: 0 auto 16px; }
.no-orders h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; color: var(--black); }

@media (max-width: 768px) {
  .account-page { padding: 24px 16px 48px; }
  .profile-header { flex-wrap: wrap; gap: 12px; }
  .btn-signout { margin-left: 0; width: 100%; text-align: center; }
  .order-card-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .order-total-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .order-total-row span:last-child { font-size: 18px; }
}

@media (max-width: 480px) {
  .account-page { padding: 20px 14px 48px; }
  .tab-btn { padding: 10px 14px; font-size: 13px; }
  .order-code { font-size: 13px; letter-spacing: 1px; }
  .order-item-row { gap: 8px; }
  .order-item-img { width: 42px; height: 42px; }
  .order-item-detail p { font-size: 13px; }
  .auth-section { padding: 32px 18px; }
  .auth-section h2 { font-size: 20px; }
  .order-lookup { padding: 14px; }
  .profile-info h3 { font-size: 16px; }
  /* Guest view: collapse 2-col to 1-col */
  .guest-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 640px) {
  /* Collapse guest 2-col grid earlier on tablets too */
  .guest-grid { grid-template-columns: 1fr !important; }
}
