/* Cart Theme - Beidou Design System */

/* Product Grid */
.bd-cart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.bd-product-card {
  position: relative;
}

.bd-product-name {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--bd-text);
}

.bd-product-desc-wrap {
  position: relative;
  margin-bottom: 12px;
}

.bd-product-desc {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  font-size: 14px;
  color: var(--bd-text-2);
  line-height: 1.6;
}

.bd-product-desc.expanded {
  max-height: 500px;
}

.bd-product-desc.collapsed {
  max-height: 0;
}

.bd-product-desc-toggle {
  margin-top: 8px;
  font-size: 13px;
}

.bd-product-stock {
  margin-bottom: 12px;
}

.bd-product-price {
  margin: 16px 0;
}

.bd-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--bd-brand);
}

.bd-price-old {
  text-decoration: line-through;
  color: var(--bd-text-3);
  font-size: 14px;
  margin-right: 8px;
}

.bd-price-sale {
  color: var(--bd-brand);
  font-weight: 700;
}

.bd-price-trial {
  font-size: 13px;
  color: var(--bd-text-2);
  margin-top: 4px;
}

.bd-cycle-name {
  font-size: 14px;
  font-weight: 400;
  color: var(--bd-text-2);
}

/* Cart Navigation */
.bd-cart-nav {
  background: var(--bd-surface);
  border-bottom: 1px solid var(--bd-line);
  padding: 16px 0;
  margin-bottom: 24px;
}

.bd-cart-nav-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.bd-cart-nav-row:last-child {
  margin-bottom: 0;
}

.bd-cart-nav-label {
  font-weight: 600;
  color: var(--bd-text);
  min-width: 80px;
  padding-top: 8px;
}

.bd-cart-nav-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.bd-cart-nav-item {
  padding: 8px 16px;
  background: var(--bd-surface-2);
  border: 1px solid var(--bd-line);
  border-radius: 6px;
  color: var(--bd-text-2);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.bd-cart-nav-item:hover {
  background: var(--bd-surface);
  border-color: var(--bd-brand);
  color: var(--bd-brand);
}

.bd-cart-nav-item.is-active {
  background: var(--bd-brand);
  border-color: var(--bd-brand);
  color: var(--bd-bg);
  font-weight: 600;
}

/* Search Box */
.bd-cart-search {
  margin-bottom: 20px;
}

/* Option Items */
.bd-opt-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.bd-opt-item {
  position: relative;
  padding: 12px 16px;
  background: var(--bd-surface-2);
  border: 1px solid var(--bd-line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.bd-opt-item:hover {
  border-color: var(--bd-brand);
  background: var(--bd-surface);
}

.bd-opt-item input[type="radio"],
.bd-opt-item input[type="checkbox"] {
  margin: 0;
}

.bd-opt-item.is-active {
  background: var(--bd-brand-soft);
  border-color: var(--bd-brand);
  color: var(--bd-brand);
  font-weight: 600;
}

.bd-opt-discount {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--bd-brand);
  color: var(--bd-bg);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.bd-opt-group {
  margin-bottom: 24px;
}

.bd-opt-title {
  font-weight: 600;
  color: var(--bd-text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Range Slider */
.bd-range {
  flex: 1;
  height: 6px;
  background: var(--bd-line);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.bd-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--bd-brand);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bd-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bd-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--bd-brand);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bd-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Summary Card */
.bd-summary {
  position: sticky;
  top: 20px;
}

.bd-summary-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bd-line);
}

.bd-summary-line:last-child {
  border-bottom: none;
}

.bd-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  font-size: 16px;
  font-weight: 600;
  border-top: 2px solid var(--bd-brand);
  margin-top: 12px;
}

.bd-summary-total .bd-money {
  font-size: 24px;
  color: var(--bd-brand);
}

/* Payment Logo */
.bd-pay-logo {
  height: 24px;
  width: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .bd-cart-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .bd-cart-nav-row {
    flex-direction: column;
    gap: 8px;
  }

  .bd-cart-nav-label {
    min-width: auto;
    padding-top: 0;
  }

  .bd-opt-grid {
    flex-direction: column;
  }

  .bd-opt-item {
    min-width: auto;
    width: 100%;
  }

  .bd-summary {
    position: static;
  }
}

@media (max-width: 480px) {
  .bd-cart-grid {
    grid-template-columns: 1fr;
  }

  .bd-product-name {
    font-size: 16px;
  }

  .bd-price {
    font-size: 20px;
  }
}
