/* Custom styles beyond Tailwind */

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

#mobileMenuAbout {
  transition: all 0.3s ease-in-out;
}

#mobileMenuAbout.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

#mobileMenuAbout:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

/* Custom animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* Product card hover effects */
.product-card {
  transition: all 0.3s ease;
}

.product-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Custom button styles */
.btn-primary {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(30, 58, 138, 0.2);
}

/* Category card hover */
.category-card:hover .category-icon {
  transform: rotate(10deg) scale(1.1);
}

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

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

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

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .hero-title {
      font-size: 2.5rem;
  }
  
  .product-grid {
      grid-template-columns: repeat(2, 1fr);
  }
}

/* Products Page Specific Styles */

/* Line clamp for product descriptions */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Smooth transitions for filters */
.filter-section {
  transition: all 0.3s ease;
}

/* Custom scrollbar for brand filters */
.brand-filters-container::-webkit-scrollbar {
  width: 6px;
}

.brand-filters-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.brand-filters-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.brand-filters-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Price slider customization */
input[type="range"] {
  -webkit-appearance: none;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: #1e3a8a;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Checkbox styling */
input[type="checkbox"] {
  accent-color: #1e3a8a;
}

/* Active filter tags */
.filter-tag {
  transition: all 0.2s ease;
}

.filter-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* View toggle active state */
.view-toggle.active {
  background-color: #1e3a8a;
  color: white;
}

/* Pagination active state */
.pagination-btn.active {
  background-color: #1e3a8a;
  color: white;
  border-color: #1e3a8a;
}

/* Loading animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
  .product-card-list {
      flex-direction: column;
  }
  
  .product-image-list {
      width: 100% !important;
      height: 200px !important;
  }
}

/* Accessibility focus styles */
.filter-input:focus,
.sort-select:focus {
  outline: 2px solid #1e3a8a;
  outline-offset: 2px;
}

/* Transition for product cards */
.product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-4px);
}


/* Product Detail Page Specific Styles */

/* Image zoom effect */
#main-product-image {
  transition: transform 0.3s ease;
}

#main-product-image:hover {
  transform: scale(1.05);
}

/* Tab animations */
.tab-content {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gradient-x {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.animate-gradient-x {
  background-size: 200% 200%;
  animation: gradient-x 15s ease infinite;
}

/* FAQ animations */
.faq-answer {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
      opacity: 0;
      max-height: 0;
  }
  to {
      opacity: 1;
      max-height: 500px;
  }
}

.rotate-180 {
  transform: rotate(180deg);
}

/* Quantity input styling */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.lb-data .lb-caption {
  font-size: 16px;
  line-height: 1.4;
}

.lb-data .lb-number {
  font-size: 14px;
  color: #666;
}

/* Review stars interaction */
.review-star {
  transition: all 0.2s ease;
}

.review-star:hover ~ .review-star i {
  color: #d1d5db !important;
}

/* Breadcrumb separator */
.breadcrumb-separator {
  color: #9ca3af;
  margin: 0 8px;
}

/* Product card hover effect */
.product-card {
  cursor: pointer;
  transition: all 0.3s ease;
}

.product-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Thumbnail active state */
.thumbnail-btn.active {
  border-color: #1e3a8a !important;
  box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.2);
}

/* Tab active state */
.tab-btn.active {
  position: relative;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #1e3a8a;
}

/* Modal animations */
.modal-enter {
  animation: modalEnter 0.3s ease;
}

@keyframes modalEnter {
  from {
      opacity: 0;
      transform: scale(0.9);
  }
  to {
      opacity: 1;
      transform: scale(1);
  }
}

/* Notification animations */
.notification-enter {
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
      transform: translateX(100%);
      opacity: 0;
  }
  to {
      transform: translateX(0);
      opacity: 1;
  }
}

/* Loading spinner */
.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1e3a8a;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Responsive adjustments for product detail */
@media (max-width: 768px) {
  .product-detail-grid {
      grid-template-columns: 1fr;
  }
  
  .product-images {
      order: -1;
  }
  
  .tab-nav {
      flex-wrap: wrap;
  }
  
  .tab-btn {
      flex: 1;
      min-width: 120px;
      text-align: center;
  }
}

/* Custom scrollbar for thumbnails */
#image-thumbnails::-webkit-scrollbar {
  height: 4px;
}

#image-thumbnails::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

#image-thumbnails::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 2px;
}

#image-thumbnails::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Rating progress bars */
.rating-bar {
  transition: width 0.3s ease;
}

/* Add to cart button states */
#add-to-cart-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#add-to-cart-btn:disabled:hover {
  background-color: #1e3a8a;
}

/* Checkout Page Specific Styles */

/* Progress bar connectors */
.progress-connector {
  flex: 1;
  height: 2px;
  background-color: #e5e7eb;
  margin: 0 1rem;
}

.progress-connector.active {
  background-color: #1e3a8a;
}

/* Step animations */
.checkout-step {
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
      opacity: 0;
      transform: translateX(20px);
  }
  to {
      opacity: 1;
      transform: translateX(0);
  }
}

/* Payment method tabs */
.payment-tab.active {
  position: relative;
}

.payment-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #1e3a8a;
}

/* Radio and checkbox styling */
input[type="radio"]:checked + div {
  border-color: #1e3a8a;
  background-color: #f0f7ff;
}

input[type="checkbox"]:checked {
  accent-color: #1e3a8a;
}

/* Loading spinner */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1e3a8a;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Form validation styles */
input:invalid, select:invalid {
  border-color: #dc2626;
}

input:valid, select:valid {
  border-color: #10b981;
}

/* Card number formatting */
#card-number {
  letter-spacing: 1px;
}

/* Order confirmation modal */
#order-confirmation {
  animation: modalEnter 0.3s ease;
}

@keyframes modalEnter {
  from {
      opacity: 0;
      transform: scale(0.9);
  }
  to {
      opacity: 1;
      transform: scale(1);
  }
}

/* Shipping method cards */
.shipping-method-card {
  transition: all 0.2s ease;
}

.shipping-method-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shipping-method-card.selected {
  border-color: #1e3a8a;
  background-color: #f0f7ff;
}

/* Order summary sticky positioning */
.sticky {
  position: sticky;
  top: 6rem; /* Adjust based on your header height */
}

/* Error message animation */
.error-message {
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Input focus styles */
input:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Disabled state for shipping options */
.opacity-50 {
  opacity: 0.5;
}

.cursor-not-allowed {
  cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .checkout-progress {
      flex-direction: column;
      align-items: flex-start;
  }
  
  .progress-connector {
      width: 2px;
      height: 2rem;
      margin: 0.5rem 0;
  }
  
  .payment-method-tabs {
      flex-direction: column;
  }
  
  .payment-tab {
      width: 100%;
      text-align: center;
  }
}

/* Print styles for order confirmation */
@media print {
  header, footer, .checkout-progress, #prev-step, #next-step {
      display: none !important;
  }
  
  body {
      background: white !important;
  }
  
  #checkout-form-container {
      max-width: 100% !important;
      box-shadow: none !important;
  }
}


/* Custom Image Zoom Styles */
.lightbox-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-slides {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-slide {
  display: none;
}

.lightbox-slide.active {
  display: block;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Thumbnail hover effects */
.thumbnail-btn {
  transition: all 0.2s ease;
}

.thumbnail-btn:hover:not(.border-primary) {
  border-color: #93c5fd;
}

/* Main image cursor */
#main-product-image {
  cursor: zoom-in;
}

/* Zoom overlay image */
.zoom-overlay img {
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
      opacity: 0;
      transform: scale(0.9);
  }
  to {
      opacity: 1;
      transform: scale(1);
  }
}

/* Image navigation */
.image-nav-btn {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-zoom-container:hover .image-nav-btn {
  opacity: 1;
}