/* Custom CSS for Cape Clearance */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Logo Enhancement */
.logo-hero {
  filter: drop-shadow(0 20px 25px rgba(0, 0, 0, 0.25)) drop-shadow(0 8px 10px rgba(255, 87, 34, 0.2));
  animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  from {
    filter: drop-shadow(0 20px 25px rgba(0, 0, 0, 0.25)) drop-shadow(0 8px 10px rgba(255, 87, 34, 0.2));
  }
  to {
    filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.35)) drop-shadow(0 12px 15px rgba(255, 87, 34, 0.4));
  }
}

.logo-backdrop {
  background: radial-gradient(circle at center, rgba(255, 87, 34, 0.1) 0%, transparent 70%);
  animation: backdropPulse 4s ease-in-out infinite;
}

@keyframes backdropPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.6;
  }
}

/* Root Variables */
:root {
  --cape-orange: #FF5722;
  --cape-red: #E53E3E;
  --cape-dark: #2D3748;
  --cape-gray: #4A5568;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: #2D3748;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--cape-orange);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cape-red);
}

/* Loading Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Product Card Hover Effects */
.product-card {
  transition: all 0.3s ease-in-out;
  position: relative;
  height: 100%; /* Ensure all cards have equal height */
  border-radius: 12px;
  overflow: hidden;
}

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

/* Product Card Overlay Effects - CONTAINED to image area only */
.product-overlay {
  /* Ensure overlay only covers the image section */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* This will be contained within the relative positioned image container */
  pointer-events: none; /* Allow clicks to pass through when not visible */
}

.product-card:hover .product-overlay {
  opacity: 1;
  pointer-events: auto; /* Enable clicks when visible */
}

.product-card:hover .product-overlay button {
  transform: translateY(0);
}

.product-overlay button {
  transform: translateY(8px);
  transition: transform 0.3s ease;
  pointer-events: auto;
}

/* Line clamp utilities for consistent text truncation */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fixed height utilities for consistent layout */
.line-height-tight {
  line-height: 1.25;
}

/* Product Grid Layout */
.products-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .product-card {
    max-width: 100%;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Badge positioning - ensure no overlap */
.product-card .discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  pointer-events: none; /* Prevent interference with other elements */
}

.product-card .wishlist-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
}

.product-card .product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 87, 34, 0.9), rgba(229, 62, 62, 0.9));
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.product-overlay button {
  background: white;
  color: var(--cape-orange);
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: translateY(20px);
}

.product-card:hover .product-overlay button {
  transform: translateY(0);
}

.product-overlay button:hover {
  background: var(--cape-orange);
  color: white;
}

/* Button Styles */
.btn-primary {
  background: linear-gradient(135deg, var(--cape-orange), var(--cape-red));
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255, 87, 34, 0.3);
}

/* Category Icons Animation */
.category-icon {
  transition: all 0.3s ease;
}

.category-card:hover .category-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Price Display */
.price-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-current {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cape-red);
}

.price-original {
  font-size: 1rem;
  color: #9CA3AF;
  text-decoration: line-through;
}

.price-badge {
  background: var(--cape-orange);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Search Bar Enhancement */
.search-container {
  position: relative;
}

.search-container input:focus + .search-suggestions {
  display: block;
}

.search-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 50;
}

.search-suggestion {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-suggestion:hover {
  background: #F9FAFB;
}

/* Mobile Menu Animation */
.mobile-menu {
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}

.mobile-menu.open {
  transform: translateX(0);
}

/* Tab System */
.tab-button {
  transition: all 0.3s ease;
}

.tab-button.active {
  color: var(--cape-orange);
  border-bottom-color: var(--cape-orange);
}

.tab-content {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cart Badge Animation */
.cart-badge {
  animation: bounce 0.5s ease-in-out;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

/* Loading Skeleton */
.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;
  }
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  padding: 16px;
  z-index: 1000;
  transform: translateX(400px);
  transition: transform 0.3s ease-in-out;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left: 4px solid #10B981;
}

.toast.error {
  border-left: 4px solid #EF4444;
}

/* Responsive Design Helpers */
.container-fluid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .print-break {
    page-break-before: always;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --cape-orange: #FF4500;
    --cape-red: #DC143C;
    --cape-dark: #000000;
    --cape-gray: #333333;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Styles for Accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
  outline: 2px solid var(--cape-orange);
  outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --cape-dark: #F7FAFC;
    --text-color: #F7FAFC;
    --bg-color: #1A202C;
  }
}

/* Custom Utilities */
.text-gradient {
  background: linear-gradient(135deg, var(--cape-orange), var(--cape-red));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bg-gradient-cape {
  background: linear-gradient(135deg, var(--cape-orange), var(--cape-red));
}

.shadow-cape {
  box-shadow: 0 10px 25px rgba(255, 87, 34, 0.2);
}

.border-cape {
  border-color: var(--cape-orange);
}

/* Modern Category Page Styles */
.products-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-button {
  transition: all 0.2s ease;
}

.filter-button:hover {
  transform: translateY(-1px);
}

.filter-button.active {
  background: var(--cape-orange) !important;
  color: white !important;
  border-color: var(--cape-orange) !important;
}

/* Sticky filters sidebar */
.filters-sidebar {
  position: sticky;
  top: 6rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
}

/* Product grid responsive improvements */
@media (min-width: 1280px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Filter tags styling */
.filter-tag {
  background: var(--cape-orange);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-tag button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1;
}

/* Modern pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  padding: 0.25rem;
}

.pagination button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  color: #6b7280;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pagination button:hover:not(:disabled) {
  background: #f3f4f6;
  color: #374151;
}

.pagination button.active {
  background: var(--cape-orange);
  color: white;
}

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

/* View toggle buttons */
.view-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  color: #6b7280;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.view-toggle.active {
  background: white;
  color: #374151;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
  animation: slideUp 0.5s ease-in-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}