
/**
 * Auric Cart System Styles
 * Styling for cart panel, buttons, and related elements
 */

/* ================ CART PANEL CONTAINER ================ */
/* Cart panel with smooth transition system */
.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90%;
  height: 100%;
  background: #ffffff;
  box-shadow: -2px 0 10px rgba(0,0,0,0.3);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  
  /* Initial hidden state - off screen to the right */
  transform: translateX(100%);
  pointer-events: none;
  opacity: 1;
  
  /* Smooth transition - all properties animate together */
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s linear 0.35s;
  visibility: hidden;
}

/* Active state - panel slides in and is interactive */
.cart-panel.active {
  transform: translateX(0);
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s linear 0s;
}

/* ================ WISHLIST PANEL CONTAINER ================ */
/* Wishlist panel with smooth transition system */
.wishlist-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90%;
  height: 100%;
  background: #ffffff;
  box-shadow: -2px 0 10px rgba(0,0,0,0.3);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  
  /* Initial hidden state */
  transform: translateX(100%);
  pointer-events: none;
  
  /* Smooth transition */
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active state - panel is visible and interactive */
.wishlist-panel.active {
  transform: translateX(0);
  pointer-events: auto;
}

/* ================ OVERLAY STYLES ================ */
.cart-overlay,
.wishlist-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  
  /* Removed blur effect to prevent screen freeze */
  /* backdrop-filter: blur(2px); */
  
  /* Faster transition to prevent blur effect */
  transition: opacity 0.2s ease-out;
}

.cart-overlay.active,
.wishlist-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ================ CART PANEL HEADER ================ */
.cart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
  background: white;
  z-index: 5;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.cart-panel-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.close-cart-btn {
  background: #f5f5f5;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease-in-out;
}

.close-cart-btn:hover {
  background: #e0e0e0;
  color: #333;
}

/* ================ CART ITEMS CONTAINER ================ */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.empty-cart-message {
  text-align: center;
  padding: 30px 0;
  color: #888;
}

/* ================ INDIVIDUAL CART ITEMS ================ */
.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr 30px;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  transition: background-color 0.2s ease;
  contain: layout style;
}

.cart-item:hover {
  background-color: #fafafa;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  contain: layout;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.cart-item:hover .cart-item-image img {
  transform: scale(1.02);
}

.cart-item-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-item-name {
  font-weight: 500;
  margin-bottom: 5px;
  color: #333;
  font-size: 15px;
  line-height: 1.3;
}

.cart-item-price {
  color: #666;
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 500;
}

/* Quantity controls for cart items */
.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-btn {
  background: #f5f5f5;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.quantity-btn:hover {
  background: #e0e0e0;
  transform: translateY(-1px);
}

.quantity-btn:active {
  transform: translateY(0);
}

.quantity-input {
  width: 32px;
  text-align: center;
  border: 1px solid #eee;
  border-radius: 4px;
  height: 28px;
  font-size: 14px;
  font-weight: 500;
}

.remove-item-btn {
  color: #d9534f;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  display: flex;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.remove-item-btn:hover {
  color: #c9302c;
  transform: scale(1.1);
}

.cart-item-total {
  color: #c8a97e;
  font-weight: 600;
  margin-top: 8px;
  font-size: 15px;
}

/* ================ CART PANEL FOOTER ================ */
.cart-panel-footer {
  padding: 15px;
  border-top: 1px solid #eee;
  background: #f9f9f9;
}

.cart-panel-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 15px;
}

.cart-panel-buttons {
  display: flex;
  gap: 10px;
}

.view-cart-btn, .checkout-btn {
  flex: 1;
  padding: 12px;
  text-align: center;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
}

.view-cart-btn {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.checkout-btn {
  background: #c8a97e;
  color: white;
  border: none;
}

.view-cart-btn:hover {
  background: #eaeaea;
}

.checkout-btn:hover {
  background: #b39063;
}

/* ================ CART ICON WITH COUNT ================ */
.cart-icon-container, .wishlist-icon-container {
  position: relative;
  display: inline-flex;
}

/* ================ ADD TO CART BUTTONS ================ */
.add-to-cart-btn {
  background: #c8a97e;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.add-to-cart-btn:hover {
  background: #b39063;
  transform: translateY(-2px);
}

.add-to-cart-btn:active {
  transform: translateY(0);
}

.add-to-cart-btn-small {
  background: #c8a97e;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  margin-top: 8px;
  width: 100%;
  text-align: center;
}

.add-to-cart-btn-small:hover {
  background: #b39063;
  transform: translateY(-2px);
}

/* ================ RESPONSIVE STYLES ================ */
@media (max-width: 768px) {
  .cart-panel {
    max-width: 85%;
  }
  
  .cart-panel-header h3 {
    font-size: 18px;
  }
  
  .cart-item {
    grid-template-columns: 70px 1fr 30px;
    gap: 10px;
    padding: 12px 0;
  }
  
  .cart-item-image {
    width: 70px;
    height: 70px;
  }
  
  .cart-panel-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .view-cart-btn, .checkout-btn {
    padding: 12px;
  }
  
  .cart-item-name {
    font-size: 14px;
  }

  .cart-item-price {
    font-size: 13px;
    margin-bottom: 5px;
  }
  
  .cart-item-total {
    font-size: 14px;
  }
  
  .quantity-btn {
    width: 26px;
    height: 26px;
  }
  
  .quantity-input {
    width: 28px;
    height: 26px;
  }
}

@media (max-width: 480px) {
  .cart-panel {
    max-width: 100%;
  }
  
  .cart-items {
    padding: 15px;
  }
  
  .cart-item {
    grid-template-columns: 60px 1fr 25px;
    gap: 8px;
  }
  
  .cart-item-image {
    width: 60px;
    height: 60px;
  }
  
  .cart-panel-header {
    padding: 12px 15px;
  }
  
  .cart-panel-footer {
    padding: 12px 15px;
  }
  
  .view-cart-btn, .checkout-btn {
    padding: 10px;
    font-size: 13px;
  }
}

/* ================ LOADING STATES ================ */
.loading-message {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #666;
  font-size: 14px;
}

.loading-message::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

/* ================ ANIMATIONS ================ */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ================ WISHLIST SPECIFIC STYLES ================ */
.wishlist-panel-header {
  padding: 15px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wishlist-panel-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-wishlist-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #777;
}

.wishlist-items {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.wishlist-item {
  display: flex;
  margin-bottom: 15px;
  border-bottom: 1px solid #f5f5f5;
  padding-bottom: 15px;
  position: relative;
}

.wishlist-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  margin-right: 15px;
}

.wishlist-item-details {
  flex: 1;
}

.wishlist-item-name {
  font-weight: 500;
  margin-bottom: 5px;
}

.wishlist-item-price {
  color: #666;
  margin-bottom: 10px;
}

.wishlist-item-actions {
  display: flex;
  gap: 10px;
}

.remove-from-wishlist, 
.move-to-cart {
  background: none;
  border: 1px solid #ddd;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.remove-from-wishlist:hover {
  background: #f5f5f5;
}

.move-to-cart {
  background: #000;
  color: #fff;
  border-color: #000;
}

.move-to-cart:hover {
  background: #333;
}

.wishlist-panel-footer {
  padding: 15px;
  border-top: 1px solid #eee;
}

.wishlist-panel-actions {
  display: flex;
  justify-content: flex-end;
}

.clear-wishlist-btn {
  background: none;
  border: 1px solid #ddd;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.clear-wishlist-btn:hover {
  background: #f5f5f5;
}

/* Enhanced heart icon styles */
.add-to-wishlist .fa-heart {
  font-size: 16px;
  color: #333;
}

.add-to-wishlist.active .fa-heart {
  color: #ff3e6c;
  font-weight: 900;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}
