/* ===========================
   BB Cart Page + Sticky ATC + Bottom Sheet
   =========================== */

/* ===========================
   CART PAGE (full page, mobile-first)
   =========================== */
.bb-cart-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--bb-gutter) var(--bb-section-padding);
}

/* Header: Back + Title */
.bb-cart-page__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--bb-line);
  margin-bottom: 0;
}

.bb-cart-page__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--bb-small);
  color: var(--bb-fg);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: opacity var(--bb-transition-fast);
}

.bb-cart-page__back:hover {
  opacity: 0.6;
}

.bb-cart-page__title {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
  flex: 1;
}

/* Empty state */
.bb-cart-page__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 0;
  text-align: center;
}

.bb-cart-page__empty svg {
  opacity: 0.3;
}

.bb-cart-page__empty p {
  font-size: var(--bb-body);
  color: var(--bb-muted);
  margin: 0;
}

.bb-cart-page__shop-link {
  display: inline-block;
  padding: 14px 32px;
  font-size: var(--bb-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--bb-bg);
  background: var(--bb-black);
  transition: opacity var(--bb-transition-fast);
}

.bb-cart-page__shop-link:hover {
  opacity: 0.85;
}

/* Cart items (page context) */
.bb-cart-page__items {
  display: flex;
  flex-direction: column;
}

.bb-cart-page__items .bb-cart-item--page {
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--bb-line);
}

.bb-cart-page__items .bb-cart-item--page:last-child {
  border-bottom: 1px solid var(--bb-line);
}

.bb-cart-page__items .bb-cart-item__image {
  width: 100px;
  height: 130px;
}

/* Totals box */
.bb-cart-page__totals {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--bb-fg);
}

.bb-cart-page__total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 16px;
  margin-top: 12px;
  border-top: 1px solid var(--bb-line);
}

/* Actions */
.bb-cart-page__actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bb-cart-page__checkout {
  display: block;
  background: var(--bb-black);
  color: var(--bb-bg) !important;
  text-align: center;
  padding: 16px 24px;
  font-size: var(--bb-body);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity var(--bb-transition-fast);
}

.bb-cart-page__checkout:hover {
  opacity: 0.85;
}

/* Confidence section on cart page */
.bb-cart-page .bb-cart-confidence {
  margin-top: 32px;
}

/* Desktop: wider layout */
@media (min-width: 768px) {
  .bb-cart-page {
    max-width: 900px;
    padding-top: 20px;
  }

  .bb-cart-page__items .bb-cart-item--page {
    grid-template-columns: 120px 1fr;
  }

  .bb-cart-page__items .bb-cart-item__image {
    width: 120px;
    height: 150px;
  }
}

/* ===========================
   MOBILE STICKY ADD-TO-CART BAR
   Fixed bottom bar on product pages (mobile only)
   =========================== */
.bb-sticky-atc {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 250;
  background: var(--bb-bg);
  border-top: 1px solid var(--bb-line);
  padding: 12px var(--bb-gutter);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  display: none; /* Hidden on desktop */
}

.bb-sticky-atc.is-visible {
  transform: translateY(0);
}

.bb-sticky-atc__info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.bb-sticky-atc__name {
  font-size: var(--bb-small);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.bb-sticky-atc__variant {
  font-size: var(--bb-tiny);
  color: var(--bb-muted);
}

.bb-sticky-atc__right {
  display: none; /* Price in the info row, combined on mobile */
}

.bb-sticky-atc__price {
  font-size: var(--bb-body);
  font-weight: 500;
}

.bb-sticky-atc__buttons {
  display: flex;
  gap: 8px;
}

.bb-sticky-atc__btn {
  flex: 1;
  padding: 14px 16px;
  font-size: var(--bb-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: opacity var(--bb-transition-fast);
}

.bb-sticky-atc__btn--primary {
  background: var(--bb-black);
  color: var(--bb-bg);
}

.bb-sticky-atc__btn:hover {
  opacity: 0.85;
}

/* Show only on mobile */
@media (max-width: 767px) {
  .bb-sticky-atc {
    display: block;
  }

  .bb-sticky-atc__right {
    display: flex;
    align-items: center;
  }
}

/* ===========================
   MOBILE ADD-TO-CART BOTTOM SHEET
   Confirmation after adding to cart (mobile only)
   =========================== */
.bb-bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bb-bottom-sheet.is-open {
  pointer-events: auto;
  opacity: 1;
}

.bb-bottom-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.bb-bottom-sheet__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bb-bg);
  border-radius: 16px 16px 0 0;
  padding: 12px var(--bb-gutter) 32px;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80vh;
  overflow-y: auto;
}

.bb-bottom-sheet.is-open .bb-bottom-sheet__panel {
  transform: translateY(0);
}

/* Handle bar */
.bb-bottom-sheet__handle {
  display: flex;
  justify-content: center;
  padding: 8px 0 16px;
}

.bb-bottom-sheet__handle-bar {
  width: 36px;
  height: 4px;
  background: var(--bb-line);
  border-radius: 2px;
}

/* Close button */
.bb-bottom-sheet__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--bb-fg);
  cursor: pointer;
  padding: 4px;
  transition: opacity var(--bb-transition-fast);
}

.bb-bottom-sheet__close:hover {
  opacity: 0.6;
}

/* Title */
.bb-bottom-sheet__title {
  font-size: var(--bb-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 20px;
}

/* Product row */
.bb-bottom-sheet__product {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.bb-bottom-sheet__image {
  width: 80px;
  height: 100px;
  overflow: hidden;
  background: #f5f5f5;
}

.bb-bottom-sheet__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bb-bottom-sheet__details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bb-bottom-sheet__name {
  font-size: var(--bb-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.bb-bottom-sheet__variant {
  font-size: var(--bb-small);
  color: var(--bb-muted);
}

.bb-bottom-sheet__price {
  font-size: var(--bb-body);
  font-weight: 500;
  margin-top: 4px;
}

/* Actions */
.bb-bottom-sheet__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bb-bottom-sheet__btn {
  display: block;
  text-align: center;
  padding: 16px 24px;
  font-size: var(--bb-body);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity var(--bb-transition-fast);
  cursor: pointer;
  border: none;
}

.bb-bottom-sheet__btn--primary {
  background: var(--bb-black);
  color: var(--bb-bg) !important;
}

.bb-bottom-sheet__btn:hover {
  opacity: 0.85;
}

.bb-bottom-sheet__link {
  display: block;
  text-align: center;
  font-size: var(--bb-small);
  color: var(--bb-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px;
  transition: opacity var(--bb-transition-fast);
}

.bb-bottom-sheet__link:hover {
  opacity: 0.6;
}

/* Only show bottom sheet on mobile/tablet */
@media (min-width: 992px) {
  .bb-bottom-sheet {
    display: none !important;
  }
}
