/* My Account → «Οι παραγγελίες μου».

   Replaces WooCommerce's five-column shop_table. Reuses the checkout-next design
   tokens (--cn-*), enqueued as a dependency, so the account area reads as one
   product with the cart and the checkout.

   Two rules from earlier bugs are load-bearing here:
     - the theme's bare `a:link` colour rule (metro style.css) outranks any
       single-class colour, so every coloured link below also states :link/:visited;
     - the webp plugin wraps <img> in <picture>, which breaks `> img` child
       selectors — the thumbnail rules match `img` as a descendant instead.

   Touch targets are 44px+: this page is read on a phone, standing in a queue. */

.adp-ord {
  font-family: inherit;
  color: var(--cn-ink, #1d1d28);
}

/* Scoped border-box, the same isolation checkout-next applies under .cn-page.
   The theme has no global one, so without this a full-width button overflows
   its card by exactly its own padding — which is how it first shipped. */
.adp-ord, .adp-ord *, .adp-ord *::before, .adp-ord *::after { box-sizing: border-box; }

/* ---------- result count ----------
   No <h2> here on purpose: the theme banner already prints the endpoint title
   ("Παραγγελίες") as the page <h1>, so a heading in the content column would
   only say it twice. The chips name the current view; this says how big it is. */

.adp-ord-count {
  margin: 0 0 var(--cn-sp-2, 12px);
  font-size: 13px;
  font-weight: 600;
  color: var(--cn-muted, #6b6b7a);
  font-variant-numeric: tabular-nums;
}

/* ---------- filter chips ----------
   A scroll strip rather than a wrapping row: three chips wrap to two lines on a
   360px screen and the second line reads like a stray control. */

.adp-ord-filters {
  display: flex;
  gap: 8px;
  margin: 0 0 var(--cn-sp-3, 16px);
  padding: 2px 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.adp-ord-filters::-webkit-scrollbar { display: none; }

.adp-ord-chip,
.adp-ord-chip:link,
.adp-ord-chip:visited {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border: 1.5px solid var(--cn-line, #e3e3ec);
  border-radius: 999px;
  background: #fff;
  color: var(--cn-muted, #6b6b7a);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .12s, color .12s, background .12s;
}
.adp-ord-chip:hover {
  border-color: var(--cn-purple, #2e0c64);
  color: var(--cn-purple, #2e0c64);
}
.adp-ord-chip[aria-current="page"],
.adp-ord-chip[aria-current="page"]:link,
.adp-ord-chip[aria-current="page"]:visited {
  border-color: var(--cn-purple, #2e0c64);
  background: var(--cn-purple, #2e0c64);
  color: #fff;
}

/* ---------- the list ---------- */

.adp-ord-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--cn-sp-2, 12px);
}
.adp-ord-list > li { margin: 0; }

.adp-ord-card {
  position: relative;
  overflow: hidden;
  padding: var(--cn-sp-3, 16px);
  border: 1px solid var(--cn-line, #e3e3ec);
  border-radius: var(--cn-radius, 12px);
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.adp-ord-card:hover,
.adp-ord-card:focus-within {
  border-color: var(--cn-purple, #2e0c64);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

/* An order the customer still owes us money for wears the same left accent bar
   as the payment panel on the order page — one visual idiom for "your move". */
.adp-ord-card--todo { border-color: #f0e1c2; padding-left: calc(var(--cn-sp-3, 16px) + 5px); }
.adp-ord-card--todo::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: #d97706;
}
.adp-ord-card--todo:hover,
.adp-ord-card--todo:focus-within { border-color: #d97706; }

/* ---------- card head ---------- */

.adp-ord-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--cn-sp-2, 12px);
  margin-bottom: var(--cn-sp-2, 12px);
}
.adp-ord-ident { min-width: 0; }

/* The whole card is the click target — the pseudo-element covers it, and the
   controls in the footer sit above it. Keyboard focus still lands on this one
   anchor, which is why the card lifts on :focus-within. */
.adp-ord-num,
.adp-ord-num:link,
.adp-ord-num:visited {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--cn-ink, #1d1d28);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.adp-ord-num::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.adp-ord-card:hover .adp-ord-num { color: var(--cn-purple, #2e0c64); }
.adp-ord-num:focus-visible { outline: none; }
.adp-ord-num:focus-visible::after {
  outline: 2px solid var(--cn-purple, #2e0c64);
  outline-offset: 2px;
}

/* On a 390px screen "Παραγγελία #1569058" wraps to two lines next to the badge
   and every card grows a row. Below 420px only the number shows — clipped, not
   removed, so the link is still announced in full. */
.adp-ord-num__word { white-space: pre; }

.adp-ord-date {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--cn-muted, #6b6b7a);
}

/* ---------- status badge ---------- */

.adp-ord-badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.adp-ord-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
}
/* Kept in step with adp_orders_status_tones() — the order page paints the same
   six pairs inline, and a badge that changes colour between the two screens
   reads as a status change. */
.adp-ord-badge--wait  { background: #fff4e0; color: #a25b00; }
.adp-ord-badge--move  { background: #e8f0ff; color: #1f4dbe; }
.adp-ord-badge--ready { background: #fef0ff; color: #7a2da3; }
.adp-ord-badge--done  { background: #e3f7e8; color: #1f7a35; }
.adp-ord-badge--void  { background: #fde7e7; color: #a32020; }
.adp-ord-badge--plain { background: #f1ebff; color: #5a3d8a; }

/* ---------- what is in the order ---------- */

.adp-ord-body {
  display: flex;
  align-items: center;
  gap: var(--cn-sp-2, 12px);
  min-width: 0;
}

.adp-ord-thumbs {
  display: flex;
  flex: none;
  gap: 6px;
}
.adp-ord-thumb {
  width: 52px;
  height: 52px;
  padding: 4px;
  border: 1px solid var(--cn-line, #e3e3ec);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}
/* Descendant, not child: the webp plugin puts a <picture> in between. */
.adp-ord-thumb picture { display: block; width: 100%; height: 100%; }
.adp-ord-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0;
}
.adp-ord-thumb--more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--cn-bg, #f6f6fa);
  color: var(--cn-muted, #6b6b7a);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.adp-ord-items { min-width: 0; }
.adp-ord-item-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.adp-ord-item-rest {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--cn-muted, #6b6b7a);
}

/* ---------- footer: the money and the controls ----------
   One rule keeps them together. On a 1020px-wide account column the facts alone
   used maybe a fifth of the row and left the rest empty, so from 760px up the
   buttons move onto the same line, right-aligned — which also takes ~50px of
   height off every card in the list. */

.adp-ord-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--cn-line, #e3e3ec);
}

.adp-ord-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cn-sp-1, 6px) var(--cn-sp-4, 24px);
  margin: 0;
}
.adp-ord-fact { min-width: 0; }
.adp-ord-fact dt {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cn-muted, #6b6b7a);
}
.adp-ord-fact dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.adp-ord-fact--eta dd { color: #1f4dbe; }
/* WooCommerce puts the currency in its own span; keep it from inheriting a
   larger price size elsewhere in the theme. */
.adp-ord-fact dd .woocommerce-Price-amount { font-size: inherit; font-weight: inherit; }

/* Custom columns added by a plugin through woocommerce_account_orders_columns
   land here rather than being dropped on the floor. */
.adp-ord-fact--extra dd { font-size: 14px; font-weight: 600; }

/* ---------- actions ---------- */

.adp-ord-actions {
  position: relative; /* above the stretched link */
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

@media (min-width: 760px) {
  .adp-ord-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--cn-sp-4, 24px);
  }
  .adp-ord-facts { flex: 1 1 auto; }
  /* Natural width, so a long "Αίτηση Επιστροφής" never squeezes the total. */
  .adp-ord-actions { flex: 0 0 auto; margin-top: 0; justify-content: flex-end; }
}

.adp-ord-btn,
.adp-ord-btn:link,
.adp-ord-btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--cn-line, #e3e3ec);
  border-radius: 10px;
  background: #fff;
  color: var(--cn-ink, #1d1d28);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition: border-color .12s, background .12s, color .12s;
}
.adp-ord-btn:hover {
  border-color: var(--cn-purple, #2e0c64);
  color: var(--cn-purple, #2e0c64);
}

.adp-ord-btn--primary,
.adp-ord-btn--primary:link,
.adp-ord-btn--primary:visited {
  border-color: var(--cn-purple, #2e0c64);
  background: var(--cn-purple, #2e0c64);
  color: #fff;
}
.adp-ord-btn--primary:hover {
  background: #26094f;
  border-color: #26094f;
  color: #fff;
}

/* Paying is the one action on this page that is time-critical, so it gets the
   amber of the "your move" accent rather than competing with plain purple. */
.adp-ord-btn--pay,
.adp-ord-btn--pay:link,
.adp-ord-btn--pay:visited {
  border-color: #d97706;
  background: #d97706;
  color: #fff;
}
.adp-ord-btn--pay:hover { background: #b45309; border-color: #b45309; color: #fff; }

/* Cancelling is recoverable but not casual: quiet until you reach for it. */
.adp-ord-btn--quiet,
.adp-ord-btn--quiet:link,
.adp-ord-btn--quiet:visited {
  border-color: transparent;
  color: var(--cn-muted, #6b6b7a);
}
.adp-ord-btn--quiet:hover { border-color: #e6b8b8; color: #a32020; }

.adp-ord-btn:focus-visible {
  outline: 2px solid var(--cn-purple, #2e0c64);
  outline-offset: 2px;
}

/* ---------- empty state ---------- */

.adp-ord-empty {
  padding: var(--cn-sp-4, 24px);
  border: 1px dashed var(--cn-line, #e3e3ec);
  border-radius: var(--cn-radius, 12px);
  background: var(--cn-bg, #f6f6fa);
  text-align: center;
}
.adp-ord-empty__icon {
  width: 44px;
  height: 44px;
  margin: 0 auto var(--cn-sp-2, 12px);
  color: var(--cn-purple, #2e0c64);
  opacity: .55;
}
.adp-ord-empty__icon svg { width: 100%; height: 100%; display: block; }
.adp-ord-empty__title { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.adp-ord-empty p {
  margin: 0 0 var(--cn-sp-3, 16px);
  font-size: 14px;
  line-height: 1.5;
  color: var(--cn-muted, #6b6b7a);
}
.adp-ord-empty p:last-child { margin-bottom: 0; }

/* ---------- pagination ---------- */

/* Three cells, so "Σελίδα 2 από 5" stays centred on the first and last
   pages, where only one of the two arrows exists. */
.adp-ord-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--cn-sp-2, 12px);
  margin-top: var(--cn-sp-4, 24px);
}
.adp-ord-pager .adp-ord-btn--prev { grid-column: 1; justify-self: start; }
.adp-ord-pager .adp-ord-btn--next { grid-column: 3; justify-self: end; }
.adp-ord-pager__where {
  grid-column: 2;
  font-size: 13px;
  font-weight: 600;
  color: var(--cn-muted, #6b6b7a);
  font-variant-numeric: tabular-nums;
}

/* ---------- phones ---------- */

@media (max-width: 600px) {
  .adp-ord-card { padding: 14px; }
  .adp-ord-card--todo { padding-left: 19px; }

  /* One thumbnail leaves plenty of room for the product name beside it. Four
     leave ~110px, which turns the name into three truncated words — so a strip
     of more than one goes above the text instead. */
  .adp-ord-body--multi { flex-direction: column; align-items: stretch; gap: 10px; }

  .adp-ord-facts { gap: var(--cn-sp-2, 12px) var(--cn-sp-3, 16px); }
  .adp-ord-fact { flex: 1 1 calc(50% - var(--cn-sp-3, 16px)); }

  /* Buttons take the width of their label and wrap when the row runs out —
     "Εμφάνιση" and "Αίτηση Επιστροφής" fit side by side even at 320px, and
     stacking them full-width would add 50px of height to every card.
     flex-shrink 0 is what makes a long label wrap the ROW instead of itself. */
  .adp-ord-btn { flex: 1 0 auto; padding: 0 14px; white-space: nowrap; }

  /* The pager keeps its own row for the arrows and drops the position below
     them — three cells on a 320px screen leaves each arrow ~90px wide. */
  .adp-ord-pager { grid-template-columns: 1fr 1fr; }
  .adp-ord-pager__where { grid-column: 1 / -1; grid-row: 2; text-align: center; }
  .adp-ord-pager .adp-ord-btn { grid-row: 1; width: auto; }
  .adp-ord-pager .adp-ord-btn--prev { grid-column: 1; }
  .adp-ord-pager .adp-ord-btn--next { grid-column: 2; }
}

@media (max-width: 380px) {
  /* Shrink the strip rather than dropping a thumbnail — hiding one would leave
     the "+N" chip lying about how many are left. */
  .adp-ord-thumb { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .adp-ord-card,
  .adp-ord-chip,
  .adp-ord-btn { transition: none; }
}

@media (max-width: 420px) {
  .adp-ord-num__word {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
