/* Kavir Makhzan Dimensions Table */
.km-dimensions-page {
  direction: rtl;
  color: #243247;
  font-family: inherit;
  line-height: 1.8;
}
.km-dimensions-page * { box-sizing: border-box; }
.km-dimensions-intro { margin: 0 0 22px; }
.km-dimensions-intro h2 {
  margin: 0 0 8px;
  color: #0D2C66;
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.5;
}
.km-dimensions-intro p { margin: 0; color: #586579; }
.km-dimensions-filters {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #e0e6ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(13,44,102,.045);
}
.km-filter-main {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}
.km-dimensions-filters label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.km-dimensions-filters label > span,
.km-dimension-grid fieldset legend {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}
.km-dimensions-filters input,
.km-dimensions-filters select,
.km-sort-control select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d6dee8;
  border-radius: 8px;
  padding: 9px 11px;
  color: #253247;
  background: #fff;
  font: inherit;
  font-size: 14px;
}
.km-dimension-details {
  margin-top: 18px;
  border-top: 1px solid #edf0f4;
  padding-top: 14px;
}
.km-dimension-details summary {
  cursor: pointer;
  color: #0D2C66;
  font-weight: 700;
  padding: 4px 0;
}
.km-dimension-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.km-dimension-grid fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #e1e7ef;
  border-radius: 10px;
}
.km-dimension-grid fieldset legend { padding: 0 4px; }
.km-dimension-grid fieldset label { margin-top: 8px; }
.km-dimension-grid fieldset label > span { font-size: 12px; font-weight: 400; color: #687589; }
.km-dimension-grid input { min-height: 40px; }
.km-dimension-note { margin: 12px 0 0; color: #69768a; font-size: 12px; }
.km-filter-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.km-primary-button,
.km-reset-button,
.km-dimensions-page .km-add-to-cart,
.km-dimensions-page .km-select-product {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 8px;
  text-decoration: none !important;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease;
}
.km-primary-button { border: 1px solid #0D2C66; background: #0D2C66; color: #fff; }
.km-primary-button:hover { background: #163d80; color: #fff; }
.km-reset-button { border: 1px solid #d7dee8; background: #fff; color: #334155; }
.km-reset-button:hover { background: #f3f6fa; color: #0D2C66; }
.km-results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 22px 0 12px;
}
.km-results-count { margin: 0; color: #536176; font-size: 14px; }
.km-sort-control { display: flex; align-items: center; gap: 8px; }
.km-sort-control span { white-space: nowrap; font-size: 13px; font-weight: 600; }
.km-sort-control select { min-width: 205px; }
.km-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #dce2e9;
  border-radius: 10px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.km-products-table {
  width: 100%;
  min-width: 1050px;
  margin: 0;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  text-align: center;
  font-size: 13px;
}
.km-products-table th,
.km-products-table td {
  padding: 12px 11px;
  border: 0;
  border-bottom: 1px solid #e0e5ec;
  border-left: 1px solid #e0e5ec;
  vertical-align: middle;
  white-space: nowrap;
}
.km-products-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e71919;
  color: #fff;
  font-weight: 700;
}
.km-products-table tbody th { font-weight: 500; }
.km-products-table tbody tr:nth-child(even) { background: #f7f9fc; }
.km-products-table tbody tr:hover { background: #eef4fc; }
.km-products-table tbody tr:last-child th,
.km-products-table tbody tr:last-child td { border-bottom: 0; }
.km-products-table tr > *:last-child { border-left: 0; }
.km-product-name { min-width: 230px; text-align: right; white-space: normal !important; }
.km-product-name a { color: #0D2C66; text-decoration: none; font-weight: 600; }
.km-product-name a:hover { color: #087e8b; text-decoration: underline; }
.km-product-price { min-width: 130px; color: #243247; }
.km-product-price .amount { font-weight: 700; }
.km-buy-cell { min-width: 150px; }
.km-stock-status { display: block; margin-bottom: 6px; font-size: 11px; }
.km-in-stock { color: #16834a; }
.km-out-of-stock { color: #b42318; }
.km-dimensions-page .km-add-to-cart { border: 1px solid #16834a; background: #16834a; color: #fff; }
.km-dimensions-page .km-add-to-cart:hover { background: #116b3b; color: #fff; }
.km-dimensions-page .km-select-product { border: 1px solid #0D2C66; background: #0D2C66; color: #fff; }
.km-no-results { padding: 30px 18px; border: 1px solid #e1e7ef; border-radius: 12px; text-align: center; }
.km-no-results h3 { margin: 0 0 8px; color: #0D2C66; }
.km-no-results p { color: #5e6b7e; }
.km-pagination { margin: 22px 0; }
.km-pagination ul { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.km-pagination li { margin: 0; }
.km-pagination a,
.km-pagination span { display: block; padding: 7px 12px; border: 1px solid #dce2e9; border-radius: 7px; text-decoration: none; }
.km-pagination .current { background: #0D2C66; color: #fff; border-color: #0D2C66; }
.km-dimensions-help { margin-top: 28px; padding: 18px 20px; border-right: 4px solid #0D2C66; background: #f5f8fc; border-radius: 8px; }
.km-dimensions-help h3 { margin: 0 0 8px; font-size: 17px; color: #0D2C66; }
.km-dimensions-help p { margin: 0; color: #4b596d; font-size: 13px; }
.km-table-error { padding: 12px; border: 1px solid #f3c5c5; border-radius: 8px; color: #a11; }
@media (max-width: 900px) {
  .km-filter-main { grid-template-columns: 1fr 1fr; }
  .km-search-field { grid-column: 1 / -1; }
  .km-dimension-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .km-dimensions-filters { padding: 14px; }
  .km-filter-main { grid-template-columns: 1fr; }
  .km-search-field { grid-column: auto; }
  .km-dimension-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .km-dimension-grid fieldset { padding: 8px; }
  .km-results-toolbar { align-items: stretch; flex-direction: column; }
  .km-sort-control { align-items: stretch; flex-direction: column; }
  .km-sort-control select { min-width: 0; }
  .km-filter-actions > * { flex: 1; }
  .km-dimensions-intro h2 { font-size: 23px; }
}
