/* ============================================ */
/* Custom CSS for Ecommerce Template */
/* ============================================ */

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Message/Toast Styles */
.toast-message {
  max-width: 400px;
  word-wrap: break-word;
  z-index: 9999;
}

.message {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
}

.message-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.message-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.message-warning {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.message-info {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* Product Image Animations */
.product-image {
  transition: transform 0.3s ease;
}

.product-item:hover .product-image {
  transform: scale(1.05);
}

/* Cart Badge Animation */
@keyframes bounce {

  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translateY(0);
  }

  40%,
  43% {
    transform: translateY(-8px);
  }

  70% {
    transform: translateY(-4px);
  }

  90% {
    transform: translateY(-2px);
  }
}

.cart-badge {
  animation: bounce 0.5s ease;
}

/* Button Styles */
.btn-primary {
  background-color: #0f172a;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: #1e293b;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: #0f172a;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #1e293b;
  transform: translateY(-1px);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Product Card Styles */
.product-item {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Wishlist Button */
.wishlist-btn {
  transition: all 0.2s ease;
}

.wishlist-btn:hover {
  transform: scale(1.1);
  background-color: #f1f5f9;
}

.wishlist-btn.active {
  background-color: #ef4444;
  color: white;
}

.wishlist-btn.active:hover {
  background-color: #dc2626;
}

/* Filter Section */
.filter-section {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Search Input */
.search-input {
  transition: all 0.2s ease;
}

.search-input:focus {
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.1);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination button {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
  color: #374151;
  transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button.active {
  background-color: #0d9488;
  color: white;
  border-color: #0d9488;
}

/* Loading Spinner */
.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #0d9488;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Product Detail Page */
.product-detail {
  gap: 3rem;
}

.product-images {
  position: sticky;
  top: 2rem;
  height: fit-content;
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.thumbnail {
  aspect-ratio: 1;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
  cursor: pointer;
}

.thumbnail:hover {
  border-color: #d1d5db;
}

.thumbnail.active {
  border-color: #0d9488;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Variant Selection */
.variant-option {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.variant-option:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
}

.variant-option.selected {
  border-color: #0d9488;
  background-color: #f0fdfa;
  color: #0d9488;
}

/* Color Variant */
.color-option {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: #0d9488;
}

.color-option.selected::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

/* Quantity Input */
.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quantity-controls input {
  text-align: center;
  width: 5rem;
}

.quantity-controls button {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.quantity-controls button:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-images {
    position: static;
  }

  .thumbnail-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .filter-section {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-section>div {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Cart Page Styles */
.cart-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  transition: all 0.2s ease;
}

.cart-item:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cart-summary {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 0.5rem;
  padding: 1.5rem;
  position: sticky;
  top: 2rem;
  height: fit-content;
}

/* Checkout Page Styles */
.checkout-section {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.form-error {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus Styles */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .product-item {
    border: 2px solid #000;
  }

  .btn-primary,
  .btn-secondary {
    border: 2px solid #000;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}