/* Shopping Cart Styles */

/* Cart Icon in Navigation */
.cart-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.cart-badge {
  display: none;
  background-color: var(--color-primary);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -8px;
  right: -8px;
  font-weight: bold;
}

/* Add to Cart Button */
.add-to-cart-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  margin-top: 1.5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: var(--color-white);
  border: none;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
  background: linear-gradient(135deg, #FF8520, #FF6B35);
}

.add-to-cart-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
}

.add-to-cart-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Cart Notification */
.cart-notification {
  position: fixed;
  top: 100px;
  right: -300px;
  background: var(--color-primary);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 10000;
  transition: right 0.3s ease;
}

.cart-notification.show {
  right: 20px;
}

.notification-emoji {
  font-size: 2rem;
}

.notification-text {
  font-weight: 500;
}

/* Cart Modal */
.cart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
}

.cart-modal.show {
  display: block;
}

.cart-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.cart-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cart-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-modal-header h2 {
  margin: 0;
  color: var(--color-primary);
}

.cart-close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
  transition: color 0.2s;
}

.cart-close-btn:hover {
  color: var(--color-text);
}

.cart-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

#cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 12px;
}

.cart-item.custom-design-item {
  background: linear-gradient(135deg, rgba(255, 230, 230, 0.3), rgba(230, 240, 255, 0.3));
  border: 2px solid var(--color-accent);
}

.custom-design-preview {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-custom-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-emoji {
  font-size: 2rem;
  flex-shrink: 0;
}

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

.cart-item-name {
  font-weight: bold;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.cart-item-variant {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.cart-item-custom-note {
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cart-item-price {
  color: var(--color-primary);
  font-weight: bold;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #e0e0e0;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.qty-btn:hover {
  background: #f5f5f5;
  border-color: var(--color-primary);
}

.cart-item-quantity {
  min-width: 30px;
  text-align: center;
  font-weight: bold;
}

.remove-item-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: transform 0.2s;
}

.remove-item-btn:hover {
  transform: scale(1.2);
}

.empty-cart {
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
}

.empty-cart-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-cart-subtitle {
  font-size: 0.9rem;
}

.cart-modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.3rem;
}

#cart-total-amount {
  color: var(--color-primary);
  font-weight: bold;
}

.checkout-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.checkout-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.clear-cart-btn {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  color: #999;
  border: 1px solid #e0e0e0;
  border-radius: 50px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-cart-btn:hover {
  background: #f5f5f5;
  color: var(--color-text);
}

/* Variant Selector Modal */
.variant-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
}

.variant-modal.show {
  display: block;
}

.variant-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.variant-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.variant-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.variant-modal-header h3 {
  margin: 0;
  color: var(--color-primary);
  font-size: 1.5rem;
}

.variant-close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
  transition: color 0.2s;
}

.variant-close-btn:hover {
  color: var(--color-text);
}

.variant-modal-body {
  padding: 1.5rem;
}

.variant-instruction {
  text-align: center;
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.variant-card {
  padding: 1.5rem;
  background: #f9f9f9;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.variant-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
}

.variant-image-placeholder {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.variant-name {
  font-weight: bold;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.variant-description {
  font-size: 0.85rem;
  color: #666;
}

/* Mobile Responsive for Cart */
@media (max-width: 768px) {
  .cart-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .cart-item {
    flex-wrap: wrap;
  }

  .cart-item-controls {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }

  .variant-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
