/* v2 price tables (product types with version 2). Loaded from views/price-list/index.ejs only for v2. */

/*
 * The expandable detail is a <td> inside the product's own <tr> (not an extra row).
 * A normal table layout would put that cell beside the others, so v2 tables are laid out as a grid:
 * every thead/tbody/tr is a subgrid of the table's columns (so columns stay aligned like a table),
 * and the detail cell spans the full width on its own line below the row's cells.
 * The table sets its column count inline: style="--cols: N" (N = visible columns, without the detail cell).
 */
.price-v2-table {
  display: grid;
  grid-template-columns: repeat(var(--cols), auto);
}
.price-v2-table > thead,
.price-v2-table > tbody,
.price-v2-table > thead > tr,
.price-v2-table > tbody > tr {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}
.price-v2-table > thead > tr > th,
.price-v2-table > tbody > tr > td {
  align-self: center;
}
.price-v2-table > tbody > tr > .price-v2-detail-cell {
  grid-column: 1 / -1;
  align-self: stretch;
}
/* rows not updated today (Tehran time) are faded — the template only sets .price-v2-faded when the table has
   a row updated today and never on «تماس بگیرید» rows; today's dates are green (views/price-list/v2/updateDate.ejs).
   The opacity is on the cells, so the row's stripe background and the expanded detail stay at full strength. */
.price-v2-table > tbody > tr.price-v2-faded > td:not(.price-v2-detail-cell) {
  opacity: 0.55;
}
/* mobile: the row's child-td:py-[10px] must not pad the (collapsed) detail cell */
.price-v2-table > tbody > tr > .price-v2-detail-cell.detail-info-price {
  padding-top: 0;
  padding-bottom: 0;
}

/* the box around all tables (#new-table / #old-table in the shared price-list views, bg-white + padding) is
   transparent and unpadded in v2, so the table cards line up with the boxes above them;
   each table keeps its own white card (bg-white on the v2 table <section>s) */
#new-table,
#old-table {
  background-color: transparent;
  padding: 0;
}

/* mobile: the expanded panel has an extra «نام کالا» line (linkProduct), so it needs more room than v1's 75px */
.price-v2-detail.showPriceMobile {
  max-height: 160px;
}
