/* Override body from style.css (home-page specific) */
body {
  height: auto;
  overflow: auto;
}

.cart-layout {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.cart-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cart-header-left h2 {
  margin: 0;
  font-size: 20px;
  color: #1f2937;
}

.cart-back-link {
  color: #6366f1;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.cart-back-link:hover {
  text-decoration: underline;
}

.cart-header-right {
  display: flex;
  gap: 8px;
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}

.cart-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.cart-empty p {
  font-size: 16px;
  margin-bottom: 20px;
}

.cart-table {
  width: 100%;
}

.cart-product-name {
  font-weight: 500;
  color: #1f2937;
}

.cart-product-brand {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

.cart-price {
  white-space: nowrap;
  color: #ef4444;
  font-weight: 500;
}

.cart-qty-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-qty-btn:hover {
  background: #f3f4f6;
}

.cart-qty-val {
  min-width: 32px;
  text-align: center;
  font-weight: 500;
}

.cart-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  text-align: right;
}

.cart-total {
  font-size: 18px;
}

.cart-total strong {
  color: #ef4444;
  font-size: 22px;
}

.cart-count {
  color: #6b7280;
  font-size: 14px;
  margin-left: 12px;
}

/* Order cards */
.order-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.order-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.order-no {
  font-weight: 600;
  color: #1f2937;
}

.order-date {
  font-size: 13px;
  color: #6b7280;
}

.order-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-status {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.status-shipped {
  background: #d1fae5;
  color: #065f46;
}

.status-unshipped {
  background: #fef3c7;
  color: #92400e;
}

.order-total {
  font-weight: 600;
  color: #ef4444;
  font-size: 16px;
}

.order-shipping-info,
.order-shipping-time {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.order-shipping-info {
  background: #ede9fe;
  color: #7c3aed;
}

.order-shipping-time {
  background: #fef3c7;
  color: #d97706;
}

.order-items-table {
  margin: 0;
  border: none;
}

/* Admin order management */
.admin-order-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.admin-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-order-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-order-user {
  font-weight: 600;
  color: #6366f1;
}

.admin-order-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shipping-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
}

.shipping-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ─── Utility classes (previously from admin.css) ─── */
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.btn-danger {
  background: var(--error, #d32f2f);
  color: white;
}
.btn-danger:hover { opacity: 0.9; }

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th {
  background: var(--bg, #f8f9fc);
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 2px solid var(--border, #e8e8f0);
}

.cart-table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f5;
}

.cart-table tr:hover { background: #f8f8ff; }

.order-items-table {
  width: 100%;
  border-collapse: collapse;
}

.order-items-table th {
  background: var(--bg, #f8f9fc);
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1px solid var(--border, #e8e8f0);
}

.order-items-table td {
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f5;
}

.modal-sm { width: 400px; }

/* ─── Active nav highlight ─── */
.active-nav {
  background: rgba(255,255,255,0.35) !important;
  border-color: rgba(255,255,255,0.5) !important;
  font-weight: 600;
}

/* ─── Login prompt page ─── */
.login-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  text-align: center;
  background: var(--bg, #f8f9fc);
}

.login-prompt-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.login-prompt h2 {
  font-size: 24px;
  color: #1f2937;
  margin: 0 0 8px;
}

.login-prompt p {
  font-size: 15px;
  color: #6b7280;
  margin: 0 0 28px;
}

.login-prompt-btn {
  padding: 10px 36px;
  font-size: 15px;
  text-decoration: none;
  border-radius: 8px;
}

.login-prompt-footer {
  margin-top: 24px;
}

.login-prompt-footer a {
  color: var(--primary, #667eea);
  text-decoration: none;
  font-size: 14px;
}

.login-prompt-footer a:hover {
  text-decoration: underline;
}

/* ─── Mobile responsive ─── */
@media (max-width: 768px) {
  .cart-table thead { display: none; }

  .cart-table,
  .cart-table tbody,
  .cart-table tr,
  .cart-table td {
    display: block;
  }

  .cart-table tr {
    background: white;
    border: 1px solid var(--border, #e8e8f0);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 12px;
  }

  .cart-table td {
    padding: 3px 0;
    border-bottom: none;
    font-size: 13px;
  }

  .modal-sm { width: calc(100vw - 24px); }
}
