/* ==========================================================================
   Página "Mis pedidos" — Alex vxntas
   ========================================================================== */

.orders-hero {
  padding: clamp(26px, 5vw, 54px) 0 6px;
}

.orders-hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  line-height: 1.1;
}

.orders-hero .lede {
  max-width: 620px;
  color: #aab3c5;
}

.orders-section {
  padding: 10px 0 72px;
}

.orders-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.orders-summary {
  color: #8b93a7;
  font-size: 0.9rem;
}

.orders-list {
  display: grid;
  gap: 8px;
}

.orders-list.hidden,
.orders-empty.hidden {
  display: none !important;
}

.order-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #64748b;
  border-radius: 14px;
  background: linear-gradient(160deg, #12161f 0%, #0c1016 100%);
  padding: 10px 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.order-card.is-completed { border-left-color: #10b981; }
.order-card.is-process   { border-left-color: #f59e0b; }
.order-card.is-pending   { border-left-color: #64748b; }
.order-card.needs-receipt { border-left-color: #f59e0b; }
.order-card.needs-receipt .order-hint { color: #fcd34d; font-weight: 600; }
.order-card.is-failed    { border-left-color: #ef4444; }
.order-card.is-cancelled { border-left-color: #6b7280; opacity: 0.8; }

.order-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.order-badge .icon {
  width: 13px;
  height: 13px;
}

.is-completed .order-badge { color: #6ee7b7; background: rgba(16, 185, 129, 0.14); }
.is-process   .order-badge { color: #fcd34d; background: rgba(245, 158, 11, 0.15); }
.is-pending   .order-badge { color: #cbd5e1; background: rgba(148, 163, 184, 0.15); }
.is-failed    .order-badge { color: #fca5a5; background: rgba(239, 68, 68, 0.15); }
.is-cancelled .order-badge { color: #d1d5db; background: rgba(107, 114, 128, 0.2); }

.order-price {
  color: #e6e9f0;
  font-size: 0.95rem;
}

.order-product {
  margin: 6px 0 2px;
  font-weight: 600;
  color: #e6e9f0;
  font-size: 0.95rem;
}

.order-mailbox-note {
  margin: 4px 0 8px;
  padding: 8px 10px;
  border: 1px solid rgba(251, 191, 36, 0.42);
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.08);
}

.order-mailbox-title {
  display: block;
  color: #fcd34d;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.order-mailbox-text {
  margin: 3px 0 0;
  color: #e5e7eb;
  font-size: 0.72rem;
  line-height: 1.4;
}

.order-mailbox-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: #fbbf24;
  color: #1c1405;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.order-mailbox-btn:hover {
  background: #fcd34d;
}

.order-mailbox-btn:focus-visible {
  outline: 2px solid #fde68a;
  outline-offset: 2px;
}

.order-mailbox-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.order-hint {
  margin: 0 0 6px;
  color: #9aa3b6;
  font-size: 0.78rem;
  line-height: 1.4;
}

.order-meta {
  display: grid;
  gap: 2px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.order-meta p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  font-size: 0.78rem;
}

.order-meta span {
  color: #8b93a7;
}

.order-meta strong {
  color: #e6e9f0;
  text-align: right;
  word-break: break-all;
}

.order-support {
  margin-top: 8px;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.order-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: #9aa3b6;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.order-help:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e6e9f0;
}
.order-actions .order-continue {
  flex: 1 1 160px;
}

.orders-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(24px, 5vw, 44px) 18px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(9, 12, 18, 0.45);
}

.orders-empty > .icon {
  width: 38px;
  height: 38px;
  color: #64748b;
}

.orders-empty h2 {
  margin: 10px 0 5px;
  font-size: 1.1rem;
  color: #e6e9f0;
}

.orders-empty p {
  margin: 0 0 14px;
  max-width: 400px;
  color: #9aa3b6;
  font-size: 0.88rem;
}

.orders-legend {
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(9, 12, 18, 0.5);
}

.orders-legend summary {
  cursor: pointer;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.88rem;
}

.orders-legend ul {
  margin: 8px 0 2px;
  padding-left: 18px;
  color: #9aa3b6;
  font-size: 0.82rem;
  line-height: 1.6;
}

.orders-legend strong {
  color: #e6e9f0;
}

/* Reseña del pedido */
.order-review { margin-top: 8px; padding: 8px 10px; border: 1px dashed rgba(255, 201, 60, 0.35); border-radius: 10px; background: rgba(255, 201, 60, 0.05); }
.order-review-title { margin: 0 0 4px; font-size: 0.78rem; color: var(--text-soft, #b9c3cf); }
.order-review-stars { display: flex; gap: 3px; }
.order-star { padding: 0 1px; border: 0; background: none; color: rgba(255, 255, 255, 0.22); font-size: 1.25rem; line-height: 1; cursor: pointer; transition: transform 0.12s, color 0.12s; }
.order-star:hover { transform: scale(1.1); }
.order-star.is-on { color: #ffc93c; }
.order-review-extra { display: grid; gap: 6px; margin-top: 6px; }
.order-review-extra[hidden] { display: none; }
.order-review-extra textarea { width: 100%; padding: 6px 8px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px; background: rgba(0, 0, 0, 0.3); color: inherit; font: inherit; font-size: 0.82rem; resize: vertical; }
.order-review-extra .btn { justify-self: start; }
.order-reviewed { margin: 6px 0 0; color: #ffc93c; font-size: 0.75rem; }
.orders-list { gap: 8px; }
.order-product { margin: 6px 0 2px; font-size: 0.95rem; }
.order-hint { margin: 0 0 6px; font-size: 0.78rem; line-height: 1.4; }
.order-meta { gap: 2px; padding-top: 6px; }
.order-meta p { font-size: 0.78rem; }
.order-actions { margin-top: 8px; }
.order-price { font-size: 0.95rem; }
.order-support { margin-top: 8px; }
.orders-legend { margin-top: 16px; padding: 10px 14px; border-radius: 12px; }
.orders-legend summary { font-size: 0.85rem; }
.orders-legend ul { font-size: 0.82rem; line-height: 1.6; }
.order-review { margin-top: 8px; padding: 8px 10px; border-radius: 10px; }
.order-review-title { margin: 0 0 4px; font-size: 0.78rem; }
.order-star { font-size: 1.25rem; }
.order-review-extra textarea { font-size: 0.82rem; padding: 6px 8px; }
.order-reviewed { margin: 6px 0 0; font-size: 0.75rem; }
@media (min-width: 900px) {
  .orders-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
/* Tarjetas pendientes compactas */
.pending-card {
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.07);
  padding: 8px 10px;
  margin-bottom: 6px;
}
.pending-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.pending-card-head h2 {
  font-size: 0.9rem;
  margin: 0;
}
.pending-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  color: #9aa3b6;
}
.pending-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.pending-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e6e9f0;
}
.btn-pending {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 8px;
}
@media (max-width: 600px) {
  .pending-card { padding: 6px 8px; border-radius: 10px; }
  .pending-card-head h2 { font-size: 0.85rem; }
  .pending-meta { font-size: 0.7rem; gap: 4px; }
  .pending-actions { gap: 4px; margin-top: 4px; }
  .btn-pending { padding: 3px 8px; font-size: 0.7rem; }
}
@media (max-width: 600px) {
  .orders-section { padding: 6px 0 40px; }
  .orders-toolbar { margin-bottom: 10px; }
  .orders-list { gap: 5px; }
  .order-card {
    padding: 7px 10px;
    border-radius: 10px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
  .order-card-top { gap: 6px; }
  .order-product { margin: 3px 0 1px; font-size: 0.82rem; }
  .order-hint { display: none; }
  .order-meta { gap: 1px; padding-top: 4px; }
  .order-meta p { font-size: 0.7rem; gap: 8px; }
  .order-actions { margin-top: 5px; gap: 5px; }
  .order-price { font-size: 0.82rem; }
  .order-badge { padding: 2px 7px; font-size: 0.58rem; gap: 3px; }
  .order-badge .icon { width: 10px; height: 10px; }
  .orders-legend { margin-top: 10px; padding: 7px 10px; }
  .orders-empty { padding: 20px 14px; }
  .orders-empty h2 { font-size: 1rem; }
  .orders-empty p { font-size: 0.82rem; }
  .order-review { padding: 6px 8px; }
  .order-review-title { font-size: 0.72rem; }
  .order-star { font-size: 1.1rem; }
  .order-review-extra textarea { font-size: 0.75rem; padding: 5px 7px; }
  .order-reviewed { font-size: 0.7rem; }
}

/* Tarjetas de "Mis pedidos" compactas -------------------------------- */
.orders-list { gap: 6px; }
.order-card { padding: 8px 10px; border-radius: 10px; }
.order-card-top { gap: 6px; }
.order-badge { padding: 3px 8px; font-size: 0.6rem; gap: 4px; }
.order-badge .icon { width: 11px; height: 11px; }
.order-price { font-size: 0.85rem; }
.order-product { margin: 3px 0 1px; font-size: 0.85rem; }
.order-hint {
  margin: 0 0 4px;
  font-size: 0.7rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.order-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 4px; }
.order-meta p { display: inline-flex; align-items: baseline; gap: 4px; margin: 0; font-size: 0.7rem; }
.order-actions { margin-top: 5px; gap: 6px; }
.order-actions .btn { padding: 4px 10px; font-size: 0.72rem; min-height: 0; }
.order-support { margin-top: 5px; padding: 4px 10px; font-size: 0.72rem; }
.order-help { width: 18px; height: 18px; font-size: 0.7rem; }
.order-review { margin-top: 5px; padding: 6px 8px; border-radius: 9px; }
.order-review-title { margin: 0 0 3px; font-size: 0.7rem; }
.order-star { font-size: 1.05rem; }
.order-reviewed { margin: 4px 0 0; font-size: 0.7rem; }
.order-review-extra { margin-top: 4px; gap: 4px; }
.order-review-extra textarea { padding: 5px 7px; font-size: 0.75rem; }

/* Línea de tiempo del pedido activo -------------------------------- */
.order-timeline { margin: 6px 0 4px; }
.order-steps { display: grid; grid-template-columns: repeat(4, 1fr); }
.order-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.order-step::before {
  content: '';
  position: absolute;
  top: 6px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: #24303f;
}
.order-step:first-child::before { display: none; }
.order-step-dot {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #1b2430;
  border: 2px solid #334155;
}
.order-step-label { font-size: 0.62rem; line-height: 1.1; color: #7c8ba1; text-align: center; }
.order-step.is-done .order-step-dot { background: #10b981; border-color: #10b981; }
.order-step.is-done::before { background: rgba(16, 185, 129, 0.55); }
.order-step.is-done .order-step-label { color: #6ee7b7; }
.order-step.is-active .order-step-dot {
  background: #f59e0b;
  border-color: #f59e0b;
  animation: orderStepPulse 1.8s ease-out infinite;
}
.order-step.is-active .order-step-label { color: #fcd34d; font-weight: 600; }
.order-timeline-detail { margin: 6px 0 0; font-size: 0.7rem; line-height: 1.35; color: #cbd5e1; }
.order-timeline-eta { margin: 2px 0 0; font-size: 0.64rem; color: #8ea0b5; }
@keyframes orderStepPulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .order-step.is-active .order-step-dot { animation: none; }
}

@media (max-width: 600px) {
  .orders-list { gap: 5px; }
  .order-card { padding: 6px 9px; border-radius: 9px; }
  .order-product { font-size: 0.82rem; }
  .order-hint { display: none; }
  .order-price { font-size: 0.82rem; }
  .order-badge { padding: 2px 7px; font-size: 0.58rem; }
  .order-badge .icon { width: 10px; height: 10px; }
  .order-meta p { font-size: 0.68rem; }
  .order-step-label { font-size: 0.6rem; }
  .order-timeline-detail { font-size: 0.68rem; }
  .order-timeline-eta { font-size: 0.62rem; }
}
