/* Products page specific styles */
html {
  scroll-behavior: smooth;
}

.category-item.active {
  background: linear-gradient(135deg, #1f3f7a 0%, #12a4b5 100%) !important;
  color: white !important;
}

.category-item.active i {
  color: white !important;
}

.category-content {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-content.active {
  display: block;
  opacity: 1;
}

.mega {
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.mega.mega-closed {
  visibility: hidden !important;
  opacity: 0 !important;
  transform: translateY(8px) !important;
  pointer-events: none !important;
}

.group:hover .mega:not(.mega-closed),
.mega:hover:not(.mega-closed) {
  visibility: visible !important;
  opacity: 1 !important;
  transform: translateY(0);
}

.thin-scroll::-webkit-scrollbar { 
  width: 6px; 
}

.thin-scroll::-webkit-scrollbar-thumb { 
  background:#e2e8f0; 
  border-radius: 8px; 
}

/* Modal styles for image preview */
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.image-modal.active {
  display: flex;
}

.image-modal img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  transition: all 0.3s ease;
}

.image-modal-close:hover {
  color: #12a4b5;
  transform: rotate(90deg);
}

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

.product-image-clickable {
  cursor: pointer;
  transition: transform 0.3s ease;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

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

/* Pagination dots styles */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot:hover {
  background: #94a3b8;
  transform: scale(1.2);
}

.carousel-dot.active {
  background: linear-gradient(135deg, #1f3f7a 0%, #12a4b5 100%);
  width: 32px;
  border-radius: 5px;
}

/* Image loading optimization */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

.blur-up {
  filter: blur(5px);
  transition: filter 0.3s ease-in;
}

.blur-up.loaded {
  filter: blur(0);
}

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

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

@media (max-width: 1023px) {
  .mega {
    display: none !important;
  }
  
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 30;
  }
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr !important;
  }
  
  .product-card {
    margin-bottom: 1rem;
  }
  
  .text-xl { font-size: 1.125rem; }
  .text-2xl { font-size: 1.5rem; }
  .text-3xl { font-size: 1.875rem; }
  .text-4xl { font-size: 2rem; }
  .text-5xl { font-size: 2.25rem; }
  .text-6xl { font-size: 2.5rem; }
  
  .px-8 { padding-left: 1rem; padding-right: 1rem; }
  .py-12 { padding-top: 2rem; padding-bottom: 2rem; }
  .py-16 { padding-top: 3rem; padding-bottom: 3rem; }
  .py-20 { padding-top: 3rem; padding-bottom: 3rem; }
  .py-24 { padding-top: 4rem; padding-bottom: 4rem; }
  
  .mb-16 { margin-bottom: 3rem; }
  .mb-20 { margin-bottom: 3rem; }
  .mb-24 { margin-bottom: 4rem; }
  
  .rounded-2xl { border-radius: 1rem; }
  .rounded-3xl { border-radius: 1.5rem; }
  
  .max-w-7xl { max-width: 100%; }
  .max-w-6xl { max-width: 100%; }
  .max-w-5xl { max-width: 100%; }
  .max-w-4xl { max-width: 100%; padding: 0 1rem; }
  .max-w-2xl { max-width: 100%; padding: 0 0.5rem; }
  
  .image-modal-content {
    max-width: 95% !important;
    max-height: 85vh !important;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .px-4 { padding-left: 0.75rem; padding-right: 0.75rem; }
  .py-8 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  
  .text-base { font-size: 0.9rem; }
  .text-lg { font-size: 1rem; }
  .text-xl { font-size: 1.125rem; }
  .text-2xl { font-size: 1.25rem; }
  .text-3xl { font-size: 1.5rem; }
  .text-4xl { font-size: 1.75rem; }
  .text-5xl { font-size: 2rem; }
  
  .gap-3 { gap: 0.5rem; }
  .gap-4 { gap: 0.75rem; }
  .gap-6 { gap: 1rem; }
  .gap-8 { gap: 1.25rem; }
  .gap-12 { gap: 1.5rem; }
  
  .grid-cols-2 { grid-template-columns: 1fr; }
  .grid-cols-3 { grid-template-columns: 1fr; }
  .grid-cols-4 { grid-template-columns: 1fr; }
  
  table { font-size: 0.875rem; }
  th, td { padding: 0.5rem !important; }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
  .hover\:scale-105:hover {
    transform: none;
  }
  
  .hover\:-translate-y-1:hover {
    transform: none;
  }
}
