/**
 * Construction timber stock list (template-parts/catalog/stock.php).
 *
 * Layout statybine-mediena.html. Loaded after category.css: the filter column,
 * its chips, the slide-in panel below 1100px and the sort dropdown come from
 * there; this file adds the heading, the table and its card view below 860px.
 */

/* ---- Heading ---- */
.sm-head{padding:22px 0 10px}
.sm-head .vh1{font-size:clamp(28px,3.4vw,42px); display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin:0}
.sm-head .cnt{font-family:"General Sans",sans-serif; font-size:14px; font-weight:600; color:var(--brand-d);
  background:var(--soft); border-radius:20px; padding:5px 13px}
.sm-tags{display:flex; flex-wrap:wrap; gap:10px; margin-top:16px}
.sm-tag{display:inline-flex; align-items:center; gap:8px; background:var(--cream); border:1px solid var(--line2);
  border-radius:8px; padding:8px 13px; font-size:13.5px; color:#3d4136}
.sm-tag svg{width:17px; height:17px; color:var(--brand-d); flex:0 0 17px}
.sm-note{margin-top:16px; border:1px solid var(--line); border-radius:9px; background:#fff}
.sm-note summary{cursor:pointer; padding:12px 16px; font-weight:600; font-size:14.5px; list-style:none}
.sm-note summary::-webkit-details-marker{display:none}
.sm-note summary::after{content:"+"; float:right; color:var(--mut); font-weight:400}
.sm-note[open] summary::after{content:"−"}
.sm-note-b{padding:0 16px 14px; font-size:14px; color:#3d4136}
.sm-note-b p{margin:0 0 7px}

/* ---- Layout ---- */
.sm-cat{padding:16px 0 56px}
.sm-layout{display:grid; grid-template-columns:230px minmax(0,1fr); gap:22px; align-items:start}
/* The "?" hints rise above their chip and must not be clipped by the column. */
.sm-aside{padding-top:4px; overflow:visible}
.sm-main{min-width:0}
@media(max-width:1100px){ .sm-layout{grid-template-columns:minmax(0,1fr)} }

/* ---- Treatment hints ---- */
.fchips-apd label > span{display:inline-flex; align-items:center}
.sq{position:relative; display:inline-flex; align-items:center; justify-content:center; width:15px; height:15px;
  margin-left:5px; border-radius:50%; border:1px solid var(--line); background:#fff; color:var(--mut);
  font-size:10px; line-height:1; cursor:help; padding:0; vertical-align:middle; font-weight:400}
.sq:hover, .sq:focus-visible{border-color:var(--brand); color:var(--brand-d)}
/* .fchips span (category.css) would draw a chip border around the hint too. */
.fchips .sq-tip{position:absolute; left:50%; bottom:calc(100% + 8px); transform:translateX(-30%); display:block;
  width:260px; max-width:calc(100vw - 32px); background:var(--ink); color:#fff; font-size:12.5px; line-height:1.45;
  text-align:left; border:0; border-radius:8px; padding:9px 11px; opacity:0; visibility:hidden; transition:.15s;
  z-index:60; font-weight:400; pointer-events:none; white-space:normal; box-shadow:0 8px 22px rgba(20,24,16,.22)}
.fchips .sq-tip::after{content:""; position:absolute; top:100%; left:30%; border:6px solid transparent; border-top-color:var(--ink)}
.sq:hover .sq-tip, .sq:focus-visible .sq-tip, .sq.on .sq-tip{opacity:1; visibility:visible}
.fchips input:checked + span .sq{border-color:rgba(255,255,255,.6); background:transparent; color:#fff}

/* ---- Toolbar ---- */
.sm-bar{display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 10px; flex-wrap:wrap}
.sm-res{font-size:14px; color:var(--mut)}
.sm-res b{color:var(--ink)}
.sm-bar .sm-sortw{display:inline-flex; align-items:center; gap:9px; font-size:14px; color:var(--mut)}
.sm-dd{min-width:210px}

/* ---- Table ---- */
.sm-tablewrap{border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff}
.sm-table{width:100%; border-collapse:collapse; font-size:13.5px; table-layout:fixed}
.sm-table th{text-align:left; white-space:normal; font-size:11.5px; font-weight:600; color:var(--mut); text-transform:uppercase;
  letter-spacing:.03em; padding:11px 8px; vertical-align:bottom; line-height:1.25; background:var(--cream); border-bottom:1px solid var(--line)}
.sm-table td{padding:11px 8px; border-bottom:1px solid var(--line); vertical-align:middle}
/* Class and the numbers sit centred, their headings too (client, 21.10). */
.sm-table th:nth-child(3), .sm-table th:nth-child(5),
.sm-table th:nth-child(6), .sm-table th:nth-child(7){text-align:center}
.sm-table td.c-kok, .sm-table td.c-kiek, .sm-table td.c-kaina, .sm-table td.c-m3{text-align:center}
.sm-table th:nth-child(1){width:19%}
.sm-table th:nth-child(2){width:11%}
.sm-table th:nth-child(3){width:8%}
.sm-table th:nth-child(4){width:13%}
.sm-table th:nth-child(5){width:9%}
.sm-table th:nth-child(6){width:11%}
.sm-table th:nth-child(7){width:11%}
.sm-table th:nth-child(8){width:18%}
.sm-table tbody tr:hover{background:var(--cream2)}
.sm-table .mm{color:var(--mut); font-size:13px; font-weight:400}
.sm-table .c-mat{white-space:nowrap}
.sm-table .c-mat b{font-size:14px}
/* "pcs." may drop to the next line where the column is narrow (861-1000, 1101-1200px). */
.sm-table .c-kiek{white-space:normal}
.sm-table .c-kok .chip{display:inline-block; border:1px solid var(--line); border-radius:6px; padding:2px 8px; font-size:13px; line-height:1.3}
.sm-table .c-apd{color:#3d4136; white-space:normal}
.sm-table .c-kiek .dot{display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--brand); margin-right:6px}
.sm-table .c-kiek .dot.low{background:#d8a01f}
.sm-table .c-kaina b{font-size:14.5px; white-space:nowrap}
.sm-table .c-m3{white-space:nowrap; color:var(--mut); font-size:12.5px}
/* The button drops under the quantity when the column runs out of room
   (from 1100px up the filter column takes its share, so this happens well
   above the card breakpoint). */
.sm-table .c-buy{text-align:right}
.sm-table .c-buy-in{display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:6px}
.sm-table .qty{display:inline-flex; align-items:center; border:1px solid var(--line); border-radius:7px; overflow:hidden;
  vertical-align:middle}
.sm-table .qty button{width:24px; height:32px; background:#fff; border:0; cursor:pointer; font-size:15px; color:var(--mut)}
.sm-table .qty button:hover{background:var(--soft); color:var(--ink)}
.sm-table .qty input{width:32px; height:32px; border:0; border-left:1px solid var(--line); border-right:1px solid var(--line);
  border-radius:0; text-align:center; font-family:inherit; font-size:14px; padding:0}
.sm-table .btn-cart{white-space:nowrap; background:var(--brand); color:#fff; border:1.5px solid var(--brand); border-radius:7px;
  padding:8px 11px; font-weight:600; font-size:12.5px; cursor:pointer; vertical-align:middle; transition:.15s; font-family:inherit}
.sm-table .btn-cart:hover{background:var(--brand-d); border-color:var(--brand-d)}
.sm-table .btn-cart.ok{background:var(--soft); color:var(--brand-d); border-color:var(--soft)}
.sm-table .btn-cart:disabled{opacity:.6; cursor:wait}
.sm-table tr[hidden]{display:none}
.sm-table tr.last td{border-bottom:0}
.sm-empty{padding:34px 16px; text-align:center; color:var(--mut)}

/* ---- Under the table ---- */
.sm-lead{color:#3d4136; font-size:15.5px}
.sm-lead-b{margin:22px 0 0}
.sm-cta{display:flex; align-items:center; justify-content:space-between; gap:22px; flex-wrap:wrap;
  margin-top:28px; background:var(--soft); border-radius:14px; padding:26px 30px}
.sm-cta-t b{display:block; font-size:19px; margin-bottom:5px}
.sm-cta-t span{color:#3d4136; font-size:15px}
.sm-cta-b{display:flex; gap:10px; flex-wrap:wrap}

/* ---- Cards below 860px ---- */
@media(max-width:860px){
  .sm-table thead{display:none}
  .sm-table, .sm-table tbody, .sm-table tr{display:block; width:100%}
  .sm-table tr{border-bottom:1px solid var(--line); padding:13px 14px; position:relative}
  .sm-table tr.last{border-bottom:0}
  .sm-table td{display:block; width:100%; border:0; padding:2px 0; text-align:left}
  .sm-table td.c-kok, .sm-table td.c-kiek, .sm-table td.c-kaina, .sm-table td.c-m3{text-align:left}
  .sm-table .c-mat{padding-right:70px}
  .sm-table .c-mat b{font-size:16px}
  .sm-table .c-med, .sm-table .c-apd{display:inline; width:auto; color:var(--mut); font-size:13.5px}
  .sm-table .c-med:not(:empty)::after{content:"·"; margin:0 5px; color:var(--line)}
  .sm-table .c-kok{position:absolute; top:13px; right:14px; width:auto; padding:0}
  .sm-table .c-kiek{margin-top:5px}
  .sm-table .c-kaina{margin-top:1px}
  .sm-table .c-m3{color:var(--mut); font-size:13px}
  .sm-table .c-m3:not(:empty)::before{content:"≈ "}
  .sm-table .c-buy{margin-top:11px}
  .sm-table .c-buy-in{flex-wrap:nowrap; justify-content:flex-start; gap:10px}
  .sm-table .c-buy .btn-cart{flex:1; padding:11px 15px}
  .sm-table .sm-empty-row{padding:0}
  .sm-cta{padding:22px 20px}
}
@media(max-width:560px){
  .sm-bar .sm-sortw{width:100%; justify-content:space-between}
  .sm-cta-b, .sm-cta-b .btn{width:100%; justify-content:center}
}
