/* Cart icon */
#cart-icon {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9998;
  cursor: pointer;
  background: black;
  border: 2px solid #f19700;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 22px;
  line-height: 1;
  color: white;
  display: flex;
  align-items: center;
  gap: 4px;
}
#cart-icon:hover { background: #222; }
#cart-badge {
  background: #f19700;
  color: black;
  font-size: 12px;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Cart overlay */
#cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Cart drawer */
#cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: #111;
  color: white;
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
}
#cart-drawer.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 2px solid #f19700;
}
.cart-header h2 {
  margin: 0;
  font-size: 20px;
  color: #f19700;
  text-shadow: none;
}
#cart-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
#cart-close:hover { color: #f19700; }

#cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

#cart-empty {
  text-align: center;
  color: #888;
  font-size: 16px;
  padding: 40px 0;
}

/* Cart line items */
.cart-line {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #333;
}
.cart-line-img {
  width: 50px !important;
  height: 50px !important;
  min-width: 50px;
  max-width: 50px !important;
  min-height: 50px;
  max-height: 50px !important;
  object-fit: cover !important;
  border: 1px solid #444;
  border-radius: 4px;
  flex-shrink: 0;
  display: block;
}
/* Nuclear option: force ALL images inside cart items to be small thumbnails */
#cart-items img {
  width: 50px !important;
  height: 50px !important;
  max-width: 50px !important;
  max-height: 50px !important;
  min-width: 50px !important;
  min-height: 50px !important;
  object-fit: cover !important;
  flex-shrink: 0;
  display: block;
}
.cart-line-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cart-line-title {
  font-weight: bold;
  font-size: 13px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-line-price {
  color: #f19700;
  font-weight: bold;
  font-size: 13px;
  margin: 0;
}
.cart-line-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.qty-btn {
  background: #333;
  color: white;
  border: 1px solid #555;
  width: 22px;
  height: 22px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  padding: 0;
  line-height: 1;
}
.qty-btn:hover { background: #f19700; color: black; }
.qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-value {
  font-size: 13px;
  font-weight: bold;
  min-width: 16px;
  text-align: center;
}
.cart-line-remove {
  background: none;
  border: none;
  color: #888;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  align-self: flex-start;
}
.cart-line-remove:hover { color: red; }

/* Cart footer */
.cart-footer {
  border-top: 2px solid #f19700;
  padding: 16px 20px;
}
.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 12px;
}
#cart-subtotal { color: #f19700; }
#cart-checkout-btn {
  display: none;
  width: 100%;
  background: #f19700;
  color: black;
  border: 2px solid black;
  padding: 14px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#cart-checkout-btn:hover { background: #ffaa22; }
.cart-continue {
  display: block;
  text-align: center;
  color: #888;
  font-size: 13px;
  margin-top: 10px;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  width: 100%;
}
.cart-continue:hover { color: white; }

@media (max-width: 860px) {
  #cart-drawer { width: 100vw; }
  #cart-icon { top: 8px; right: 8px; padding: 6px 10px; font-size: 20px; }
}
