/* ========== CART DRAWER STYLES ========== */
:root {
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --smoke: #f5f5f5;
  --smoke-2: #eeeeee;
  --ink: #333333;
  --ink-3: #666666;
  --ink-4: #999999;
  --gold: #d88c9a;
  --gold-dark: #c07a87;
  --red: #ff4444;
  --white: #ffffff;
}

/* Dim Overlay */
.dim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.42);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.dim-overlay.open { 
  opacity: 1; 
  pointer-events: all; 
}

/* Cart Drawer */
.cart-drawer {
  position: fixed;
  right: 0; 
  top: 0; 
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--white);
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.55s var(--ease);
  box-shadow: -10px 0 50px rgba(0,0,0,0.1);
}

.cart-drawer.open { 
  transform: translateX(0); 
}

/* Cart Header */
.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 24px;
  border-bottom: 1px solid var(--smoke-2);
  border-top: 1px solid var(--smoke-2);
  background: var(--white);
}

.cart-head h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--ink);
}

.cart-count-label {
  font-size: 0.78rem;
  color: var(--ink-4);
  margin-top: 1px;
}

/* Close Button */
.close-btn {
  width: 36px; 
  height: 36px;
  border: 1.5px solid var(--smoke-2);
  background: var(--white);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.2s var(--ease);
  padding: 0;
}

.close-btn:hover { 
  background: var(--smoke); 
  border-color: var(--ink-3);
}

.close-btn svg { 
  width: 15px; 
  height: 15px; 
  stroke: currentColor; 
}

/* Cart Body */
.cart-body { 
  flex: 1; 
  overflow-y: auto; 
  padding: 16px 24px; 
  background: var(--white);
}

/* Empty State */
.cart-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-4);
}

.cart-empty-state svg { 
  width: 52px; 
  height: 52px; 
  margin: 0 auto 14px; 
  opacity: 0.2;
  stroke: var(--ink-4);
}

.cart-empty-state p { 
  font-size: 0.875rem; 
  margin-bottom: 16px; 
  color: var(--ink-3);
}

/* Cart Items */
.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--smoke);
  animation: fadeIn 0.3s var(--ease);
}

.cart-item:last-child {
  border-bottom: none;
}

@keyframes fadeIn { 
  from { 
    opacity: 0; 
    transform: translateX(8px); 
  } 
  to { 
    opacity: 1; 
    transform: none; 
  } 
}

.cart-item-img {
  width: 72px; 
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--smoke);
  flex-shrink: 0;
}

.cart-item-details { 
  flex: 1; 
  min-width: 0; 
}

.cart-item-name { 
  font-size: 0.87rem; 
  font-weight: 600; 
  margin-bottom: 2px; 
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price { 
  font-size: 0.82rem; 
  color: var(--gold-dark); 
  font-weight: 700; 
  margin-bottom: 6px;
}

/* Quantity Controls */
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.qty-ctrl {
  width: 27px; 
  height: 27px;
  border: 1.5px solid var(--smoke-2);
  background: var(--white);
  border-radius: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.2s var(--ease);
  color: var(--ink);
  padding: 0;
}

.qty-ctrl:hover { 
  border-color: var(--ink); 
  background: var(--smoke);
}

.qty-num { 
  font-size: 0.88rem; 
  font-weight: 700; 
  min-width: 20px; 
  text-align: center; 
  color: var(--ink);
}

/* Remove Button */
.cart-item-remove {
  background: none;
  border: none;
  color: var(--ink-4);
  cursor: pointer;
  font-size: 0.75rem;
  transition: color 0.2s var(--ease);
  align-self: flex-start;
  padding: 4px;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-remove:hover { 
  color: var(--red); 
}

.cart-item-remove svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* Cart Footer */
.cart-foot {
  padding: 20px 24px;
  border-top: 1px solid var(--smoke-2);
  background: var(--white);
}

.cart-summary-rows { 
  margin-bottom: 16px; 
}

.cart-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.cart-row.total {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  border-top: 1px solid var(--smoke-2);
  padding-top: 10px;
  margin-top: 4px;
}

.cart-row.total span:last-child {
  color: var(--gold-dark);
}

/* Checkout Button */
.btn-to-checkout {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.btn-to-checkout:hover { 
  background: var(--gold-dark); 
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(216, 140, 154, 0.3);
}

.btn-to-checkout svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  transition: transform 0.2s var(--ease);
}

.btn-to-checkout:hover svg {
  transform: translateX(4px);
}

/* Scrollbar Styling */
.cart-body::-webkit-scrollbar {
  width: 4px;
}

.cart-body::-webkit-scrollbar-track {
  background: var(--smoke);
}

.cart-body::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 480px) {
  .cart-drawer {
    width: 100%;
  }
}