.mzbis {
  margin: 16px 0 20px;
  max-width: 520px;
}

.mzbis,
.mzbis * {
  box-sizing: border-box;
}

.mzbis__form {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #f73030;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
}

.mzbis__form[hidden] {
  display: none;
}

.mzbis__intro {
  display: grid;
  gap: 5px;
}

.mzbis__badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #bb1f1f;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mzbis__badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f73030;
}

.mzbis__heading {
  color: #262626;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.mzbis__text {
  color: #737373;
  font-size: 13px;
  line-height: 1.45;
}

.mzbis__controls,
.mzbis__subscribed {
  display: grid;
  gap: 12px;
}

.mzbis__controls[hidden],
.mzbis__subscribed[hidden] {
  display: none;
}

.mzbis__destination {
  padding: 10px 12px;
  border: 1px solid #fde2e2;
  border-radius: 6px;
  background: #fff7f7;
  color: #575b63;
  font-size: 13px;
  line-height: 1.45;
}

.mzbis__destination strong {
  color: #262626;
  font-weight: 800;
}

.mzbis__fields {
  display: grid;
  gap: 8px;
}

.mzbis__form input[type="text"],
.mzbis__form input[type="email"],
.mzbis__form input[type="tel"],
.mzbis__form input[type="number"] {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d9dde3;
  border-radius: 6px;
  background: #fbfbfc;
  color: #262626;
  font-size: 14px;
  line-height: 1.3;
  box-shadow: none;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.mzbis__form input[type="text"]::placeholder,
.mzbis__form input[type="email"]::placeholder,
.mzbis__form input[type="tel"]::placeholder,
.mzbis__form input[type="number"]::placeholder {
  color: #8a8f98;
}

.mzbis__form input[type="text"]:focus,
.mzbis__form input[type="email"]:focus,
.mzbis__form input[type="tel"]:focus,
.mzbis__form input[type="number"]:focus {
  border-color: #f73030;
  background: #fff;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(247, 48, 48, 0.12);
}

.mzbis .mzbis__submit.button,
.mzbis .mzbis__submit.button.alt,
.mzbis .mzbis__toggle.button {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: #f73030;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 44px;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 8px 16px rgba(247, 48, 48, 0.18);
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.mzbis .mzbis__submit.button:hover,
.mzbis .mzbis__submit.button:focus,
.mzbis .mzbis__submit.button.alt:hover,
.mzbis .mzbis__submit.button.alt:focus,
.mzbis .mzbis__toggle.button:hover,
.mzbis .mzbis__toggle.button:focus {
  background: #d91f1f;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(217, 31, 31, 0.22);
}

.mzbis .mzbis__submit.button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
  box-shadow: none;
}

.mzbis .mzbis__account-link.button {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: #262626;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 44px;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 8px 16px rgba(38, 38, 38, 0.14);
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.mzbis .mzbis__account-link.button:hover,
.mzbis .mzbis__account-link.button:focus {
  background: #171717;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(38, 38, 38, 0.2);
}

.mzbis__check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  color: #575b63;
  font-size: 13px;
  line-height: 1.45;
}

.mzbis__check input {
  margin-top: 2px;
}

.mzbis__trap {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.mzbis__message {
  min-height: 0;
  color: #575b63;
  font-size: 13px;
  line-height: 1.45;
}

.mzbis__message:not(:empty) {
  padding: 9px 11px;
  border-radius: 6px;
}

.mzbis__message.is-success {
  background: #f0f9f2;
  color: #176b2c;
}

.mzbis__message.is-error {
  background: #fff1f1;
  color: #b32d2e;
}

.mzbis__guest-message {
  margin: 14px 0;
  padding: 10px 12px;
  border-left: 4px solid #f73030;
  border-radius: 6px;
  background: #fff7f5;
  color: #4d4d4d;
}

@media (min-width: 520px) {
  .mzbis__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mzbis__fields input:only-child {
    grid-column: 1 / -1;
  }

  .mzbis__fields input[type="email"]:last-child:nth-child(2n + 1),
  .mzbis__fields input[type="tel"]:last-child:nth-child(2n + 1),
  .mzbis__fields input[type="number"]:last-child:nth-child(2n + 1) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 519px) {
  .mzbis {
    max-width: none;
  }

  .mzbis__form {
    padding: 15px;
  }
}

.mzbis-account,
.mzbis-account * {
  box-sizing: border-box;
}

.mzbis-account {
  display: grid;
  gap: 18px;
  color: #262626;
}

.mzbis-account__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mzbis-account__header h2 {
  margin: 0 0 6px;
  color: #202124;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.mzbis-account__header p,
.mzbis-account__empty p {
  max-width: 680px;
  margin: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.55;
}

.mzbis-account-add {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.mzbis-account-add__head {
  display: grid;
  gap: 5px;
}

.mzbis-account-add__head h3 {
  margin: 0;
  color: #202124;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.mzbis-account-add__head p {
  max-width: 680px;
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
}

.mzbis-account-add__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  margin: 0;
}

.mzbis-account-add__form [data-mzbis-search-input] {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d9dde3;
  border-radius: 6px;
  background: #fbfbfc;
  color: #262626;
  font-size: 14px;
  line-height: 1.3;
  box-shadow: none;
}

.mzbis-account-add__form [data-mzbis-search-input]:focus {
  border-color: #f73030;
  background: #fff;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(247, 48, 48, 0.12);
}

.mzbis-account-add__message {
  min-height: 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
}

.mzbis-account-add__message:not(:empty) {
  padding: 9px 11px;
  border-radius: 6px;
  background: #f9fafb;
}

.mzbis-account-add__message.is-success {
  background: #f0fdf4;
  color: #166534;
}

.mzbis-account-add__message.is-error {
  background: #fef2f2;
  color: #991b1b;
}

.mzbis-account-add__results {
  display: grid;
  gap: 8px;
}

.mzbis-account-add-result {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 128px;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #eef0f2;
  border-radius: 8px;
  background: #fbfbfc;
  cursor: pointer;
}

.mzbis-account-add-result.is-in-monitor {
  cursor: default;
}

.mzbis-account-add-result__media {
  display: block;
}

.mzbis-account-add-result__media img {
  display: block;
  width: 58px;
  height: 58px;
  border: 1px solid #eef0f2;
  border-radius: 6px;
  background: #fff;
  object-fit: cover;
}

.mzbis-account-add-result__main {
  min-width: 0;
}

.mzbis-account-add-result__title {
  display: block;
  color: #202124;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.mzbis-account-add-result__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-top: 6px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.35;
}

.mzbis-account-add-result__button:disabled {
  cursor: default;
  opacity: 0.68;
}

.mzbis-account__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.mzbis-account__stat {
  min-height: 82px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.mzbis-account__stat strong {
  display: block;
  color: #202124;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.mzbis-account__stat span {
  display: block;
  margin-top: 8px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mzbis-account__stat--instock {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.mzbis-account__stat--outofstock {
  border-color: #fecaca;
  background: #fff7f7;
}

.mzbis-account__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.mzbis-account__controls[hidden],
.mzbis-account__empty[hidden],
.mzbis-account__list[hidden],
.mzbis-account-item[hidden] {
  display: none !important;
}

.mzbis-account__filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mzbis-account-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 900;
  line-height: 36px;
  letter-spacing: 0;
  text-transform: uppercase;
  cursor: pointer;
}

.mzbis-account-filter:hover,
.mzbis-account-filter:focus {
  border-color: #9ca3af;
  background: #f9fafb;
  color: #111827;
}

.mzbis-account-filter.is-active {
  border-color: #262626;
  background: #262626;
  color: #fff;
}

.mzbis-account__sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mzbis-account__sort select {
  min-height: 36px;
  margin: 0;
  padding: 0 34px 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #fff;
  color: #262626;
  font-size: 13px;
  font-weight: 700;
  line-height: 36px;
  box-shadow: none;
}

.mzbis-account__sort select:focus {
  border-color: #f73030;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(247, 48, 48, 0.12);
}

.mzbis-account__list {
  display: grid;
  gap: 12px;
}

.mzbis-account-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.mzbis-account-item__media img,
.mzbis-account-item__placeholder {
  display: block;
  width: 86px;
  height: 86px;
  border: 1px solid #eef0f2;
  border-radius: 8px;
  background: #f7f7f8;
  object-fit: cover;
}

.mzbis-account-item__main {
  min-width: 0;
}

.mzbis-account-item__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mzbis-account-item h3 {
  margin: 0;
  color: #202124;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.mzbis-account-item h3 a {
  color: inherit;
  text-decoration: none;
}

.mzbis-account-item h3 a:hover {
  color: #f73030;
}

.mzbis-account-item__meta,
.mzbis-account-item__details {
  margin-top: 8px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
}

.mzbis-account-item__details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.mzbis-account-badge,
.mzbis-account-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.mzbis-account-badge--instock {
  background: #dcfce7;
  color: #166534;
}

.mzbis-account-badge--outofstock {
  background: #fee2e2;
  color: #991b1b;
}

.mzbis-account-badge--backorder {
  background: #fef3c7;
  color: #92400e;
}

.mzbis-account-badge--missing {
  background: #f3f4f6;
  color: #4b5563;
}

.mzbis-account-status {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #374151;
  font-size: inherit;
}

.mzbis-account-status--subscribed {
  color: #166534;
}

.mzbis-account-status--mail_sent,
.mzbis-account-status--purchased {
  color: #1d4ed8;
}

.mzbis-account-status--mail_failed {
  color: #b45309;
}

.mzbis-account-status--unsubscribed {
  color: #6b7280;
}

.mzbis-account-item__actions {
  display: grid;
  gap: 8px;
  min-width: 170px;
}

.mzbis-account-item__actions form {
  margin: 0;
}

.woocommerce .mzbis-account-button.button,
.mzbis-account-button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #f73030;
  border-radius: 6px;
  background: #f73030;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 38px;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
}

.woocommerce .mzbis-account-button.button:hover,
.woocommerce .mzbis-account-button.button:focus,
.mzbis-account-button.button:hover,
.mzbis-account-button.button:focus {
  background: #d91f1f;
  border-color: #d91f1f;
  color: #fff;
}

.woocommerce .mzbis-account-button--secondary.button,
.mzbis-account-button--secondary.button {
  background: #fff;
  color: #b91c1c;
}

.woocommerce .mzbis-account-button--secondary.button:hover,
.woocommerce .mzbis-account-button--secondary.button:focus,
.mzbis-account-button--secondary.button:hover,
.mzbis-account-button--secondary.button:focus {
  background: #fff5f5;
  border-color: #b91c1c;
  color: #991b1b;
}

.woocommerce .mzbis-account-button--danger.button,
.mzbis-account-button--danger.button {
  background: #fff;
  border-color: #d1d5db;
  color: #4b5563;
}

.woocommerce .mzbis-account-button--danger.button:hover,
.woocommerce .mzbis-account-button--danger.button:focus,
.mzbis-account-button--danger.button:hover,
.mzbis-account-button--danger.button:focus {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
}

.mzbis-account__empty {
  padding: 22px;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  background: #fbfbfc;
}

.mzbis-account__empty h3 {
  margin: 0 0 6px;
  color: #202124;
  font-size: 18px;
  font-weight: 800;
}

.mzbis-account-notice {
  padding: 11px 13px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.mzbis-account-notice--success {
  background: #f0fdf4;
  color: #166534;
}

.mzbis-account-notice--error {
  background: #fef2f2;
  color: #991b1b;
}

@media (max-width: 800px) {
  .mzbis-account__controls {
    align-items: stretch;
    flex-direction: column;
  }

  .mzbis-account__sort {
    justify-content: space-between;
  }

  .mzbis-account-add-result {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .mzbis-account-add-result__button {
    grid-column: 1 / -1;
  }

  .mzbis-account-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .mzbis-account-item__media img,
  .mzbis-account-item__placeholder {
    width: 72px;
    height: 72px;
  }

  .mzbis-account-item__actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .mzbis-account-add__form {
    grid-template-columns: 1fr;
  }

  .mzbis-account__filter {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mzbis-account__sort {
    display: grid;
    gap: 6px;
  }

  .mzbis-account__sort select {
    width: 100%;
  }

  .mzbis-account__stats {
    grid-template-columns: 1fr;
  }

  .mzbis-account-item {
    grid-template-columns: 1fr;
  }

  .mzbis-account-item__media img,
  .mzbis-account-item__placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .mzbis-account-item__title-row,
  .mzbis-account-item__actions {
    grid-template-columns: 1fr;
  }

  .mzbis-account-item__title-row {
    display: grid;
  }
}
