/* Mobile bottom add-to-cart drawer
 * Version: 1.0.0
 * Updated: 2026-02-17
 */

#emaura-mbc {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 498;
  pointer-events: none;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  display: none;
  --emaura-mbc-btn-color: var(--btn-accented-bgcolor, var(--wd-primary-color, #0f1115));
}

#emaura-mbc,
#emaura-mbc * {
  box-sizing: border-box;
}

#emaura-mbc .emaura-mbc__bar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border-top: 1px solid #ececec;
  box-shadow: 0 -10px 30px rgba(15, 17, 21, 0.12);
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  pointer-events: auto;
}

#emaura-mbc .emaura-mbc__media {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 44px;
  gap: 6px;
  align-self: flex-start;
}

#emaura-mbc .emaura-mbc__thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e6e6e6;
}

#emaura-mbc .emaura-mbc__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#emaura-mbc .emaura-mbc__info {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

#emaura-mbc .emaura-mbc__title {
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
  color: #111318;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#emaura-mbc .emaura-mbc__selection {
  display: none;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  color: #23417f;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef3ff;
  border: 1px solid #dce7ff;
}

#emaura-mbc .emaura-mbc__selection.is-visible {
  display: block;
}

#emaura-mbc .emaura-mbc__price {
  font-size: 12px;
  font-weight: 700;
  color: #0f1115;
}

#emaura-mbc .emaura-mbc__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

#emaura-mbc .emaura-mbc__qty-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  order: 2;
}

#emaura-mbc .emaura-mbc__qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e7ebf2;
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
  vertical-align: middle;
}

#emaura-mbc .emaura-mbc__qty-btn {
  width: 20px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2e3441;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border: 0;
  background: transparent;
  padding: 0;
  position: relative;
  font-size: 0;
  line-height: 1;
}

#emaura-mbc .emaura-mbc__qty-btn:active {
  background: #f3f5f9;
}

#emaura-mbc .emaura-mbc__qty-btn::after {
  content: "";
  width: 8px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#emaura-mbc .emaura-mbc__qty-btn[data-dir="1"]::before {
  content: "";
  width: 1.5px;
  height: 8px;
  background: currentColor;
  border-radius: 2px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#emaura-mbc .emaura-mbc__qty-display {
  min-width: 20px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #e8ebf1;
  border-right: 1px solid #e8ebf1;
  background: #fff;
  color: #0f1115;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-family: Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  user-select: none;
  padding: 0;
}

#emaura-mbc .emaura-mbc__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  order: 1;
  margin: 0;
  background: transparent;
  color: var(--emaura-mbc-btn-color);
  border: 1px solid var(--emaura-mbc-btn-color);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 700;
  min-width: 124px;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.2s ease;
}

#emaura-mbc .emaura-mbc__cta:hover {
  background: transparent;
  color: var(--emaura-mbc-btn-color);
  border-color: var(--emaura-mbc-btn-color);
}

#emaura-mbc .emaura-mbc__form .single_add_to_cart_button {
  background: transparent;
  color: var(--emaura-mbc-btn-color);
  border: 1px solid var(--emaura-mbc-btn-color);
  box-shadow: none;
}

#emaura-mbc .emaura-mbc__form .single_add_to_cart_button:hover,
#emaura-mbc .emaura-mbc__form .single_add_to_cart_button:focus {
  background: transparent;
  color: var(--emaura-mbc-btn-color);
  border-color: var(--emaura-mbc-btn-color);
  box-shadow: none;
}

#emaura-mbc .emaura-mbc__cta:active {
  transform: translateY(1px);
}

#emaura-mbc .emaura-mbc__sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateY(105%);
  transition: transform 0.26s ease, opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

#emaura-mbc .emaura-mbc__sheet-inner {
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 40px rgba(12, 15, 25, 0.18);
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px));
}

#emaura-mbc .emaura-mbc__sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

#emaura-mbc .emaura-mbc__sheet-head-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#emaura-mbc .emaura-mbc__sheet-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f1115;
  line-height: 1.3;
}

#emaura-mbc .emaura-mbc__sheet-attr-name {
  display: none;
  font-size: 12px;
  font-weight: 600;
  color: #5f78ab;
  line-height: 1.25;
}

#emaura-mbc .emaura-mbc__sheet-attr-name.is-visible {
  display: block;
}

#emaura-mbc .emaura-mbc__limit-notice {
  display: none;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(24, 42, 148, 0.18);
  background: #eef3ff;
  color: #23417f;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

#emaura-mbc .emaura-mbc__limit-notice.is-visible {
  display: block;
}

#emaura-mbc .emaura-mbc__close {
  background: transparent;
  border: 1px solid #e4e6eb;
  color: #13151a;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

#emaura-mbc .emaura-mbc__form .variations_form {
  margin-bottom: 8px;
}

#emaura-mbc .emaura-mbc__form table.variations th.label,
#emaura-mbc .emaura-mbc__form table.variations th.label.cell {
  display: none;
}

#emaura-mbc .emaura-mbc__form table.variations td.value,
#emaura-mbc .emaura-mbc__form table.variations td.value.cell {
  width: 100%;
  display: block;
}

#emaura-mbc .emaura-mbc__overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.38);
  opacity: 0;
  transition: opacity 0.24s ease;
  pointer-events: none;
  z-index: 1;
}

#emaura-mbc.is-open .emaura-mbc__sheet {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#emaura-mbc.is-open .emaura-mbc__overlay {
  opacity: 1;
  pointer-events: auto;
}

body.emaura-mbc-lock {
  overflow: hidden;
  touch-action: none;
}

@media (min-width: 1024px) {
  #emaura-mbc {
    display: none;
  }
}

@media (max-width: 1023px) {
  body.single-product #emaura-mbc {
    display: block;
  }

  body.single-product form.variations_form.cart.emaura-mbc-main-form .woocommerce-variation-add-to-cart {
    display: none !important;
  }
}

@media (max-width: 560px) {
  #emaura-mbc .emaura-mbc__media {
    grid-auto-columns: 40px;
    gap: 4px;
  }

  #emaura-mbc .emaura-mbc__cta {
    min-width: 110px;
    padding: 10px 12px;
    font-size: 13px;
  }

  #emaura-mbc .emaura-mbc__qty-btn {
    width: 18px;
    height: 20px;
  }

  #emaura-mbc .emaura-mbc__qty-display {
    min-width: 18px;
    height: 20px;
    font-size: 11px;
  }
}
