/* Global Cart Styles (extracted from shop.css for reuse across pages) */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --text-dark: #0f172a;
  --text-medium: #4b5563;
  --text-light: #9ca3af;
  --background-white: #ffffff;
  --background-gray: #f8fafc;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Cart Toggle Button */
.cart-toggle {
  position: relative;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
}
.cart-toggle:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.cart-count {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 0.8rem;
  min-width: 18px;
  text-align: center;
}

/* Optional floating placement for pages without a header slot */
.cart-toggle.floating {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1001;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2), 0 4px 6px -2px rgba(0,0,0,0.15);
}
.cart-toggle.floating i { font-size: 1.2rem; }
.cart-toggle.floating .cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: var(--background-white);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}
.cart-sidebar.open { right: 0; }

.cart-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  background: var(--background-gray);
}
.cart-header h3 { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--text-dark); text-align: center; }
.cart-back,
.cart-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-medium); width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.cart-back:hover,
.cart-close:hover { background: var(--border-color); color: var(--text-dark); }

.cart-items { flex: 1; overflow-y: auto; padding: 16px; }
.cart-item { display: flex; gap: 12px; padding: 16px; border: 1px solid var(--border-color); border-radius: 12px; margin-bottom: 12px; background: var(--background-white); transition: all 0.2s ease; }
.cart-item:hover { box-shadow: var(--shadow-md); }
.cart-item-image { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; background: var(--background-gray); flex-shrink: 0; }
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-details { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cart-item-name { font-weight: 600; color: var(--text-dark); font-size: 0.95rem; line-height: 1.3; }
.cart-item-price { color: var(--primary-color); font-weight: 600; font-size: 0.9rem; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.quantity-btn { width: 28px; height: 28px; border: 1px solid var(--border-color); background: var(--background-white); border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-medium); transition: all 0.2s ease; font-size: 0.9rem; }
.quantity-btn:hover { background: var(--background-gray); color: var(--text-dark); }
.quantity-display { font-weight: 600; color: var(--text-dark); min-width: 24px; text-align: center; font-size: 0.9rem; }
.remove-item { background: none; border: none; color: var(--danger-color); cursor: pointer; padding: 4px; border-radius: 4px; font-size: 0.8rem; margin-left: auto; transition: all 0.2s ease; }
.remove-item:hover { background: rgba(239, 68, 68, 0.1); }

.cart-empty { display: none; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; color: var(--text-light); text-align: center; flex: 1; }
.cart-empty i { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.cart-empty p { margin: 0; font-size: 1.1rem; }

.cart-footer { padding: 20px; border-top: 1px solid var(--border-color); background: var(--background-gray); display: none; }
.cart-total { text-align: center; margin-bottom: 16px; font-size: 1.2rem; font-weight: 700; color: var(--text-dark); }
.checkout-btn { width: 100%; background: var(--success-color); color: white; border: none; border-radius: 12px; padding: 16px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; gap: 8px; }
.checkout-btn:hover { background: #059669; transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 999; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.cart-overlay.show { opacity: 1; visibility: visible; }

@media (max-width: 768px) {
  .cart-sidebar { width: 100%; right: -100%; }
}
