/* products-shared.css — rules used by multiple page types.
 * Extracted from products.css in Phase 3. Loaded by products.html in
 * addition to catalog.css; will be loaded by detail pages and other
 * pages in Phase 5 once they migrate off products.css.
 * Contains: hero buttons, animations, category preview cards, partner
 *           cards, material-symbols sizing helpers.
 */

/* ============================================
   HERO SECTION ENHANCEMENTS
   ============================================ */

/* Float Animations for Background Orbs */
@keyframes float-slow {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
  }
  33% {
    transform: translateY(-20px) translateX(10px) scale(1.02);
  }
  66% {
    transform: translateY(10px) translateX(-10px) scale(0.98);
  }
}


@keyframes float-medium {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1) rotate(0deg);
  }
  25% {
    transform: translateY(-30px) translateX(15px) scale(1.03) rotate(2deg);
  }
  50% {
    transform: translateY(-15px) translateX(-10px) scale(0.97) rotate(-1deg);
  }
  75% {
    transform: translateY(20px) translateX(-5px) scale(1.01) rotate(1deg);
  }
}


@keyframes float-fast {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
  }
  20% {
    transform: translateY(-25px) translateX(20px) scale(1.05);
  }
  40% {
    transform: translateY(-10px) translateX(-15px) scale(0.95);
  }
  60% {
    transform: translateY(15px) translateX(10px) scale(1.02);
  }
  80% {
    transform: translateY(-5px) translateX(-5px) scale(0.98);
  }
}


/* Enhanced Button Styles (Dark Theme) */
.btn-primary-enhanced-dark {
  background: linear-gradient(135deg, #12a650 0%, #0d8c40 100%);
  color: #ffffff;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(18, 167, 80, 0.3);
  position: relative;
  overflow: hidden;
}


.btn-primary-enhanced-dark::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 ease;
}


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


.btn-primary-enhanced-dark:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(18, 167, 80, 0.4);
}


.btn-primary-enhanced-dark:active {
  transform: translateY(0);
}


.btn-outline-enhanced-dark {
  background: transparent;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}


.btn-outline-enhanced-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  transition: width 0.3s ease;
  z-index: -1;
}


.btn-outline-enhanced-dark:hover::before {
  width: 100%;
}


.btn-outline-enhanced-dark:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}


.btn-outline-enhanced-dark:active {
  transform: translateY(0);
}


/* Category Preview Cards (Dark/Glass Theme) */
.category-preview-card-dark {
  display: block;
  text-decoration: none;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.category-preview-card-dark:hover {
  transform: translateY(-4px);
}


.category-preview-card-dark .card-inner-dark {
  position: relative;
  overflow: hidden;
}


.category-preview-card-dark .card-inner-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
}


.category-preview-card-dark:hover .card-inner-dark::before {
  left: 100%;
}


.category-preview-card-dark::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(18, 167, 80, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}


.category-preview-card-dark:hover::after {
  opacity: 1;
}


/* Pulse Animation for Category Icons */
@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}


.category-preview-card-dark:hover .w-14 {
  animation: iconPulse 0.6s ease-in-out;
}


/* Slide Up Animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.animate-slide-up {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}


/* Staggered Animation Delays */
.animate-slide-up[style*="animation-delay: 0.1s"] {
  animation-delay: 0.1s !important;
}


.animate-slide-up[style*="animation-delay: 0.15s"] {
  animation-delay: 0.15s !important;
}


.animate-slide-up[style*="animation-delay: 0.2s"] {
  animation-delay: 0.2s !important;
}


.animate-slide-up[style*="animation-delay: 0.25s"] {
  animation-delay: 0.25s !important;
}


.animate-slide-up[style*="animation-delay: 0.3s"] {
  animation-delay: 0.3s !important;
}


/* Gradient Text Animation */
@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}


.text-transparent.bg-clip-text {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}


/* Trust Badge Hover Effect */
.trust-badge {
  transition: all 0.3s ease;
}


.trust-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(18, 39, 110, 0.15);
}


/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .animate-float-slow,
  .animate-float-medium,
  .animate-float-fast,
  .category-preview-card-dark .w-14,
  .text-transparent.bg-clip-text {
    animation: none !important;
  }

  .btn-primary-enhanced-dark::before,
  .btn-outline-enhanced-dark::before,
  .category-preview-card-dark .card-inner-dark::before {
    transition: none;
  }
}


/* Mobile Optimizations for Hero */
@media (max-width: 768px) {
  .btn-primary-enhanced-dark,
  .btn-outline-enhanced-dark {
    padding: 12px 24px;
    font-size: 14px;
  }

  .category-preview-card-dark .card-inner-dark {
    padding: 1rem;
  }

  .category-preview-card-dark .w-14 {
    width: 3rem;
    height: 3rem;
  }

  .category-preview-card-dark .material-symbols-rounded.text-2xl {
    font-size: 1.5rem;
  }
}


@keyframes checkboxPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}


.btn-primary {
  background: #0f766e;
  color: white;
}


.btn-primary:hover {
  background: #0d5f54;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(15, 118, 110, 0.3);
}


.btn-secondary {
  background: white;
  color: #64748b;
  border: 1px solid #d1d5db;
}


.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}


/* Responsive Design */
@media (max-width: 1024px) {
  .filter-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 320px;
    height: 100vh;
    z-index: 50;
    border-radius: 0;
    transition: left 0.3s ease-out;
  }

  .filter-sidebar.open {
    left: 0;
  }

  .mobile-filter-toggle {
    display: flex;
  }

  .filter-overlay.show {
    display: block;
  }
}


@media (max-width: 768px) {
  .filter-sidebar {
    width: 280px;
  }

  .filter-section {
    padding: 1rem;
  }

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

  .size-option {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
  }

  .color-option {
    width: 28px;
    height: 28px;
  }
}


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


@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}


.material-symbols-rounded {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}


/* Responsive Typography */
.text-4xl {
  font-size: 2rem;
}

.text-3xl {
  font-size: 1.75rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-lg {
  font-size: 1.125rem;
}


/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .py-12 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
  .py-8 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
  .px-6 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .gap-12 {
    gap: 2rem;
  }
  .gap-8 {
    gap: 1.5rem;
  }
  .gap-6 {
    gap: 1rem;
  }
  .gap-4 {
    gap: 0.75rem;
  }
  .gap-3 {
    gap: 0.5rem;
  }
}


/* Header adjustments */
@media (max-width: 640px) {
  header .flex {
    flex-direction: row;
    gap: 0.5rem;
    text-align: center;
  }

  header h1 {
    font-size: 1.5rem;
  }

  header nav a {
    font-size: 0.875rem;
  }
}


@media (min-width: 768px) {
  .main-image {
    height: 500px;
  }
}


@media (min-width: 768px) {
  .thumb {
    width: 80px;
    height: 60px;
    min-width: 80px;
  }
}


@media (min-width: 768px) {
  .gallery-nav {
    width: 45px;
    height: 45px;
  }
}


@media (min-width: 768px) {
  .gallery-prev {
    left: 15px;
  }
  .gallery-next {
    right: 15px;
  }
}


@media (min-width: 768px) {
  .tab-button {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-width: auto;
  }
}


@media (min-width: 768px) {
  .tab-content {
    padding: 2rem;
  }
}


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


@media (max-width: 640px) {
  .download-card {
    padding: 1rem;
  }
}


@media (min-width: 768px) {
  .download-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
}


/* Mobile responsive layout for download cards */
@media (max-width: 640px) {
  .download-card .flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .download-card .download-btn {
    width: 100%;
    justify-content: center;
  }

  .download-card .text-left {
    width: 100%;
  }
}


@media (min-width: 768px) {
  .spec-table {
    font-size: 1rem;
  }
}


@media (min-width: 768px) {
  .spec-table th {
    padding: 0.75rem;
    font-size: 1rem;
  }
}


@media (min-width: 768px) {
  .spec-table td {
    padding: 0.75rem;
  }
}


/* Mobile-specific layout adjustments */
@media (max-width: 768px) {
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }

  .grid-cols-3 {
    grid-template-columns: 1fr;
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .lg\:grid-cols-2 {
    grid-template-columns: 1fr;
  }

  .lg\:grid-cols-3 {
    grid-template-columns: 1fr;
  }
}


/* CTA Section - Mobile Optimized */
@media (max-width: 640px) {
  .bg-primary-700 {
    padding: 2rem 1rem;
  }

  .flex-col.sm\:flex-row {
    gap: 1rem;
  }

  .px-6.py-3 {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}


/* Applications Section - Mobile */
@media (max-width: 640px) {
  .bg-primary-50,
  .bg-secondary-50 {
    padding: 1rem;
  }

  .text-3xl {
    font-size: 1.5rem;
  }

  .material-symbols-rounded.text-3xl {
    font-size: 2rem;
  }
}


/* Content adjustments for small screens */
@media (max-width: 640px) {
  .prose {
    font-size: 0.875rem;
  }

  .list-disc li {
    margin-bottom: 0.5rem;
  }

  .bg-yellow-50,
  .bg-red-50,
  .bg-gray-50,
  .bg-primary-50 {
    padding: 1rem;
  }
}


/* Make tables scrollable on mobile */
@media (max-width: 640px) {
  .w-full.border-collapse {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .w-full.border-collapse table {
    min-width: 500px;
  }
}


@keyframes pillEnter {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}


@media (min-width: 768px) {
  .modal-content {
    grid-template-columns: 1fr 1fr;
  }
}


/* On fine-pointer devices, hide the quick-view button until the card is
   hovered or a descendant has focus. Touch devices and keyboard users always
   see the button (they can't hover to reveal it). */
@media (hover: hover) and (pointer: fine) {
  .product-card .quick-view-btn {
    opacity: 0;
    transform: scale(0.9);
  }
  .product-card:hover .quick-view-btn,
  .product-card:focus-within .quick-view-btn {
    opacity: 1;
    transform: scale(1);
  }
  .product-card:hover .quick-view-btn:hover {
    transform: scale(1.1);
  }
}


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


/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-card img,
  .modal-container,
  .filter-bottom-sheet,
  .active-filter-pill,
  .product-card.skeleton *,
  .skeleton-image,
  .skeleton-badge,
  .skeleton-title,
  .skeleton-text,
  .skeleton-button {
    animation: none !important;
    transition: none !important;
  }

  .product-card:hover {
    transform: none;
  }
}


/* Mobile Responsive Enhancements */
@media (max-width: 767px) {
  .active-filters-section {
    padding: 0.75rem;
  }

  .active-filters-container {
    gap: 0.5rem;
  }

  .modal-container {
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
  }

  .modal-content {
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .sheet-container {
    border-radius: 16px 16px 0 0;
  }
}


/* Touch-Optimized Controls for Mobile */
@media (max-width: 767px) {
  .filter-label {
    padding: 0.875rem 0.75rem;
    min-height: 44px;
  }

  .sort-dropdown {
    padding: 0.75rem;
    min-height: 44px;
  }

  .modal-close {
    width: 44px;
    height: 44px;
  }

  .sheet-close-btn {
    padding: 0.75rem;
    min-width: 44px;
  }
}


/* Improve Mobile Filter Button */
#mobile-filter-trigger {
  position: relative;
}


#mobile-filter-trigger::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
}


@keyframes fadeInProduct {
  to {
    opacity: 1;
  }
}


/* Print Styles */
@media print {
  .filter-sidebar,
  .sort-controls,
  .active-filters-section,
  #mobile-filter-trigger,
  .quick-view-modal,
  .filter-bottom-sheet {
    display: none !important;
  }

  .product-card {
    break-inside: avoid;
  }
}


/* ============================================
   PARTNER LOGO SECTION STYLES
   ============================================ */

/* Partner Grid Container */
.partners-grid {
  perspective: 1000px;
}


/* Partner Card Reveal Animation */
.partner-card-wrapper {
  animation: fadeSlideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-play-state: paused; /* Paused until triggered by Intersection Observer */
}


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


/* Staggered Animation Delays */
.partner-card-wrapper:nth-child(1) {
  animation-delay: 0ms;
}

.partner-card-wrapper:nth-child(2) {
  animation-delay: 50ms;
}

.partner-card-wrapper:nth-child(3) {
  animation-delay: 100ms;
}

.partner-card-wrapper:nth-child(4) {
  animation-delay: 150ms;
}

.partner-card-wrapper:nth-child(5) {
  animation-delay: 200ms;
}

.partner-card-wrapper:nth-child(6) {
  animation-delay: 250ms;
}

.partner-card-wrapper:nth-child(7) {
  animation-delay: 300ms;
}

.partner-card-wrapper:nth-child(8) {
  animation-delay: 350ms;
}

.partner-card-wrapper:nth-child(9) {
  animation-delay: 400ms;
}

.partner-card-wrapper:nth-child(10) {
  animation-delay: 450ms;
}


/* 3D Hover Effect on Cards */
.partner-card {
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}


.partner-card:hover {
  transform: translateY(-8px) rotateX(2deg) rotateY(2deg);
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.8),
    0 0 40px -10px rgba(124, 58, 237, 0.1);
}


/* Logo Pulse Animation on Hover */
.partner-logo {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}


.partner-card:hover .partner-logo {
  animation: logoPulse 0.6s ease-out;
}


@keyframes logoPulse {
  0%,
  100% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1.15);
  }
}


/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .partner-card {
    padding: 1.5rem;
  }

  .partner-logo {
    height: 3rem;
  }

  /* On mobile, play animations immediately (no Intersection Observer needed) */
  .partner-card-wrapper {
    animation-play-state: running;
  }
}


/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  .partner-card-wrapper {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .partner-card:hover {
    transform: none;
  }

  .partner-logo {
    animation: none;
  }
}

