/* mispedidos.css — Estilos de la vista "Mis Pedidos" (extraído de mispedidos.php)
   Consume los tokens globales de assets/css/tokens.css. */

:root {
  --brand:   var(--color-primary, #FF6B6B);
  --brand2:  var(--color-primary-dark, #FF8E53);
  --grad:    linear-gradient(135deg, var(--brand) 0%, var(--brand2) 100%);
  --radius:  var(--radius-md, 14px);
  --shadow:  var(--shadow-sm, 0 2px 10px rgba(0,0,0,.07));
}

body { background: var(--color-bg, #f5f6fa); font-family: system-ui, sans-serif; }

/* ── Header ── */
.orders-header {
  position: sticky; top: 0; z-index: 100;
/*      background: var(--color-surface, #fff); padding: 14px 16px;*/
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.back-btn {
/*       border: none; cursor: pointer;*/
  background: var(--grad);
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.back-btn:hover { background: #f0f0f0; }
.orders-header h1 { font-size: 1.2rem; font-weight: 700; margin: 0; color: var(--color-text, #222); }

/* ── Filtros de estado ── */
.filter-bar {
  display: flex; gap: 8px; padding: 12px 16px;
  overflow-x: auto; scrollbar-width: none;
  background: var(--color-surface, #fff); border-bottom: 1px solid var(--color-border, #eee);
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-pill {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--color-border, #ddd); background: var(--color-surface, #fff);
  font-size: 13px; font-weight: 500; color: var(--color-text-muted, #666);
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.filter-pill.active {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(255,107,107,.35);
}

/* ── Lista de pedidos ── */
#list-holder { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }

/* ── Card de pedido ── */
.order-card {
  background: var(--color-surface, #fff); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  cursor: pointer; transition: transform .18s, box-shadow .18s;
  border-left: 4px solid transparent;
}
.order-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.order-card.s-0  { border-left-color: var(--color-text-muted, #6c757d); }  /* Pendiente  */
.order-card.s-2  { border-left-color: var(--color-warning, #ffc107); }  /* En proceso */
.order-card.s-3  { border-left-color: var(--color-info, #0d6efd); }  /* Con delivery */
.order-card.s-1  { border-left-color: var(--color-success, #28a745); }  /* Entregado  */

.order-card-inner {
  display: flex; align-items: center;
  gap: 12px; padding: 14px 16px;
}
.order-logo {
  width: 52px; height: 52px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0;
}
.order-info { flex: 1; min-width: 0; }
.order-info .local-name {
  font-weight: 700; font-size: 14px; color: var(--color-text, #222);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.order-info .order-date { font-size: 11px; color: var(--color-text-light, #999); margin: 2px 0 4px; }
.order-info .order-total { font-size: 15px; font-weight: 700; color: var(--color-text, #333); }
.order-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.status-badge {
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: 20px; white-space: nowrap;
}
.st-0 { background: #f0f0f0; color: #666; }
.st-1 { background: #d4edda; color: #155724; }
.st-2 { background: #fff3cd; color: #856404; }
.st-3 { background: #cfe2ff; color: #084298; }
.order-items-count { font-size: 11px; color: var(--color-text-light, #aaa); }
.order-chevron { color: var(--color-border, #ccc); font-size: 18px; }

/* ── Botón repetir (dentro de la card) ── */
.repeat-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: #fff5f5;
  border: none; border-top: 1px solid #fde8e8;
  width: 100%; font-size: 13px; font-weight: 600;
  color: var(--brand); cursor: pointer;
  transition: background .18s;
}
.repeat-btn:hover { background: #ffe8e8; }
.repeat-btn i { font-size: 14px; }

/* ── Paginación ── */
.pagination-bar {
  display: flex; justify-content: center; align-items: center;
  gap: 8px; padding: 16px;
}
.page-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--color-border, #e0e0e0); background: var(--color-surface, #fff);
  font-size: 13px; font-weight: 600; color: var(--color-text-muted, #555);
  cursor: pointer; transition: all .18s;
  display: flex; align-items: center; justify-content: center;
}
.page-btn.active { background: var(--grad); border-color: transparent; color: #fff; }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-info { font-size: 13px; color: var(--color-text-light, #888); }

/* ── Tus cupones ── */
#cupones-box { padding: 12px 16px 0; }
.cupons-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.cupons-header h2 { font-size: 1rem; font-weight: 700; margin: 0; color: var(--color-text, #222); }
.cupons-header .badge {
  background: var(--grad); color: #fff; border-radius: 20px; padding: 2px 12px; font-size: 12px;
}
.cupons-header .cupones-ver-todos {
  font-size: 12px; font-weight: 600; color: var(--brand, #e60000);
  text-decoration: none; white-space: nowrap; margin-right: auto; margin-left: 8px;
}
.cupons-header .cupones-ver-todos:hover { text-decoration: underline; }
.orders-header .btn-cupones-link {
  margin-left: auto; font-size: 18px; color: var(--brand, #e60000);
  text-decoration: none; padding: 6px 10px;
}
#cupones-list { display: flex; flex-direction: column; gap: 10px; }
.cupon-card {
  background: var(--color-surface, #fff); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-left: 4px solid var(--brand);
}
.cupon-card .cupon-code { font-weight: 800; font-size: 15px; letter-spacing: .5px; color: var(--color-text, #222); }
.cupon-card .cupon-meta { font-size: 12px; color: var(--color-text-light, #999); margin-top: 2px; }
.cupon-card .btn-share {
  background: var(--grad); color: #fff; border: none; border-radius: 20px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .18s;
}
.cupon-card .btn-share:active { opacity: .85; }

/* ── Estado vacío ── */
.empty-state {
  text-align: center; padding: 60px 24px;
}
.empty-state svg { opacity: .25; margin-bottom: 16px; }
.empty-state h2 { font-size: 1.1rem; font-weight: 700; color: #444; margin-bottom: 8px; }
.empty-state p { color: #999; font-size: 14px; margin-bottom: 20px; }
.empty-state .btn-start {
  background: var(--grad); color: #fff; border: none;
  padding: 12px 28px; border-radius: 30px; font-weight: 700;
  font-size: 15px; box-shadow: 0 4px 14px rgba(255,107,107,.4);
}

/* ── Skeleton loader ── */
.skeleton-card {
  background: #fff; border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center;
}
.sk { background: #eee; border-radius: 8px; animation: shimmer 1.2s infinite; }
.sk-img  { width: 52px; height: 52px; border-radius: 10px; flex-shrink: 0; }
.sk-line { height: 12px; margin-bottom: 8px; }
.sk-line.w60 { width: 60%; }
.sk-line.w40 { width: 40%; }
.sk-line.w80 { width: 80%; }
@keyframes shimmer {
  0%,100% { opacity: 1; } 50% { opacity: .4; }
}

/* ── Modal detalle ── */
.detail-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 500; opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.detail-overlay.open { opacity: 1; pointer-events: all; }
.detail-panel {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-radius: 20px 20px 0 0;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  z-index: 501;
}
.detail-panel.open { transform: translateY(0); }
.detail-handle {
  width: 40px; height: 4px; background: #ddd;
  border-radius: 2px; margin: 12px auto 4px;
}
.detail-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 16px;
}
.detail-header h2 { font-size: 16px; font-weight: 700; margin: 0; }
.detail-close {
  width: 32px; height: 32px; border-radius: 50%; background: #f5f5f5;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #666;
}
.detail-section { padding: 0 20px 16px; }
.detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 13px; color: #999; }
.detail-val { font-size: 13px; font-weight: 600; color: #333; text-align: right; max-width: 60%; }
.product-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.product-row:last-child { border-bottom: none; }
.product-row img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.product-row .prod-info { flex: 1; min-width: 0; }
.product-row .prod-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-row .prod-meta { font-size: 12px; color: #999; }
.product-row .prod-total { font-size: 13px; font-weight: 700; color: #333; white-space: nowrap; }
.total-block { background: #f8f9fa; border-radius: 12px; padding: 14px 16px; margin: 0 20px 20px; }
.total-line { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.total-line.grand { font-size: 16px; font-weight: 700; border-top: 1px solid #e0e0e0; margin-top: 8px; padding-top: 10px; }
.detail-repeat-btn {
  display: block; width: calc(100% - 40px); margin: 0 20px 24px;
  padding: 14px; border-radius: 30px; border: none;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 4px 14px rgba(255,107,107,.4); cursor: pointer;
  transition: opacity .2s;
}
.detail-repeat-btn:hover { opacity: .9; }

/* ── Calificar pedido ── */
.rate-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; background: #fff8e1;
  border: none; border-top: 1px solid #fbefd0;
  width: 100%; font-size: 13px; font-weight: 600;
  color: #b8860b; cursor: pointer;
  transition: background .18s;
}
.rate-btn:hover { background: #fff3cd; }
.rate-btn i { font-size: 14px; }

.detail-rate-btn {
  display: block; width: calc(100% - 40px); margin: 0 20px 10px;
  padding: 14px; border-radius: 30px; border: 1.5px solid #ffc107;
  background: #fff8e1; color: #b8860b; font-weight: 700; font-size: 15px;
  cursor: pointer; transition: opacity .2s;
}
.detail-rate-btn:hover { opacity: .85; }

.detail-rating-done, .card-rating-done {
  text-align: center; font-size: 13px; font-weight: 600; color: #28a745;
  padding: 8px 16px;
}

/* ── Selector de estrellas (SweetAlert) ── */
#op-stars { display: flex; justify-content: center; gap: 6px; margin: 8px 0 14px; }
#op-stars .op-star {
  background: none; border: none; font-size: 30px; line-height: 1;
  color: #ddd; cursor: pointer; padding: 0 2px; transition: color .15s, transform .15s;
}
#op-stars .op-star:hover { transform: scale(1.15); }
#op-stars .op-star.on { color: #ffc107; }