.loader-wrapper {
  position: fixed;
  top: 50%;
  left: 10%;
  right: 10%;
  text-align: center;
  margin-top: -128px;
  opacity: 0.1;
  z-index: 999999;
}
#header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #f1f1f1;
  display: flex;
  margin: 0 auto 3rem auto;
  align-items: center;
  padding: 1.5rem;
  /* padding-top: var(--gutter-y);
  padding-bottom: var(--gutter-y); */
  box-shadow: 0 12px 6px -6px rgb(0 0 0 / 10%) !important;
}
#header .logotype img {
  max-width: 150px;
  max-height: 32px;
}
@media (min-width: 768px) {
  #header .logotype img {
    max-width: 250px;
    max-height: 80px;
  }
}
@media (min-width: 768px) {
  #header .logotype {
    width: auto;
  }
}
#header .middle {
  flex-grow: 1;
  padding-left: 11.25em;
  padding-right: 11.25em;
}
#header .customer-service {
  align-self: center;
  text-align: end;
  line-height: 150%;
  flex-grow: 1;
}
@media (min-width: 768px) {
  #header .customer-service {
    font-size: 1.25em;
  }
}
#header .customer-service .title {
  font-weight: bold;
  margin: 0;
}
@media (min-width: 992px) {
  #header .customer-service {
    flex-grow: 0;
  }
}
#box-checkout-cart {
  margin-top: 0;
}
#box-checkout-cart .row {
  margin-bottom: 0;
}
#box-checkout-cart [class*="col-"] {
  align-self: center;
}
#box-checkout-cart .headings {
  font-weight: 600;
  padding: 0.5em var(--gutter-x);
  border-bottom: 1px solid var(--default-border-color);
}
#box-checkout-cart .item {
  padding: var(--gutter-y) var(--gutter-x);
  border-top: 1px solid #e0e0e0;
}
#box-checkout-cart .item:nth-child(odd) {
  background: var(--table-striped-row-background-odd);
}
#box-checkout-cart .item:nth-child(even) {
  background: var(--table-striped-row-background-even);
}
#box-checkout-cart .name {
  font-weight: 600;
}
#box-checkout-cart .btn {
  padding-left: 1em;
  padding-right: 1em;
}
#box-checkout-cart .error {
  color: #f00;
}
#box-checkout-cart .unit-price,
#box-checkout-cart .total-price {
  font-size: 1.1em;
}
#box-checkout-cart .subtotal {
  font-size: 1.5em;
}
#box-checkout-customer fieldset {
  border: none;
  padding: 0;
}
#box-checkout-customer button[type=submit]:not([disabled]) {
  font-weight: bold;
  color: #ff0000;
  animation: flasher 1s linear infinite;
}
#box-checkout-shipping .thumbnail,
#box-checkout-payment .thumbnail {
  padding: 0.5em;
  overflow: hidden;
}
#box-checkout-shipping .option,
#box-checkout-payment .option {
  position: relative;
  background: var(--card-background-color);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  transition: all 250ms ease;
}
#box-checkout-shipping .option.btn,
#box-checkout-payment .option.btn {
  padding: 1em;
}
#box-checkout-shipping .option.btn:first-child,
#box-checkout-payment .option.btn:first-child {
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}
#box-checkout-shipping .option.btn:last-child,
#box-checkout-payment .option.btn:last-child {
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}
#box-checkout-shipping .option.active,
#box-checkout-payment .option.active {
  background: #e3e4e8;
}
#box-checkout-shipping .option:not(.active) .content,
#box-checkout-payment .option:not(.active) .content {
  max-height: 0;
  overflow-y: hidden;
}
#box-checkout-shipping .option .thumbnail,
#box-checkout-payment .option .thumbnail {
  padding: 3px !important;
  align-content: center;
}
#box-checkout-shipping .option .error,
#box-checkout-payment .option .error {
  color: #c00;
}
#box-checkout-shipping .option .content,
#box-checkout-payment .option .content {
  max-height: 200px;
  overflow-x: hidden;
  overflow-y: auto;
  text-align: start;
  transition: all 0.25s ease;
}
#box-checkout-shipping .option .description,
#box-checkout-payment .option .description {
  margin-bottom: 1em;
}
#box-checkout-shipping .option hr,
#box-checkout-payment .option hr {
  margin: 1em 0;
  border-color: #ddd;
}
@media (min-width: 768px) {
  #box-checkout-shipping .price,
  #box-checkout-payment .price {
    position: absolute;
    display: inline-block;
    top: var(--gutter-y);
    right: var(--gutter-x);
  }
}
#box-checkout-summary table {
  margin-bottom: 0;
}
#box-checkout-summary .error {
  align-self: center;
  font-size: 1.25em;
  color: #ff0000;
  text-align: center;
}
#box-checkout-summary input[type=checkbox][required]:not(:checked) {
  animation: flasher 1s linear infinite;
}

/* Emroq checkout mobile header stability
-------------------------------------------------- */

@media (max-width: 767px) {
  #header {
    min-height: 72px;
    height: 72px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "logo service";
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
  }

  #header .logotype {
    grid-area: logo;
    display: flex;
    align-items: center;
    min-width: 0;
  }

  #header .logotype img {
    display: block;
    width: auto;
    max-width: 150px;
    max-height: 42px;
  }

  #header .middle {
    display: none;
  }

  #header .customer-service {
    grid-area: service;
    display: block;
    align-self: center;
    justify-self: end;
    text-align: right;
    line-height: 1.2;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  #header .customer-service .title {
    margin: 0;
    font-size: 0.85rem;
  }
}

@media (max-width: 767px) {
  #header {
    position: static !important;
    top: auto !important;
    transform: none !important;
    margin-bottom: 1.5rem;
  }
}
  /* Emroq checkout checkbox rows
-------------------------------------------------- */

#box-checkout-customer .emroq-check-row,
#box-checkout-customer .emroq-check-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem 0 !important;
  line-height: 1.3;
}

#box-checkout-customer .emroq-check-heading {
  font-size: 1.15rem;
  font-weight: 700;
}

#box-checkout-customer .emroq-check-row input[type="checkbox"],
#box-checkout-customer .emroq-check-heading input[type="checkbox"] {
  flex: 0 0 auto;
  margin: 0;
}

/* Checkout cart mobile layout
-------------------------------------------------- */

@media (max-width: 767px) {
  #box-checkout-cart .item .row {
    align-items: center;
  }

  /* Gör produktens högra knappdel smalare och staplad */
  #box-checkout-cart .item .col-xs-3.col-sm-2.col-md-1:last-child {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: flex-end;
    justify-content: center;
  }

  /* Uppdatera + soptunna som små tydliga knappar */
  #box-checkout-cart .item button,
  #box-checkout-cart .item .btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Antal-fältet får mer plats */
  #box-checkout-cart .item .input-group {
    max-width: 100%;
    min-width: 92px;
  }

  #box-checkout-cart .item input[name^="quantity"] {
    min-width: 54px;
    text-align: center;
  }
}

/* Checkout cart mobile layout - clean version
-------------------------------------------------- */

@media (max-width: 767px) {

  #box-checkout-cart .item {
    padding: 1rem 0.75rem;
  }

  /* Yttre rad: bild + produktinnehåll */
  #box-checkout-cart .item > .row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.65rem;
  }

  /* Produktbilden ska inte bli ett nålstick */
  #box-checkout-cart .item > .row > .col-xs-3.col-sm-2.col-md-1:first-child {
    flex: 0 0 58px;
    width: 58px;
    max-width: 58px;
    padding: 0;
  }

  #box-checkout-cart .item > .row > .col-xs-3.col-sm-2.col-md-1:first-child img,
  #box-checkout-cart .item .thumbnail img {
    width: 48px;
    height: 48px;
    object-fit: contain;
  }

  /* Produktinfo */
  #box-checkout-cart .item > .row > .col-xs-9.col-sm-10.col-md-11 {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
  }

  /* Inre rad: namn, antal, uppdatera, ta bort */
  #box-checkout-cart .item > .row > .col-xs-9.col-sm-10.col-md-11 > .row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
  }

  /* Nollställ endast direkt inre kolumner, inte hela checkout-universum */
  #box-checkout-cart .item > .row > .col-xs-9.col-sm-10.col-md-11 > .row > [class*="col-"] {
    width: auto;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    flex: 0 0 auto;
  }

  /* Första inre kolumnen brukar innehålla namn/pris */
  #box-checkout-cart .item > .row > .col-xs-9.col-sm-10.col-md-11 > .row > [class*="col-"]:first-child {
    flex: 1 1 100%;
    min-width: 0;
  }

  #box-checkout-cart .item .name {
    display: block;
    margin-bottom: 0.25rem;
    text-align: left;
  }

  /* Antal */
  #box-checkout-cart .item .input-group {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
  }

  #box-checkout-cart .item input[name^="quantity"] {
    width: 48px;
    min-width: 48px;
    text-align: center;
  }

  /* Uppdatera + soptunna */
  #box-checkout-cart .item button,
  #box-checkout-cart .item .btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #box-checkout-cart .subtotal {
    font-size: 1.25em;
  }
}

/* Checkout cart quantity visibility fix
-------------------------------------------------- */

@media (max-width: 767px) {
  #box-checkout-cart .item .input-group {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    width: 105px !important;
    min-width: 105px !important;
    max-width: 105px !important;
  }

  #box-checkout-cart .item .input-group input[name^="item["] {
    display: block !important;
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 34px;
    padding: 0 !important;
    text-align: center !important;
    color: #2f2a26 !important;
    background: #fffaf4 !important;
    opacity: 1 !important;
    font-size: 0.95rem !important;
    font-weight: 600;
  }

  #box-checkout-cart .item .input-group .input-group-text,
  #box-checkout-cart .item .input-group span {
    width: 3.5rem !important;
    min-width: 38px !important;
    height: 34px;
    padding: 0 !important;
    justify-content: center;
    color: #2f2a26;
    background: #f1e6d8;
    display: inline-flex;
    align-items: center;
  }
}

/* Checkout shipping option text wrapping
-------------------------------------------------- */

#box-checkout-shipping .option .name,
#box-checkout-shipping .option .description {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.35;
}

#box-checkout-shipping .option .name {
  font-weight: 600;
}

#box-checkout-shipping .option .description {
  max-width: 100%;
}

@media (max-width: 767px) {
  #box-checkout-shipping .option .header .row {
    align-items: flex-start;
  }

  #box-checkout-shipping .option .name,
  #box-checkout-shipping .option .description {
    display: block;
  }
}

/* Checkout customer details mobile polish
-------------------------------------------------- */

@media (max-width: 767px) {

  #box-checkout-customer .emroq-contact-row .form-group {
    width: 100%;
  }

  #box-checkout-customer .emroq-contact-row .form-group + .form-group {
    margin-top: 0.85rem;
  }

  #box-checkout-customer .emroq-check-heading {
    margin: 1.4rem 0 1rem;
    font-size: 1.35rem;
    line-height: 1.25;
  }

  #box-checkout-customer .emroq-check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
  }

  #box-checkout-customer .emroq-check-row input[type="checkbox"] {
    flex: 0 0 auto;
    margin: 0.15rem 0 0 0 !important;
  }

  #box-checkout-customer .emroq-check-row span {
    flex: 1 1 auto;
    min-width: 0;
  }

  #box-checkout-customer .emroq-check-row-large span {
    font-weight: 700;
  }
}

