/* ============================================
   CART SYSTEM - Reusable Across All Pages
   Compatible with new navy/white theme
   ============================================ */

/* Cart Overlay */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 9998;
}

.cart-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Cart Panel */
.cart-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 380px;
  max-width: 90%;
  height: 100vh;
  background: #ffffff;
  z-index: 9999;
  transition: right 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
  border-left: 1px solid rgba(0, 30, 56, 0.1);
}

.cart-panel.open {
  right: 0;
}

/* Cart Header */
.cart-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0dcdc;
  background: #ffffff;
}

.cart-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgb(0, 30, 56);
  margin: 0;
}

.close-cart {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: rgb(0, 30, 56);
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-cart:hover {
  background: rgba(0, 30, 56, 0.05);
  transform: scale(1.05);
}

/* Cart Items Container */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background: #fafafa;
}

/* Empty Cart Message */
.empty-cart-message {
  text-align: center;
  padding: 40px 20px;
  color: #8a8a8a;
  font-size: 0.9rem;
}

/* Cart Item Row */
.cart-item {
  display: flex;
  gap: 12px;
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #f0dcdc;
  transition: all 0.2s ease;
}

.cart-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 30, 56, 0.2);
}

.cart-item-img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #f0dcdc;
}

.cart-item-details {
  flex: 1;
}

.cart-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgb(0, 30, 56);
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 0.8rem;
  color: #8a8a8a;
}

.cart-item-subtotal {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgb(0, 30, 56);
  margin-top: 4px;
}

.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  background: #f5f5f5;
  border: 1px solid #f0dcdc;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: rgb(0, 30, 56);
  transition: all 0.2s ease;
}

.qty-btn:hover {
  background: rgb(0, 30, 56);
  color: white;
  border-color: rgb(0, 30, 56);
}

.cart-item-qty {
  font-size: 13px;
  font-weight: 600;
  color: rgb(0, 30, 56);
}

.remove-item {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #8a8a8a;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.remove-item:hover {
  color: #e74c3c;
  transform: scale(1.1);
}

/* Cart Footer */
.cart-footer {
  padding: 20px;
  border-top: 1px solid #f0dcdc;
  background: #ffffff;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 1rem;
}

.cart-total-label {
  font-weight: 600;
  color: rgb(0, 30, 56);
}

.cart-total-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: rgb(0, 30, 56);
}

.checkout-btn {
  width: 100%;
  padding: 14px;
  background: rgb(0, 30, 56);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.checkout-btn:hover {
  background: rgb(20, 60, 96);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 30, 56, 0.3);
}

/* Cart Icon with Count Badge */
.cart-icon-wrapper {
  position: relative;
  cursor: pointer;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: rgb(0, 30, 56);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 50%;
  min-width: 18px;
  text-align: center;
}

/* Notification Toast */
.cart-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgb(0, 30, 56);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  animation: slideInRight 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 480px) {
  .cart-panel {
    width: 100%;
    right: -100%;
  }
  
  .cart-item-img {
    width: 60px;
    height: 60px;
  }
  
  .cart-item-title {
    font-size: 0.8rem;
  }
}

/* ======================= CART PANEL FIXES ======================= */
.cart-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 90%;
    height: 100%;
    background: #ffffff;
    z-index: 1001;
    transition: right 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
}

.cart-panel.open,
.cart-panel.active {
    right: 0;
}

.cart-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0dcdc;
}

.cart-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #001e38;
    margin: 0;
}

.close-cart {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #001e38;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-cart:hover {
    background: rgba(0, 30, 56, 0.05);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #fafafa;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #f0dcdc;
    background: #ffffff;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cart-total-label {
    font-weight: 600;
    color: #001e38;
    font-size: 16px;
}

.cart-total-value {
    font-size: 20px;
    font-weight: 700;
    color: #001e38;
}

.checkout-btn {
    width: 100%;
    padding: 12px;
    background: #001e38;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.checkout-btn:hover {
    background: #0a2a44;
}