/* Sticky Cart Styles */

/* 固定在底部的购买按钮栏 - 移动端始终显示 */
.sticky-cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 999;
}
.sticky-cart-bar button {
    flex: 1
  }

.sticky-cart-bar__btn {
  flex: 1;
  height: 48px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.sticky-cart-bar__btn--secondary {
  background: #fff;
  color: var(--genstore-brand-1000);
  border: 1px solid var(--genstore-brand-1000);
}

.sticky-cart-bar__btn--secondary:hover {
  background: var(--genstore-brand-50, #f5f3ff);
}

.sticky-cart-bar__btn--primary {
  background: var(--genstore-brand-500, #7c3aed);
  color: #fff;
}

.sticky-cart-bar__btn--primary:hover {
  background: var(--genstore-brand-600, #6d28d9);
}

/* 桌面端隐藏底部固定栏 */
@media (min-width: 768px) {
  .sticky-cart-bar {
    display: none !important;
  }
}

/* 蒙层 */
.sticky-cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: background-color 0.3s ease;
  pointer-events: none;
}

.sticky-cart-overlay--open {
  background-color: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

/* 弹窗 */
.sticky-cart-modal {
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 75vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.sticky-cart-overlay--open .sticky-cart-modal {
  transform: translateY(0);
}

/* 头部 */
.sticky-cart-modal__header {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.sticky-cart-modal__close {
  top: 0;
  right: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  padding: 0;
}

.sticky-cart-modal__close .svg-wrapper {
    width: 16px;
    height: 16px;
  }

/* 内容区 */
.sticky-cart-modal__content {
  padding: 16px;
}

/* 产品信息 */
.sticky-cart-modal__product {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  position: relative;
}

.sticky-cart-modal__image {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

.sticky-cart-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sticky-cart-modal__info {
  flex: 1;
  min-width: 0;
}

.sticky-cart-modal__title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sticky-cart-modal__price {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sticky-cart-modal__price-current {
  font-size: 18px;
  font-weight: 700;
  color: #000;
}

.sticky-cart-modal__price-compare {
  font-size: 14px;
  color: #999;
  text-decoration: line-through;
}

/* 规格选择器 - 使用Liquid渲染的product-variant-picker */
.sticky-cart-modal__variants {
  margin-bottom: 16px;
}

.sticky-cart-modal__variants .product-variant-picker {
  display: flex;
  flex-direction: column;
  padding-top: 0;
  padding-bottom: 0;
}

.sticky-cart-modal__variants .product-form__input {
  margin: 0;
  padding: 0;
  border: none;
}

.sticky-cart-modal__variants .product-form__input legend {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  padding: 0;
}

/* 数量选择器 - 使用Liquid渲染的genstore-quantity-input */
.sticky-cart-modal__quantity {
  padding: 0;
}

.sticky-cart-modal__quantity-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  display: block;
  margin-bottom: 12px;
}

.sticky-cart-modal__quantity .product-form__quantity {
  margin: 0;
  padding: 0;
}

/* 底部按钮 */
.sticky-cart-modal__footer {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-top: 1px solid #eee;
  position: sticky;
  bottom: 0;
}
.sticky-cart-modal__footer button {
    flex: 1
  }

.sticky-cart-modal__btn {
  flex: 1;
  height: 48px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}


/* 桌面端适配 */
@media (min-width: 768px) {
  .sticky-cart-overlay {
    align-items: center;
  }

  .sticky-cart-modal {
    border-radius: 16px;
    max-width: 480px;
    max-height: 720px;
    transform: translateY(20px);
    opacity: 0;
  }

  .sticky-cart-overlay--open .sticky-cart-modal {
    transform: translateY(0);
    opacity: 1;
  }
}