.bhm-fb-widget,
.bhm-fb-widget * {
  box-sizing: border-box;
}

.bhm-fb-widget {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #3b2b1c;
}

.bhm-fb-widget.bhm-fb-pos-left {
  left: 24px;
  right: auto;
}

.bhm-fb-widget.bhm-fb-pos-right {
  right: 24px;
  left: auto;
}

.bhm-fb-tab {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  min-height: 130px;
  border: none;
  border-radius: 16px 0 0 16px;
  background: linear-gradient(180deg, #8a5725, #5f3819);
  color: #fff;
  box-shadow: 0 12px 28px rgba(65, 39, 18, .22);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 2px;
}

.bhm-fb-widget.bhm-fb-pos-left .bhm-fb-tab {
  left: 0;
  right: auto;
  border-radius: 0 16px 16px 0;
}

.bhm-fb-widget.bhm-fb-pos-right .bhm-fb-tab {
  right: 0;
  left: auto;
}

.bhm-fb-tab span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.bhm-fb-panel {
  width: 285px;
  max-width: calc(100vw - 36px);
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 252, 246, .96);
  border: 1px solid rgba(166, 111, 45, .22);
  box-shadow: 0 22px 55px rgba(58, 36, 17, .22);
  backdrop-filter: blur(10px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.bhm-fb-widget.is-collapsed .bhm-fb-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px) scale(.98);
  pointer-events: none;
}

.bhm-fb-widget.bhm-fb-pos-left.is-collapsed .bhm-fb-panel {
  transform: translateX(-20px) scale(.98);
}

.bhm-fb-widget.is-collapsed .bhm-fb-tab {
  display: block;
}

.bhm-fb-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px 11px;
  color: #fff;
  background: radial-gradient(circle at 20% 10%, rgba(230, 176, 91, .42), transparent 34%), linear-gradient(135deg, #6e431d, #9a6730);
}

.bhm-fb-head strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: .4px;
}

.bhm-fb-head p {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .86);
}

.bhm-fb-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  line-height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
}

.bhm-fb-form {
  padding: 12px 14px 13px;
}

.bhm-fb-form label {
  display: block;
  margin: 0 0 7px;
}

.bhm-fb-form span {
  display: block;
  margin-bottom: 4px;
  color: #7b542e;
  font-size: 11px;
  font-weight: 700;
}

.bhm-fb-form em {
  color: #b5442d;
  font-style: normal;
}

.bhm-fb-form input,
.bhm-fb-form select,
.bhm-fb-form textarea {
  display: block;
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(138, 92, 44, .22);
  border-radius: 10px;
  background: #fff;
  color: #3b2b1c;
  padding: 7px 9px;
  font-size: 13px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.bhm-fb-form textarea {
  min-height: 46px;
  resize: vertical;
}

.bhm-fb-form input:focus,
.bhm-fb-form select:focus,
.bhm-fb-form textarea:focus {
  border-color: rgba(154, 103, 48, .72);
  box-shadow: 0 0 0 3px rgba(201, 149, 78, .14);
}

.bhm-fb-row {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
}

.bhm-fb-submit {
  display: block;
  width: 100%;
  min-height: 36px;
  margin-top: 4px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #d8a45a, #9a6730);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .5px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(154, 103, 48, .22);
}

.bhm-fb-submit:disabled {
  opacity: .68;
  cursor: wait;
}

.bhm-fb-note {
  margin: 6px 0 0;
  color: #9b7a58;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.bhm-fb-result {
  display: none;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.bhm-fb-result.is-ok {
  display: block;
  background: #f3eadb;
  color: #6a431e;
}

.bhm-fb-result.is-error {
  display: block;
  background: #fff0ef;
  color: #a23c2a;
}

.bhm-fb-hp {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 1024px) {
  .bhm-fb-widget.bhm-fb-hide-mobile {
    display: none !important;
  }

  .bhm-fb-widget {
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
  }

  .bhm-fb-widget.bhm-fb-pos-right {
    right: 10px !important;
    left: auto !important;
  }

  .bhm-fb-widget.bhm-fb-pos-left {
    left: 10px !important;
    right: auto !important;
  }

  .bhm-fb-panel {
    width: 280px;
    max-width: calc(100vw - 24px);
    max-height: 86vh;
    overflow-y: auto;
    border-radius: 18px;
  }

  .bhm-fb-tab {
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    width: 44px;
    min-height: 118px;
    min-width: 0;
    padding: 0;
  }

  .bhm-fb-widget.bhm-fb-pos-right .bhm-fb-tab {
    right: 0 !important;
    left: auto !important;
    border-radius: 16px 0 0 16px;
  }

  .bhm-fb-widget.bhm-fb-pos-left .bhm-fb-tab {
    left: 0 !important;
    right: auto !important;
    border-radius: 0 16px 16px 0;
  }

  .bhm-fb-tab span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 2px;
  }

  .bhm-fb-row {
    grid-template-columns: 1fr 90px;
  }

  .bhm-fb-qty-row {
    grid-template-columns: 1fr 74px;
  }
}

@media (max-width: 480px) {
  .bhm-fb-panel {
    width: 265px;
    max-height: 82vh;
  }

  .bhm-fb-tab {
    width: 42px;
    min-height: 108px;
    font-size: 13px;
  }
}

.bhm-fb-qty-row {
  grid-template-columns: 1fr 74px;
}
