/* =========================
   Game Metalworks Category Table
   Compact Default Styling
   ========================= */

/* PDF Download Button */
.gmw-pdf-download{ text-align:right; margin: 0 0 12px 0; }
.gmw-pdf-button{
  display:inline-block;
  padding:8px 14px;
  border:2px solid #333;
  background:#fff;
  color:#333;
  font-size:13px;
  font-weight:600;
  text-decoration:none;
  border-radius:3px;
}
.gmw-pdf-button:hover{ background:#333; color:#fff; }

/* YITH Request a Quote action column */
.gmw-category-table .gmw-quote-action--placeholder,
.gmw-category-table .gmw-quote-action--static{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:54px;
  padding:0;
  background:#f7f7f7;
  color:#444;
  font-size:11px;
  font-weight:700;
  line-height:1.1;
  text-align:center;
}
.gmw-category-table .gmw-quote-action--placeholder.is-gmw-quote-error,
.gmw-category-table .gmw-quote-action--static.is-gmw-quote-error{
  color:#8a1f11;
  background:#fff5f2;
}
.gmw-category-table .gmw-quote-action--placeholder.is-gmw-quote-unavailable,
.gmw-category-table .gmw-quote-action--static.is-gmw-quote-unavailable{
  color:#666;
  background:#f7f7f7;
}
.gmw-category-table .gmw-quote-action--static.is-gmw-quote-busy .gmw-static-quote-btn{
  opacity:.65;
  pointer-events:none;
}
.gmw-category-table .gmw-static-quote-btn{
  border:0;
  border-left:3px solid rgba(5,173,72,.65);
  background:#fff;
  color:#111;
  cursor:pointer;
}
.gmw-category-table .gmw-static-quote-btn:hover,
.gmw-category-table td.gmw-quote-cell:hover .gmw-static-quote-btn{
  background:rgba(5,173,72,.08);
  color:#057f38;
}
.gmw-category-table th.gmw-quote-head{
  text-align:center;
  vertical-align:middle;
  white-space:nowrap;
  width:112px;
  min-width:112px;
}
.gmw-category-table td.gmw-quote-cell{
  position:relative;
  text-align:center;
  vertical-align:middle;
  white-space:normal;
  padding:0 !important;
  width:112px;
  min-width:112px;
  max-width:112px;
  cursor:pointer;
  overflow:hidden;
}
.gmw-category-table td.gmw-quote-cell *,
.gmw-category-table td.gmw-quote-cell *::before,
.gmw-category-table td.gmw-quote-cell *::after{
  box-sizing:border-box;
}
.gmw-category-table .gmw-quote-action,
.gmw-category-table .gmw-quote-action > div,
.gmw-category-table .gmw-quote-action .yith-ywraq-add-to-quote,
.gmw-category-table .gmw-quote-action .yith-ywraq-add-button{
  display:flex;
  align-items:stretch;
  justify-content:center;
  width:100%;
  height:100%;
  min-height:54px;
  margin:0;
}
.gmw-category-table .gmw-quote-action{
  position:relative;
  overflow:hidden;
}
.gmw-category-table .gmw-quote-action .button,
.gmw-category-table .gmw-quote-action a.button,
.gmw-category-table .gmw-quote-action button{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:54px;
  height:100%;
  margin:0;
  padding:0 10px;
  line-height:1.15;
  font-size:12px;
  font-weight:700;
  text-align:center;
  border-radius:0;
  white-space:nowrap;
}
/*
   YITH prints long response/browse messages in shortcode contexts. Inside the
   table we suppress YITH's free-form message text and render a compact,
   predictable added state from our wrapper instead.
*/
.gmw-category-table .gmw-quote-action .gmw-quote-view-fallback{
  display:none !important;
}
.gmw-category-table .gmw-quote-action [class*='yith_ywraq_add_item'],
.gmw-category-table .gmw-quote-action [class*='ywraq_add_item'],
.gmw-category-table .gmw-quote-action [class*='response'],
.gmw-category-table .gmw-quote-action [class*='message'],
.gmw-category-table .gmw-quote-action [id*='response'],
.gmw-category-table .gmw-quote-action [id*='message']{
  display:none !important;
  visibility:hidden !important;
  max-width:0 !important;
  max-height:0 !important;
  width:0 !important;
  height:0 !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  overflow:hidden !important;
  font-size:0 !important;
  line-height:0 !important;
  opacity:0 !important;
}
.gmw-category-table .gmw-quote-action .yith-ywraq-add-button.show{
  display:flex !important;
  align-items:center;
  justify-content:center;
}
.gmw-category-table .gmw-quote-action .yith-ywraq-add-button.hide{
  display:none !important;
}
.gmw-category-table .gmw-quote-action.is-gmw-quote-added{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  width:100%;
  min-height:54px;
  padding:5px 6px;
  background:#f7f7f7;
  color:#111;
  text-align:center;
  cursor:default;
}
.gmw-category-table .gmw-quote-action.is-gmw-quote-added::before{
  content:'Added';
  display:block;
  font-size:12px;
  font-weight:700;
  line-height:1.1;
  color:#111;
}
.gmw-category-table .gmw-quote-action.is-gmw-quote-added .yith-ywraq-add-button,
.gmw-category-table .gmw-quote-action.is-gmw-quote-added .yith-ywraq-add-to-quote{
  display:none !important;
}
.gmw-category-table .gmw-quote-action.is-gmw-quote-added .gmw-quote-view-fallback{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  width:auto;
  min-width:76px;
  max-width:100%;
  min-height:22px;
  padding:3px 7px;
  border:1px solid rgba(5,173,72,.45);
  border-radius:3px;
  background:#fff;
  color:#057f38 !important;
  font-size:10px !important;
  font-weight:700;
  line-height:1.1;
  text-decoration:none !important;
  white-space:normal;
}
.gmw-category-table .gmw-quote-action.is-gmw-quote-added .gmw-quote-view-fallback:hover{
  border-color:#05ad48;
  color:#05ad48 !important;
}

/* Lazy-loaded child category table sections */
.gmw-lazy-table-placeholder{
  border:1px dashed rgba(0,0,0,.22);
  border-radius:8px;
  background:linear-gradient(180deg, rgba(0,0,0,.025), rgba(0,0,0,.01));
  min-height:76px;
  margin-top:4px;
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.gmw-lazy-table-placeholder__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  width:100%;
  max-width:720px;
}
.gmw-lazy-table-placeholder__label{
  color:#333;
  font-size:13px;
  font-weight:700;
  line-height:1.25;
}
.gmw-lazy-table-load{
  border:1px solid rgba(5,173,72,.55);
  border-radius:5px;
  background:#fff;
  color:#057f38;
  cursor:pointer;
  font-size:12px;
  font-weight:800;
  line-height:1;
  padding:9px 12px;
  white-space:nowrap;
}
.gmw-lazy-table-load:hover{
  border-color:#05ad48;
  color:#05ad48;
}
.gmw-lazy-table-placeholder.is-loading .gmw-lazy-table-load{
  opacity:.55;
  pointer-events:none;
}
.gmw-lazy-table-placeholder.is-error{
  border-color:rgba(138,31,17,.35);
  background:#fff7f5;
}
/* Once AJAX has inserted the real table, the lazy wrapper should disappear visually
   so loaded sections match the immediately-rendered tables exactly. */
.gmw-lazy-table-placeholder[data-gmw-lazy-loaded='1']{
  display:block;
  align-items:initial;
  justify-content:initial;
  min-height:0;
  margin-top:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
}
.gmw-lazy-table-placeholder[data-gmw-lazy-loaded='1'] .gmw-lazy-table-placeholder__inner{
  display:none;
}
@media (max-width:640px){
  .gmw-lazy-table-placeholder__inner{ display:block; text-align:center; }
  .gmw-lazy-table-load{ margin-top:10px; width:100%; }
}

.gmw-category-table {
  font-size: 13px;
  line-height: 1.25;
}

/* Main Category Header */
.gmw-category-table > h1,
.gmw-category-table > h2,
.gmw-category-table .gmw-cat-title {
  color: var(--awb-color3);
  font-size: 20px;
  margin: 0 0 10px;
  line-height: 1.15;
  font-weight: 700;
}

/* Subcategory Headers */
.gmw-category-table .gmw-subcat-title {
  font-size: 15px;
  font-weight: 700;
  margin: 16px 0 6px;
  line-height: 1.2;
}

/* Intro text */
.gmw-category-table .gmw-subcat-intro {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.3;
}

/* Bullet list */
.gmw-category-table .gmw-bullets {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: 13px;
}
.gmw-category-table .gmw-bullets li {
  margin: 2px 0;
}


.gmw-bullets-two{
  display:flex;
  gap: 28px;
  margin: 0 0 8px;
}
.gmw-bullets-two .gmw-bullets{
  margin: 0;
  width: 50%;
}
@media (max-width: 768px){
  .gmw-bullets-two{
    display:block;
  }
  .gmw-bullets-two .gmw-bullets{
    width: auto;
    margin: 0 0 8px;
  }
}

/* Tables (Catalog Borders) */
.gmw-category-table table{
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.3;
}

/* Header */
.gmw-category-table thead th{
  background: #f5f5f5;
  border: 1px solid #dcdcdc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
}

/* Body Cells */
.gmw-category-table tbody td{
  border: 1px solid #e2e2e2;
  padding: 10px 12px;
  vertical-align: top;
}

/* Row hover for usability */
.gmw-category-table tbody tr:hover{
  background: #fafafa;
}

.gmw-subcat-thumb-wrap{
  width: 60px;
  flex: 0 0 60px;
}
.gmw-subcat-thumb{
  display:block;
  width: 60px;      /* fallback */
  height: auto;
  object-fit: contain;
}
/* Reduce spacing between subcategory blocks */
.gmw-category-table .gmw-subcat-block {
  margin-bottom: 14px;
}

/* Horizontal scroll wrapper (wrapper sits OUTSIDE the table) */
.gmw-table-scroll{
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 4px;
}

/* Keep table from forcing the page wider */
.gmw-table-scroll > table.gmw-category-table{
  width: 100%;
  max-width: 100%;
}

/* Optional: if you’d rather scroll than wrap text */
.gmw-table-scroll > table.gmw-category-table th,
.gmw-table-scroll > table.gmw-category-table td{
  white-space: nowrap;
}

/* Subtle zebra striping */
.gmw-category-table tbody tr:nth-child(even) {
  background: rgba(0,0,0,.015);
}


/* Subcategory header layout (thumb + title) */
.gmw-category-table .gmw-subcat-head{
  display:flex;
  gap:10px;
  align-items:flex-start;
  margin: 16px 0 6px;
}

.gmw-category-table .gmw-subcat-thumb-wrap{ flex:0 0 auto; }

.gmw-category-table .gmw-subcat-thumb{
  width:60px;
  height:auto;
  object-fit:contain;
  border-radius:6px;
  background: rgba(0,0,0,.03);
  padding:4px;
}

/* Clickable rows */
.gmw-category-table tr[data-href]{
  cursor:pointer;
}

/* Row hover highlight (McMaster-ish subtle) */
.gmw-category-table tbody tr:hover td{
  background: rgba(0,0,0,.03);
}

/* =========================
   Shop Category Grid (McMaster-style)
   ========================= */
.gmw-shop-category-grid{
  display:grid;
  gap: 18px;
  margin: 6px 0 18px;
}
.gmw-shop-category-grid.gmw-shop-cols-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
.gmw-shop-category-grid.gmw-shop-cols-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
.gmw-shop-category-grid.gmw-shop-cols-4{ grid-template-columns: repeat(4, minmax(0,1fr)); }
.gmw-shop-category-grid.gmw-shop-cols-5{ grid-template-columns: repeat(5, minmax(0,1fr)); }
.gmw-shop-category-grid.gmw-shop-cols-6{ grid-template-columns: repeat(6, minmax(0,1fr)); }

@media (max-width: 980px){
  .gmw-shop-category-grid.gmw-shop-cols-4,
  .gmw-shop-category-grid.gmw-shop-cols-5,
  .gmw-shop-category-grid.gmw-shop-cols-6{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 640px){
  .gmw-shop-category-grid{ grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 14px; }
}

.gmw-shop-cat{
  display: flex;
  flex-direction: column;
  align-items: center;     /* horizontal centering */
  justify-content: center; /* vertical centering */
  text-align: center;
  height: 100%;            /* important so justify-content works */
}

/* Give the thumb wrapper a consistent “box” height */
.gmw-shop-cat__thumb{
  width: 250px;
  height: 250px;
  display: flex;
  align-items: center;     /* vertical center inside thumb box */
  justify-content: center; /* horizontal center inside thumb box */
  overflow: hidden;

  border: 1px solid rgba(0,0,0,.25);
  border-radius: 10px;
  background: #f6f6f6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
/* Actual image */
.gmw-shop-cat__thumb img,
.gmw-shop-cat__img{
  width: 100%;
  height: 100%;
  object-fit: cover; /* keeps the grid uniform */
  display: block;
}
.gmw-shop-cat__ph{
  width: 70%;
  height: 70%;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0,0,0,.06), rgba(0,0,0,.02));
}
/* Darker centered label */
.gmw-shop-cat__name{
  margin-top: 10px;
  color: #111;
  font-weight: 700;
}
.gmw-shop-cat:hover .gmw-shop-cat__thumb{
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
  transform: translateY(-1px);
  transition: all .12s ease-in-out;
}
/* =========================
   Sortable Headers (Client-side)
   ========================= */
.gmw-cat-table thead tr:last-child th{
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.gmw-cat-table th.gmw-sortable{
  position: relative;
  padding-right: 18px;
}
.gmw-cat-table th.gmw-sortable::after{
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .35;
}
.gmw-cat-table th.gmw-sortable[aria-sort='ascending']::after{ content: '▲'; opacity: .85; }
.gmw-cat-table th.gmw-sortable[aria-sort='descending']::after{ content: '▼'; opacity: .85; }
