/* The cart panel (./cart.js). */

.cart-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cart-line {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.cart-line__photo {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: var(--media-radius);
  overflow: hidden;
  --flux-skeleton-radius: var(--media-radius);
}

.cart-line__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.cart-line__date {
  font-weight: 800;
  color: var(--brand-primary);
  font-size: 0.8rem;
}

.cart-line__price {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.cart-line__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.cart-line__controls select {
  width: auto;
}

.cart-panel__empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
}

.cart-panel__totals {
  padding: 0.75rem;
  text-align: right;
}

.cart-panel__totals:empty {
  display: none;
}

.deposit-info {
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: 0.25rem;
}

/* header: the whole title toggles the list */
.cart-panel__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
}

.cart-panel__chevron {
  transition: transform 0.2s ease;
}

.cart-panel__toggle[aria-expanded="false"] .cart-panel__chevron {
  transform: rotate(-90deg);
}

.cart-line__info {
  min-width: 0;
}

/* the product's name opens it in the shop */
.cart-line__name {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
}

.cart-line__name:hover {
  color: var(--brand-primary);
}

.cart-line__photo {
  cursor: pointer;
}

.cart-line__qty {
  width: auto;
  margin: 0;
}

.cart-panel__due {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border-color);
}

/* "Add a gift" under the items, and its line in the totals */
.cart-panel__gift {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}
.cart-panel__gift-total {
  margin-top: 0.25rem;
}

/* no shop: the cart is the gift alone - no items list above it */
.cart-panel--gift-only .cart-panel__gift {
  border-top: 0;
}

/* no shop: the cart is the gift alone - no items list above it */
.cart-panel {
  margin-bottom: 1rem;
}
