/* === REEF 3D CART === */

/* The order summary that used to sit under the contact form is gone.
   The cart drawer is the only place the order is shown now. */
.cart-success-note {
  background: rgba(14, 165, 160, 0.1);
  border: 1px solid rgba(14, 165, 160, 0.25);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.2rem;
  text-align: center;
}
.cart-success-note p { margin: 0; }

.product-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  margin: 0;
}

.cart-toggle {
  position: fixed;
  bottom: 5.25rem;
  right: 1.25rem;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--ocean, #0e7490);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(14, 116, 144, 0.35);
  z-index: 1000;
  transition: transform 0.2s, background 0.2s;
}
.cart-toggle:hover { transform: translateY(-3px) scale(1.05); }
.cart-toggle.has-items { background: var(--coral, #ff6b35); }

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--deep, #083344);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 51, 68, 0.5);
  backdrop-filter: blur(3px);
  z-index: 1100;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-panel {
  width: 100%;
  max-width: 420px;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
}
.cart-overlay.open .cart-panel { transform: translateX(0); }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(8, 51, 68, 0.08);
  flex-shrink: 0;
}
.cart-head h3 {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  color: var(--deep, #083344);
}
.cart-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-light, #64748b);
  cursor: pointer;
  padding: 0 4px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}
.cart-close:hover { color: var(--coral, #ff6b35); background: rgba(8, 51, 68, 0.06); }

/* Clear the whole cart from the drawer header. The Remove button on
   each card removes one item, this empties the cart. */
.cart-clear-all {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0 0.5rem;
  margin-right: 0.25rem;
  flex-shrink: 0;
}
.cart-clear-all:hover { color: #ef4444; }

.cart-body { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }

.cart-empty { text-align: center; padding: 3rem 1rem; color: var(--text-light, #64748b); }
.cart-empty p { font-size: 0.95rem; margin-bottom: 0.4rem; }
.cart-browse {
  display: inline-block;
  margin-top: 0.8rem;
  min-height: 44px;
  line-height: 44px;
  padding: 0 1.4rem;
  background: var(--teal, #0ea5a0);
  color: #fff;
  font-weight: 600;
  border-radius: 50px;
  text-decoration: none;
}
.cart-browse:hover { background: var(--ocean, #0e7490); }

.cart-item {
  display: flex;
  gap: 0.9rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(8, 51, 68, 0.07);
  align-items: flex-start;
}
.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e8e0d4;
}
.cart-item-ph { background: linear-gradient(135deg, #e0f2f1, #b2dfdb); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--deep, #083344);
}
.cart-item-cat {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--coral, #ff6b35);
  font-weight: 700;
  margin-top: 0.15rem;
}
.cart-item-price { font-size: 0.8rem; color: var(--text-light, #64748b); margin-top: 0.2rem; }
.cart-item-total {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--ocean, #0e7490);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.cart-qty { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }
.qty-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(8, 51, 68, 0.18);
  background: #fff;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--deep, #083344);
  font-weight: 700;
}
.qty-btn:hover { background: #f1f5f9; }
.qty-val {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--deep, #083344);
}
.cart-item-rm {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0 0.4rem;
  min-height: 44px;
  margin-left: 0.2rem;
}
.cart-item-rm:hover { color: #ef4444; }

.cart-foot {
  padding: 1.2rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(8, 51, 68, 0.08);
  background: #f8fafc;
  flex-shrink: 0;
}
.cart-totals {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  font-family: 'Poppins', sans-serif;
  color: var(--deep, #083344);
  font-size: 1rem;
}
.cart-totals span { display: flex; flex-direction: column; }
.cart-totals em {
  font-style: normal;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-light, #64748b);
  margin-top: 0.15rem;
}
.cart-totals strong { font-size: 1.35rem; color: var(--ocean, #0e7490); white-space: nowrap; }

/* Postage line, shown between the subtotal and the grand total. */
.cart-shipping {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(8, 51, 68, 0.12);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  color: var(--deep, #083344);
}
.cart-shipping span { display: flex; flex-direction: column; }
.cart-shipping strong { font-size: 1.1rem; color: var(--ocean, #0e7490); white-space: nowrap; }
.cart-shipping em {
  flex-basis: 100%;
  font-style: normal;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-light, #64748b);
  margin-top: 0.15rem;
}
.cart-totals--total { margin-top: 0.7rem; }
.cart-totals--total strong { font-size: 1.5rem; color: var(--deep, #083344); }

.cart-note { font-size: 0.75rem; color: var(--text-light, #64748b); margin: 0.6rem 0 1rem; }
.cart-checkout { width: 100%; min-height: 48px; justify-content: center; }
.cart-continue {
  display: block;
  text-align: center;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--text-light, #64748b);
  text-decoration: underline;
  min-height: 44px;
  line-height: 44px;
}

/* Lock background scroll while the drawer is open */
body.cart-open { overflow: hidden; }

/* Add to cart button in product card */
.btn-add-cart {
  background: var(--ocean, #0e7490);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
  border-radius: 8px;
  transition: background 0.2s, transform 0.15s;
  min-height: 44px;
}
.btn-add-cart:hover { background: var(--deep, #083344); transform: translateY(-1px); }
.btn-add-cart.in-cart { background: var(--coral, #ff6b35); }

/* Filter buttons - thumb friendly and clear active state */
.filter-btn {
  font-family: 'Poppins', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(8, 51, 68, 0.15);
  background: #fff;
  color: var(--deep, #083344);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.filter-btn:hover { border-color: var(--ocean, #0e7490); color: var(--ocean, #0e7490); }
.filter-btn.active {
  background: var(--ocean, #0e7490);
  border-color: var(--ocean, #0e7490);
  color: #fff;
}
.filter-btn.active .filter-n { background: rgba(255,255,255,0.22); color: #fff; }
.filter-n {
  background: rgba(8, 51, 68, 0.08);
  color: var(--text-light, #64748b);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
}

@media (max-width: 768px) {
  .cart-panel { max-width: 100%; }
  .cart-toggle { bottom: 4.75rem; right: 1rem; width: 54px; height: 54px; }
  .cart-body { padding: 0.8rem 1rem; }
  .cart-foot { padding: 1rem 1rem 1.2rem; }
  .cart-item-img { width: 56px; height: 56px; }
  .product-filters { justify-content: center; }
}

/* --- Stripe checkout states --- */
.cart-error {
  display: none;
  background: rgba(224, 96, 84, 0.12);
  border: 1px solid rgba(224, 96, 84, 0.45);
  color: #b3442f;
  font-size: 0.85rem;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 8px;
  margin: 0 0 10px;
}

.cart-checkout.is-busy {
  opacity: 0.7;
  cursor: progress;
  pointer-events: none;
}

.cart-item-tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ocean);
  background: rgba(14, 165, 160, 0.1);
  border-radius: 4px;
  padding: 2px 7px;
  margin: 4px 0 2px;
}

.cart-item-price {
  color: var(--slate);
}
