/* Manzo account sub-module. Cascade order is enforced by inc/assets.php. */

/* ---------- Dense data tables (orders + downloads) ---------- */
.mz-acct-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
  background: transparent;
}
/* Some host stylesheets paint `table, td, th { border: 1px solid rgba(0,0,0,.1) }`
   site-wide, which makes the table read as a spreadsheet grid. Wipe it on
   every cell — we paint the hairlines we want explicitly below. */
.mz-acct-table th,
.mz-acct-table td {
  border: 0;
  background: transparent;
}
/* Column sizing: shrink every cell to its content (width: 1% on a table cell
   is the classic "shrink-to-fit" trick — the browser still respects min
   content width but absorbs no extra slack). The single cell carrying
   .mz-acct-table__grow opts back into `auto`, so it eats all remaining width.
   Without this every column gets an equal share and the table sprawls. */
.mz-acct-table thead th,
.mz-acct-table th[scope="row"],
.mz-acct-table tbody td {
  width: 1%;
}
.mz-acct-table thead th.mz-acct-table__grow,
.mz-acct-table tbody td.mz-acct-table__grow {
  width: auto;
  white-space: normal;
}
/* Sotto 720px la tabella va in card-mode: il nowrap qui causa overflow su codici/date lunghe. */
@media (min-width: 721px) {
  .mz-acct-table th,
  .mz-acct-table td { white-space: nowrap; }
}

/* Header: small mono caps, anchored by a strong rule under the row. */
.mz-acct-table thead th {
  text-align: left;
  padding: 0 var(--s-5) var(--s-3) 0;
  font: 600 10px/1 var(--ff-mono);
  letter-spacing: var(--tr-micro);
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1.5px solid var(--ink-1);
}
.mz-acct-table thead th:first-child { padding-left: var(--s-3); }
.mz-acct-table thead th:last-child  { padding-right: var(--s-3); }

/* Body rows: generous padding, hairline divider, hover wash. */
.mz-acct-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--d-1) var(--ease);
}
.mz-acct-table tbody tr:last-child { border-bottom: 0; }
.mz-acct-table tbody tr:hover { background: var(--paper-2); }

.mz-acct-table th[scope="row"],
.mz-acct-table td {
  padding: var(--s-5) var(--s-5) var(--s-5) 0;
  vertical-align: middle;
  text-align: left;
}
.mz-acct-table th[scope="row"] { padding-left: var(--s-3); }
.mz-acct-table tbody tr > :last-child { padding-right: var(--s-3); }

.mz-acct-table th[scope="row"] {
  font-weight: 500;
  color: var(--ink-1);
  white-space: nowrap;
}
.mz-acct-table th[scope="row"] a {
  color: inherit;
  border-bottom: 1px solid transparent;
  transition: border-color var(--d-1) var(--ease);
}
.mz-acct-table th[scope="row"] a:hover { border-bottom-color: var(--ink-1); }

/* Orders variant: the order code is the row's anchor — beef it up, tabular
   figures, slightly larger. Scoped so the downloads table's filename column
   doesn't get the same treatment. */
.mz-acct-table--orders th[scope="row"] {
  font: 600 var(--t-md)/1 var(--ff-mono);
  font-feature-settings: 'tnum', 'zero';
  letter-spacing: 0;
}

/* Date column: mono, quieter, tabular. */
.mz-acct-table td time {
  font: 500 var(--t-sm)/1.2 var(--ff-mono);
  font-feature-settings: 'tnum';
  color: var(--ink-2);
  letter-spacing: 0;
  white-space: nowrap;
}

/* Totale: mono bold, right-aligned with proper breathing room. */
.mz-acct-table__num {
  text-align: right !important;
  white-space: nowrap;
  font: 600 var(--t-sm)/1 var(--ff-mono);
  font-feature-settings: 'tnum';
  color: var(--ink-1);
  letter-spacing: 0;
}
.mz-acct-table__num .woocommerce-Price-amount { display: inline; }

/* Action column: a single chevron at the right edge. */
.mz-acct-table__act { text-align: right; }
.mz-acct-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  color: var(--ink-3);
  border: 0;
  border-radius: var(--r-2);
  transition: color var(--d-1) var(--ease), background var(--d-1) var(--ease);
}
.mz-acct-chev svg { width: 16px; height: 16px; transition: transform var(--d-1) var(--ease); }
.mz-acct-chev:hover { color: var(--ink-1); background: var(--paper-3); border: 0; }
.mz-acct-chev:hover svg { transform: translateX(2px); }
.mz-acct-chev:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; color: var(--ink-1); }
.mz-acct-table tbody tr:hover .mz-acct-chev { color: var(--ink-1); }

.mz-acct-table__sub {
  display: block;
  margin-top: 2px;
  font: 500 10px/1 var(--ff-mono);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--ink-3);
}

@media (max-width: 720px) {
  .mz-acct-table thead { display: none; }
  /* Stacked card mode: two info rows + a chevron pinned right.
     DOM order is #code, date, status, total, chev. With 3 cols and the chev
     placed explicitly in col 3, the other 4 cells flow into cols 1-2 across
     two rows. */
  .mz-acct-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 36px;
    align-items: center;
    gap: var(--s-2) var(--s-4);
    padding: var(--s-4) var(--s-3);
    border-bottom: 1px solid var(--border);
  }
  .mz-acct-table th[scope="row"],
  .mz-acct-table td {
    padding: 0;
    text-align: left;
    width: auto;
    white-space: normal;
  }
  .mz-acct-table__num { text-align: right !important; }
  .mz-acct-table__act {
    grid-row: 1 / span 2;
    grid-column: 3;
    justify-self: end;
    align-self: center;
  }
}

.mz-acct-link {
  display: inline-flex; align-items: center;
  font: 600 var(--t-xs)/1 var(--ff-ui);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-1);
  border-bottom: 1px solid var(--ink-1);
  padding-bottom: 2px;
}
.mz-acct-link:hover { color: var(--brand); border-bottom-color: var(--brand); }
.mz-acct-link--quiet {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: var(--t-xs);
  color: var(--ink-3);
  border-bottom: 1px solid currentColor;
}
.mz-acct-link--quiet:hover { color: var(--brand); border-bottom-color: var(--brand); }

.mz-acct-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-6);
}
.mz-acct-pager > a:first-child { justify-self: start; }
.mz-acct-pager > a:last-child { justify-self: end; }
.mz-acct-pager__count {
  font-size: var(--t-xs);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--ink-3);
}

