.oly-bvp-root {
  margin-top: 24px;
}

.oly-bvp-desktop-box {
  border: 1px solid #ececf1;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.oly-bvp-desktop-list {
  display: block;
}

.oly-bvp-desktop-row-shell {
  display: block;
}

.oly-bvp-row-extra {
  display: none;
}

.oly-bvp-desktop-wrap.is-expanded .oly-bvp-row-extra {
  display: block;
}

.oly-bvp-row {
  display: grid;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #f2f2f6;
  background: #fff;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.oly-bvp-row:last-child {
  border-bottom: 0;
}

.oly-bvp-row.is-disabled {
  opacity: 0.58;
}

.oly-bvp-col-main {
  min-width: 0;
}

.oly-bvp-col-price {
  white-space: nowrap;
  justify-self: start;
  font-size: 18px;
  font-weight: 700;
  color: #111;
}

.oly-bvp-col-qty {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.oly-bvp-col-thumb img {
  display: block;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #f1f1f4;
  background: #fff;
  flex: none;
}

.oly-bvp-variation-name {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  color: #1c1d22;
  word-break: break-word;
}

.oly-bvp-col-price .amount,
.oly-bvp-mobile-drawer-price-range .amount,
.oly-bvp-total-price .amount {
  font-weight: 700;
}

.oly-bvp-qty-box {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: stretch;
  border: 1px solid #dfe1e7;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.oly-bvp-qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #fff;
  cursor: pointer;
  line-height: 1;
  color: #333;
  margin: 0;
  padding: 0;
  border-radius: 0;
}

.oly-bvp-qty-btn:hover {
  background: #f8f8fb;
}

.oly-bvp-qty-input {
  display: block;
  border: 0;
  border-left: 1px solid #ececf1;
  border-right: 1px solid #ececf1;
  text-align: center;
  margin: 0;
  background: #fff;
  -moz-appearance: textfield;
}

.oly-bvp-qty-input::-webkit-outer-spin-button,
.oly-bvp-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.oly-bvp-unavailable {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  color: #c62828;
}

.oly-bvp-unavailable.is-inline {
  margin-top: 0;
}

.oly-bvp-more-wrap {
  display: flex;
  justify-content: flex-start;
  padding: 0 16px 16px;
  border-top: 1px solid #f2f2f6;
  background: #fff;
}

.oly-bvp-more-toggle {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--theme-palette-color-1);
  cursor: pointer;
}

.oly-bvp-submit-form {
  margin: 16px 0 0;
}

.oly-bvp-submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #ececf1;
  border-radius: 16px;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.oly-bvp-totals {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.oly-bvp-total-items,
.oly-bvp-total-price {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  color: #111;
}

.oly-bvp-total-items-num {
  color: var(--theme-palette-color-1);
}

.oly-bvp-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}

.oly-bvp-submit-btn:hover {
  background: #7d6947;
}

.oly-bvp-submit-btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.oly-bvp-mobile-preview,
.oly-bvp-mobile-trigger-bar,
.oly-bvp-mobile-drawer,
.oly-bvp-mobile-drawer-overlay {
  display: none;
}

.oly-bvp-root.is-mobile-open .oly-bvp-mobile-drawer-overlay {
  display: block;
  opacity: 1;
  visibility: visible;
}

.oly-bvp-root.is-mobile-open .oly-bvp-mobile-drawer {
  display: flex;
  transform: translateY(0);
}

body.oly-bvp-body-locked {
  overflow: hidden;
}

/* ===== 共用：强制覆盖 Blocksy / Woo 默认样式 ===== */
.single-product div.product .summary .oly-bvp-root,
.single-product div.product .entry-summary .oly-bvp-root {
  width: 100%;
  max-width: 100%;
  clear: both;
}

.single-product div.product .summary .oly-bvp-row,
.single-product div.product .entry-summary .oly-bvp-row {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.single-product div.product .summary .oly-bvp-col-price,
.single-product div.product .entry-summary .oly-bvp-col-price {
  white-space: nowrap !important;
}

.single-product div.product .summary .oly-bvp-col-qty,
.single-product div.product .entry-summary .oly-bvp-col-qty {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
}

.single-product div.product .summary .oly-bvp-submit-btn,
.single-product div.product .entry-summary .oly-bvp-submit-btn,
.single-product div.product .summary .oly-bvp-mobile-open-btn,
.single-product div.product .entry-summary .oly-bvp-mobile-open-btn {
  border-radius: 999px !important;
}

/* =========================
   桌面端
   ========================= */
@media (min-width: 1000px) {
  .oly-bvp-root {
    padding-bottom: 0;
  }

  .oly-bvp-desktop-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .oly-bvp-row {
    grid-template-columns: 72px minmax(0, 1fr) 110px 138px;
    grid-template-areas: "thumb main price qty";
  }

  .oly-bvp-col-thumb {
    grid-area: thumb;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
  }

  .oly-bvp-col-main {
    grid-area: main;
  }

  .oly-bvp-col-price {
    grid-area: price;
  }

  .oly-bvp-col-qty {
    grid-area: qty;
  }

  .oly-bvp-col-thumb img {
    width: 72px;
    height: 72px;
    min-width: 72px;
    max-width: 72px;
  }

  .oly-bvp-qty-box {
    width: 132px;
    height: 40px;
    min-width: 132px;
    max-width: 132px;
  }

  .oly-bvp-qty-btn {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    font-size: 26px;
  }

  .oly-bvp-qty-input {
    flex: 1 1 auto;
    width: 52px;
    height: 40px;
    min-width: 0;
    max-width: none;
    padding: 0 6px;
    font-size: 17px;
  }

  .oly-bvp-submit-btn {
    min-width: 240px;
    height: 52px;
    padding: 0 22px;
    background: var(--theme-palette-color-1);
    font-size: 17px;
  }

  .single-product div.product .summary .oly-bvp-desktop-wrap,
  .single-product div.product .entry-summary .oly-bvp-desktop-wrap,
  .single-product div.product .summary .oly-bvp-submit-form,
  .single-product div.product .entry-summary .oly-bvp-submit-form {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .single-product div.product .summary .oly-bvp-row,
  .single-product div.product .entry-summary .oly-bvp-row {
    display: grid !important;
  }

  .single-product div.product .summary .oly-bvp-col-thumb,
  .single-product div.product .entry-summary .oly-bvp-col-thumb {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
  }

  .single-product div.product .summary .oly-bvp-col-thumb img,
  .single-product div.product .entry-summary .oly-bvp-col-thumb img {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    object-fit: cover !important;
    display: block !important;
    flex: none !important;
  }

  .single-product div.product .summary .oly-bvp-qty-box,
  .single-product div.product .entry-summary .oly-bvp-qty-box {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: stretch !important;
    width: 132px !important;
    height: 40px !important;
    min-width: 132px !important;
    max-width: 132px !important;
    overflow: hidden !important;
  }

  .single-product div.product .summary .oly-bvp-qty-btn,
  .single-product div.product .entry-summary .oly-bvp-qty-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    border-radius: 0 !important;
  }

  .single-product div.product .summary .oly-bvp-qty-input,
  .single-product div.product .entry-summary .oly-bvp-qty-input {
    display: block !important;
    flex: 1 1 auto !important;
    width: 52px !important;
    height: 40px !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 6px !important;
    text-align: center !important;
  }

  .single-product div.product .summary .oly-bvp-submit-bar,
  .single-product div.product .entry-summary .oly-bvp-submit-bar {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .single-product div.product .summary .oly-bvp-mobile-preview,
  .single-product div.product .entry-summary .oly-bvp-mobile-preview,
  .single-product div.product .summary .oly-bvp-mobile-trigger-bar,
  .single-product div.product .entry-summary .oly-bvp-mobile-trigger-bar,
  .single-product div.product .summary .oly-bvp-mobile-drawer,
  .single-product div.product .entry-summary .oly-bvp-mobile-drawer,
  .single-product div.product .summary .oly-bvp-mobile-drawer-overlay,
  .single-product div.product .entry-summary .oly-bvp-mobile-drawer-overlay {
    display: none !important;
  }
}

/* =========================
   移动端
   ========================= */
@media (max-width: 999px) {
  .oly-bvp-root {
    margin-top: 18px;
    padding-bottom: 0px;
  }

  .oly-bvp-desktop-wrap {
    display: none;
  }

  .oly-bvp-mobile-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid #efeff3;
    border-bottom: 1px solid #efeff3;
    cursor: pointer;
  }

  .oly-bvp-mobile-preview-images {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .oly-bvp-mobile-preview-image {
    display: inline-flex;
  }

  .oly-bvp-mobile-preview-image img {
    width: 68px;
    height: 68px;
    display: block;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #f1f1f4;
    background: #fff;
  }

  .oly-bvp-mobile-preview-text {
    flex: 0 0 auto;
    max-width: 128px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    color: #111;
    text-align: left;
  }

  .oly-bvp-mobile-preview-count {
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .oly-bvp-mobile-trigger-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
  }

  .oly-bvp-mobile-open-btn {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: var(--theme-palette-color-1);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
  }

  .oly-bvp-mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease;
  }

  .oly-bvp-mobile-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: #fff;
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
    transition: 0.25s ease;
    max-height: 86vh;
    flex-direction: column;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.16);
  }

  .oly-bvp-mobile-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #efeff3;
  }

  .oly-bvp-mobile-drawer-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .oly-bvp-mobile-drawer-thumb img {
    width: 72px;
    height: 72px;
    display: block;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #f1f1f4;
    background: #fff;
  }

  .oly-bvp-mobile-drawer-summary {
    min-width: 0;
  }

  .oly-bvp-mobile-drawer-price-range {
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
    color: #111;
  }

  .oly-bvp-mobile-drawer-subtitle {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: #666;
  }

  .oly-bvp-mobile-close-btn {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    padding: 0;
    color: #333;
    cursor: pointer;
  }

  .oly-bvp-mobile-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 0 8px;
  }

  .oly-bvp-mobile-drawer .oly-bvp-row {
    grid-template-columns: 64px minmax(0, 1fr) 124px;
    grid-template-areas:
      "thumb main qty"
      "thumb price qty";
    gap: 8px 12px;
    padding: 14px 16px;
  }

  .oly-bvp-mobile-drawer .oly-bvp-col-thumb {
    grid-area: thumb;
    width: 64px;
    min-width: 64px;
    max-width: 64px;
  }

  .oly-bvp-mobile-drawer .oly-bvp-col-main {
    grid-area: main;
    align-self: end;
  }

  .oly-bvp-mobile-drawer .oly-bvp-col-price {
    grid-area: price;
    align-self: start;
    font-size: 16px;
  }

  .oly-bvp-mobile-drawer .oly-bvp-col-qty {
    grid-area: qty;
    align-self: center;
    justify-content: flex-end;
  }

  .oly-bvp-mobile-drawer .oly-bvp-col-thumb img {
    width: 64px;
    height: 64px;
    min-width: 64px;
    max-width: 64px;
  }

  .oly-bvp-mobile-drawer .oly-bvp-variation-name {
    font-size: 14px;
    line-height: 1.45;
  }

  .oly-bvp-mobile-drawer .oly-bvp-qty-box {
    width: 116px;
    height: 38px;
    min-width: 116px;
    max-width: 116px;
  }

  .oly-bvp-mobile-drawer .oly-bvp-qty-btn {
    flex: 0 0 36px;
    width: 36px;
    height: 38px;
    min-width: 36px;
    max-width: 36px;
    font-size: 22px;
  }

  .oly-bvp-mobile-drawer .oly-bvp-qty-input {
    flex: 1 1 auto;
    width: 44px;
    height: 38px;
    min-width: 0;
    max-width: none;
    padding: 0 6px;
    font-size: 16px;
  }

  .oly-bvp-mobile-drawer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #efeff3;
    background: #fff;
  }

  .oly-bvp-mobile-drawer-footer .oly-bvp-totals {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .oly-bvp-mobile-drawer-footer .oly-bvp-total-items,
  .oly-bvp-mobile-drawer-footer .oly-bvp-total-price {
    font-size: 15px;
  }

  .oly-bvp-mobile-drawer-footer .oly-bvp-submit-btn {
    min-width: 160px;
    height: 48px;
    padding: 0 18px;
    background: var(--theme-palette-color-1);
    font-size: 16px;
  }

  .single-product div.product .summary .oly-bvp-desktop-wrap,
  .single-product div.product .entry-summary .oly-bvp-desktop-wrap {
    display: none !important;
  }

  .single-product div.product .summary .oly-bvp-mobile-preview,
  .single-product div.product .entry-summary .oly-bvp-mobile-preview {
    display: flex !important;
  }

  .single-product div.product .summary .oly-bvp-mobile-trigger-bar,
  .single-product div.product .entry-summary .oly-bvp-mobile-trigger-bar {
    display: flex !important;
  }

  .single-product div.product .summary .oly-bvp-mobile-drawer .oly-bvp-col-thumb,
  .single-product div.product .entry-summary .oly-bvp-mobile-drawer .oly-bvp-col-thumb {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
  }

  .single-product div.product .summary .oly-bvp-mobile-drawer .oly-bvp-col-thumb img,
  .single-product div.product .entry-summary .oly-bvp-mobile-drawer .oly-bvp-col-thumb img {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
  }

  .single-product div.product .summary .oly-bvp-mobile-drawer .oly-bvp-qty-box,
  .single-product div.product .entry-summary .oly-bvp-mobile-drawer .oly-bvp-qty-box {
    width: 116px !important;
    height: 38px !important;
    min-width: 116px !important;
    max-width: 116px !important;
  }

  .single-product div.product .summary .oly-bvp-mobile-drawer .oly-bvp-qty-btn,
  .single-product div.product .entry-summary .oly-bvp-mobile-drawer .oly-bvp-qty-btn {
    flex-basis: 36px !important;
    width: 36px !important;
    height: 38px !important;
    min-width: 36px !important;
    max-width: 36px !important;
  }

  .single-product div.product .summary .oly-bvp-mobile-drawer .oly-bvp-qty-input,
  .single-product div.product .entry-summary .oly-bvp-mobile-drawer .oly-bvp-qty-input {
    width: 44px !important;
    height: 38px !important;
  }
}

@media (max-width: 999px) {
  .single-product .entry-summary .oly-bvp-root + .ct-product-divider,
  .single-product .entry-summary .oly-bvp-root + .ct-product-divider + .ct-product-divider {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
  }
}

/* =========================
   Toast + 按钮态反馈
   ========================= */

.oly-bvp-toast-layer {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.oly-bvp-toast {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(92vw, 420px);
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(18, 18, 22, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.oly-bvp-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.oly-bvp-toast.is-hiding {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.oly-bvp-submit-btn.is-loading {
  opacity: 0.9 !important;
  cursor: progress !important;
}

@media (max-width: 999px) {
  .oly-bvp-toast-layer {
    bottom: 76px;
  }
}
