.btq-commerce-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0,0,0,.58);
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
}

.btq-commerce-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.btq-product-modal,
.btq-cart-drawer {
  position: fixed;
  z-index: 5100;
  background: #fff;
  color: #111;
  box-shadow: 0 30px 90px rgba(0,0,0,.22);
  opacity: 0;
  pointer-events: none;
  transition: .28s ease;
}

.btq-product-modal {
  left: 50%;
  top: 50%;
  width: min(1080px, calc(100% - 32px));
  max-height: min(840px, calc(100vh - 32px));
  transform: translate(-50%, -48%);
  overflow: hidden;
}

.btq-product-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.btq-product-layout {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  max-height: inherit;
}

.btq-product-gallery {
  background: #f4f4f4;
  min-height: 620px;
  overflow-y: auto;
}

.btq-product-main-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #f4f4f4;
}

.btq-product-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btq-product-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
}

.btq-product-thumbs button {
  border: 0;
  padding: 0;
  background: #eee;
  cursor: pointer;
  opacity: .62;
}

.btq-product-thumbs button.is-active {
  opacity: 1;
}

.btq-product-thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.btq-product-content {
  position: relative;
  padding: clamp(28px, 4vw, 48px);
  overflow-y: auto;
  max-height: inherit;
}

.btq-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #f1f1f1;
  color: #111;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.btq-modal-kicker {
  color: #777;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 14px;
  padding-right: 44px;
}

.btq-product-content h2 {
  font-size: clamp(32px, 4vw, 56px);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 500;
  margin-bottom: 14px;
  padding-right: 38px;
}

.btq-product-desc {
  color: #6f6f6f;
  line-height: 1.7;
  font-size: 14px;
  margin-bottom: 18px;
}

.btq-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 18px 0 22px;
}

.btq-price-now {
  font-size: 18px;
  font-weight: 800;
}

.btq-price-before {
  color: #999;
  font-size: 13px;
  text-decoration: line-through;
}

.btq-option-group {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.btq-option-group label {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 800;
  color: #555;
}

.btq-option-group select,
.btq-option-group input,
.btq-customer-box input,
.btq-customer-box textarea {
  width: 100%;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 0;
  min-height: 48px;
  padding: 0 13px;
  font-size: 14px;
  outline: none;
}

.btq-option-group textarea,
.btq-customer-box textarea {
  min-height: 88px;
  padding: 13px;
  resize: vertical;
}

.btq-qty-row {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 1px;
  border: 1px solid #ddd;
  margin-bottom: 14px;
}

.btq-qty-row button,
.btq-qty-row input {
  border: 0;
  min-height: 48px;
  background: #fff;
  text-align: center;
}

.btq-qty-row button {
  cursor: pointer;
  font-size: 20px;
}

.btq-stock-note {
  min-height: 20px;
  color: #6f6f6f;
  font-size: 13px;
  font-weight: 700;
  margin: 4px 0 18px;
}

.btq-stock-note.is-low {
  color: #b45309;
}

.btq-stock-note.is-empty {
  color: #991b1b;
}

.btq-primary-btn,
.btq-secondary-btn {
  width: 100%;
  min-height: 52px;
  border: 1px solid #111;
  border-radius: 0;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: .22s ease;
}

.btq-primary-btn {
  background: #111;
  color: #fff;
}

.btq-primary-btn:hover {
  background: #fff;
  color: #111;
}

.btq-primary-btn:disabled {
  background: #d6d6d6;
  border-color: #d6d6d6;
  color: #777;
  cursor: not-allowed;
}

.btq-secondary-btn {
  background: #fff;
  color: #111;
  margin-top: 10px;
}

.btq-cart-drawer {
  right: 0;
  top: 0;
  bottom: 0;
  width: min(520px, 100%);
  transform: translateX(100%);
  display: flex;
  flex-direction: column;
}

.btq-cart-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.btq-cart-head {
  min-height: 78px;
  padding: 0 22px;
  border-bottom: 1px solid #e9e9e9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btq-cart-head h3 {
  font-size: 22px;
  letter-spacing: -.03em;
  font-weight: 600;
}

.btq-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
}

.btq-cart-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #e9e9e9;
}

.btq-cart-item img {
  width: 82px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #f3f3f3;
}

.btq-cart-item-title {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
  margin-bottom: 5px;
}

.btq-cart-item-meta {
  color: #666;
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 9px;
}

.btq-cart-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.btq-remove-btn {
  border: 0;
  background: transparent;
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
}

.btq-empty-cart {
  padding: 40px 0;
  color: #666;
  line-height: 1.7;
  font-weight: 600;
}

.btq-customer-box {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
}

.btq-customer-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.btq-customer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btq-customer-grid .full {
  grid-column: 1 / -1;
}

.btq-customer-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #444;
}

.btq-cart-foot {
  border-top: 1px solid #e9e9e9;
  padding: 18px 22px 22px;
  display: grid;
  gap: 12px;
}

.btq-cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 800;
}

.btq-error-box {
  display: none;
  background: #fee2e2;
  color: #991b1b;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.btq-error-box.is-visible {
  display: block;
}

.btq-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 7000;
  transform: translateX(-50%) translateY(16px);
  background: #111;
  color: #fff;
  padding: 12px 15px;
  max-width: min(420px, calc(100% - 30px));
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
}

.btq-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.btq-commerce-open {
  overflow: hidden;
}

@media (max-width: 820px) {
  .btq-product-modal {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 92dvh;
    transform: translateY(100%);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .btq-product-modal.is-open {
    transform: translateY(0);
  }

  .btq-product-layout {
    display: block;
    max-height: none;
  }

  .btq-product-gallery {
    min-height: auto;
    max-height: none;
    overflow: visible;
  }

  .btq-product-main-image {
    aspect-ratio: 4 / 4.15;
    max-height: 43vh;
  }

  .btq-product-content {
    max-height: none;
    overflow: visible;
    padding: 24px 18px max(34px, calc(env(safe-area-inset-bottom) + 28px));
  }

  .btq-product-content h2 {
    font-size: 32px;
  }

  .btq-cart-drawer {
    width: 100%;
  }

  .btq-customer-grid {
    grid-template-columns: 1fr;
  }

  .btq-customer-grid .full {
    grid-column: auto;
  }
}