/* One-Off Designs only: use the Cool T grid buttons and visual styling unchanged. */
.iosg-oneoff-active .iosg-hidden-native-size,
.iosg-oneoff-active .iosg-hidden-native-submit,
.iosg-oneoff-active .iosg-hidden-native-qty,
.iosg-oneoff-active .iosg-hidden-native-size-table { display:none!important; }
.iosg-oneoff-grid[hidden] { display:none!important; }
.iosg-oneoff-grid .iosg-submit:disabled { opacity:.55; cursor:not-allowed; }

/* Move the existing form to a full-width row after the image/details section.
   This class is attached only by JS on enabled One Off Design product pages. */
.iosg-oneoff-active .iosg-wide-order-row {
  width:100%; min-width:0; max-width:100%; flex:0 0 100%;
  margin:0 0 24px; box-sizing:border-box;
}
.iosg-oneoff-active .iosg-wide-order-row > .elementor-widget,
.iosg-oneoff-active .iosg-wide-order-row > .elementor-widget > .elementor-widget-container,
.iosg-oneoff-active .iosg-wide-order-row form.variations_form {width:100%!important;max-width:none!important;}
.iosg-oneoff-active .iosg-wide-order-row .iosg-oneoff-grid {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 120px;
  grid-template-areas:'heading heading' 'helper helper' 'sizes actions';
  column-gap:12px;
  row-gap:5px;
  align-items:start;
  width:100%; max-width:100%;
  margin:0;
}
.iosg-oneoff-active .iosg-wide-order-row .isg-grid-title {grid-area:heading;margin:0!important;}
.iosg-oneoff-active .iosg-wide-order-row .isg-colour-message {grid-area:helper;margin:0 0 7px!important;}
.iosg-oneoff-active .iosg-wide-order-row .isg-table-wrap {grid-area:sizes;min-width:0;width:100%;max-width:565px;margin:0!important;}
.iosg-oneoff-active .iosg-wide-order-row .isg-table {margin:0!important;width:100%;}
.iosg-oneoff-active .iosg-wide-order-row .isg-table tbody {
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  max-width:565px;
  gap:6px;
}
.iosg-oneoff-active .iosg-wide-order-row .iosg-wide-action-panel {
  grid-area:actions;
  display:flex; flex-direction:column; align-items:stretch; justify-content:center;
  align-self:center; gap:10px; padding-bottom:1px; min-width:0;
}
.iosg-oneoff-active .iosg-wide-order-row .iosg-wide-action-panel .isg-total {
  margin:0!important;
  text-align:center;
}
.iosg-oneoff-active .iosg-wide-order-row .iosg-submit {
  display:block; width:100%; margin:0!important;
  box-sizing:border-box; white-space:normal; line-height:1.35;
  padding:12px 10px; min-height:43px; text-align:center;
}
@media(max-width:767px){
  .iosg-oneoff-active .iosg-wide-order-row .iosg-oneoff-grid{
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:'heading' 'helper' 'sizes' 'actions';
    row-gap:8px;
  }
  .iosg-oneoff-active .iosg-wide-order-row .isg-table tbody{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  .iosg-oneoff-active .iosg-wide-order-row .iosg-wide-action-panel{
    flex-direction:row; align-items:center; justify-content:space-between; gap:12px;
  }
  .iosg-oneoff-active .iosg-wide-order-row .iosg-submit{max-width:240px;}
}
@media(max-width:410px){
  .iosg-oneoff-active .iosg-wide-order-row .isg-table tbody{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .iosg-oneoff-active .iosg-wide-order-row .iosg-wide-action-panel{
    flex-direction:column; align-items:stretch;
  }
  .iosg-oneoff-active .iosg-wide-order-row .iosg-submit{max-width:none;}
}

/* v1.0.5: The 1.0.3 compact tiles were about 90px wide.
   Do not stretch tiles when moving the form across the bottom. Six such
   tiles fit on one row on desktop; the real order button stays to the right. */
@media (min-width:768px) and (max-width:960px) {
  .iosg-oneoff-active .iosg-wide-order-row .isg-table-wrap { max-width:380px; }
  .iosg-oneoff-active .iosg-wide-order-row .isg-table tbody {
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    max-width:380px;
  }
}
@media (max-width:767px) {
  .iosg-oneoff-active .iosg-wide-order-row .isg-table-wrap { max-width:290px; }
  .iosg-oneoff-active .iosg-wide-order-row .isg-table tbody { max-width:290px; }
}

/* 1.0.6: Keep approved v1.0.3 tile dimensions; only refine placement below product.
   The ordering action sits visually centred alongside the unchanged tiles. */
.iosg-oneoff-active .iosg-wide-order-row .iosg-wide-action-panel {
  justify-content:center; align-self:center;
}
@media(max-width:767px) {
  .iosg-oneoff-active .iosg-wide-order-row .iosg-wide-action-panel { align-self:stretch; }
}

/* v1.0.8 – position only, not a tile redesign. The original v1.0.7 tiles
   retain their ~52px size. The nine Arsenal sizes share ONE horizontal row
   alongside the basket action instead of being forced into six columns. */
@media (min-width:768px) {
  .iosg-oneoff-active .iosg-wide-order-row .iosg-oneoff-grid {
    grid-template-columns:minmax(0,1fr) 128px!important;
    grid-template-areas:'heading heading' 'helper helper' 'sizes actions';
    column-gap:12px!important;
    align-items:center!important;
  }
  .iosg-oneoff-active .iosg-wide-order-row .isg-table-wrap,
  .iosg-oneoff-active .iosg-wide-order-row .isg-table {
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
  }
  .iosg-oneoff-active .iosg-wide-order-row .isg-table tbody {
    display:grid!important;
    grid-template-columns:repeat(auto-fit,52px)!important;
    width:100%!important;
    max-width:none!important;
    gap:5px!important;
    align-content:start;
  }
  .iosg-oneoff-active .iosg-wide-order-row .iosg-wide-action-panel {
    grid-area:actions;
    justify-content:center!important;
    align-self:center!important;
    width:128px!important;
    max-width:128px!important;
  }
  .iosg-oneoff-active .iosg-wide-order-row .iosg-submit {
    width:100%!important;
    min-width:0!important;
  }
}

/* 1.0.9: Keep the existing 52px tiles and one-line presentation.
   Place the basket actions immediately beside the final tile, not at the far
   edge of a stretched 100%-wide grid. This changes no form or ordering logic. */
@media (min-width:768px) {
  .iosg-oneoff-active .iosg-wide-order-row .iosg-oneoff-grid {
    grid-template-columns: max-content 140px !important;
    grid-template-areas: 'heading heading' 'helper helper' 'sizes actions' !important;
    justify-content:start!important;
    align-items:center!important;
    column-gap:14px!important;
    width:fit-content!important;
    max-width:100%!important;
  }
  .iosg-oneoff-active .iosg-wide-order-row .isg-table-wrap,
  .iosg-oneoff-active .iosg-wide-order-row .isg-table {
    width:max-content!important;
    max-width:100%!important;
  }
  .iosg-oneoff-active .iosg-wide-order-row .isg-table tbody {
    grid-template-columns:repeat(9,52px)!important;
    width:max-content!important;
    max-width:100%!important;
    gap:5px!important;
  }
  .iosg-oneoff-active .iosg-wide-order-row .iosg-wide-action-panel {
    width:140px!important;
    max-width:140px!important;
    justify-content:center!important;
    align-self:center!important;
    min-width:0!important;
  }
}
/* Site theme's .button.alt rules were overriding the submit button with grey.
   Keep it turquoise even while disabled (clicking still requires a quantity). */
.iosg-oneoff-active .iosg-wide-order-row button.iosg-submit,
.iosg-oneoff-active .iosg-wide-order-row button.iosg-submit:disabled,
.iosg-oneoff-active .iosg-wide-order-row button.iosg-submit:focus {
  background-color:#16b9b4!important;
  border:1px solid #16b9b4!important;
  color:#fff!important;
  opacity:1!important;
  box-shadow:none!important;
  font-weight:600!important;
}
.iosg-oneoff-active .iosg-wide-order-row button.iosg-submit:hover:not(:disabled){
  background-color:#119d99!important;
  border-color:#119d99!important;
  color:#fff!important;
}
.iosg-oneoff-active .iosg-wide-order-row button.iosg-submit:disabled {
  opacity:.70!important;
  cursor:not-allowed!important;
}
/* On smaller viewports, restore responsive wrapping so controls stay usable. */
@media (min-width:768px) and (max-width:900px) {
  .iosg-oneoff-active .iosg-wide-order-row .iosg-oneoff-grid {
    grid-template-columns:minmax(0,1fr) 140px!important;
    width:100%!important;
  }
  .iosg-oneoff-active .iosg-wide-order-row .isg-table-wrap,
  .iosg-oneoff-active .iosg-wide-order-row .isg-table { width:100%!important; }
  .iosg-oneoff-active .iosg-wide-order-row .isg-table tbody {
    width:100%!important;
    grid-template-columns:repeat(auto-fit,52px)!important;
  }
}
