/* css/pages/products.css - Enhanced Products page styles */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600&display=swap');

/* =====================
   PAGE HEADER
   ===================== */
.page-header {
  text-align: center;
  padding: var(--space-16, 5rem) var(--space-6, 1.5rem) var(--space-12, 3rem);
  background: linear-gradient(135deg, #e8f4fd 0%, #f0f9ff 40%, #e0f2fe 100%);
  margin-bottom: var(--space-12, 3rem);
  border-radius: 0 0 3rem 3rem;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(14, 165, 233, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(59, 130, 246, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.page-header::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  top: -100px; right: -50px;
  animation: floatOrb 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(-20px, 20px) scale(1.05); }
  66%       { transform: translate(10px, -15px) scale(0.95); }
}

.page-header h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: var(--space-4, 1rem);
  background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 60%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeSlideDown 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative; z-index: 1;
}

.page-header p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: #475569; max-width: 600px; margin: 0 auto;
  animation: fadeSlideDown 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
  position: relative; z-index: 1;
}

/* =====================
   KEYFRAMES
   ===================== */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleReveal {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =====================
   PRODUCT CONTROLS
   ===================== */
.product-controls {
  display: flex;
  gap: var(--space-4, 1rem);
  margin-bottom: var(--space-8, 2rem);
  align-items: center;
  flex-wrap: wrap;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 1.25rem;
  border: 1px solid rgba(14, 165, 233, 0.12);
  box-shadow: 0 4px 20px rgba(3, 105, 161, 0.06);
  animation: fadeSlideDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.search-bar {
  flex: 1;
  min-width: 280px;
  position: relative;
}

/* Search icon */
.search-bar::before {
  content: '⌕';
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem !important;
  border: 1.5px solid rgba(14, 165, 233, 0.2) !important;
  border-radius: 0.875rem !important;
  font-size: 0.95rem;
  background: #f8fafc;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #0ea5e9 !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12) !important;
  background: #ffffff;
}

.filter-controls {
  min-width: 200px;
}

.filter-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(14, 165, 233, 0.2);
  border-radius: 0.875rem;
  background-color: #f8fafc;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230369a1' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.filter-select:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
  background-color: #ffffff;
}

/* =====================
   PRODUCTS GRID
   ===================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6, 1.5rem);
  margin: var(--space-6, 1.5rem) 0;
}

/* =====================
   PRODUCT CARDS
   ===================== */
.product-card {
  background: #ffffff;
  border: 1px solid rgba(14, 165, 233, 0.12);
  border-radius: 1.25rem;
  padding: var(--space-6, 1.5rem);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s ease,
              border-color 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: cardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Staggered animation for first 12 cards */
.product-card:nth-child(1)  { animation-delay: 0.03s; }
.product-card:nth-child(2)  { animation-delay: 0.06s; }
.product-card:nth-child(3)  { animation-delay: 0.09s; }
.product-card:nth-child(4)  { animation-delay: 0.12s; }
.product-card:nth-child(5)  { animation-delay: 0.15s; }
.product-card:nth-child(6)  { animation-delay: 0.18s; }
.product-card:nth-child(7)  { animation-delay: 0.21s; }
.product-card:nth-child(8)  { animation-delay: 0.24s; }
.product-card:nth-child(9)  { animation-delay: 0.27s; }
.product-card:nth-child(10) { animation-delay: 0.30s; }
.product-card:nth-child(11) { animation-delay: 0.33s; }
.product-card:nth-child(12) { animation-delay: 0.36s; }

/* Top sweep accent */
.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0369a1, #0ea5e9, #38bdf8);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
  border-radius: 1.25rem 1.25rem 0 0;
}

/* Hover glow blob */
.product-card::after {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.06) 0%, transparent 70%);
  bottom: -50px; right: -50px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(3, 105, 161, 0.14);
  border-color: rgba(14, 165, 233, 0.3);
}

.product-card:hover::before { transform: translateX(0); }
.product-card:hover::after  { opacity: 1; transform: scale(1.3); }

.product-card h3 {
  color: #0369a1;
  margin-bottom: var(--space-3, 0.75rem);
  font-size: 1.1rem;
  font-weight: 700;
  transition: color 0.3s ease;
  line-height: 1.3;
}

.product-card:hover h3 { color: #0284c7; }

.product-meta {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: var(--space-4, 1rem);
  padding: 0.75rem;
  background: linear-gradient(135deg, #f8fafc, #f0f9ff);
  border-radius: 0.75rem;
  border: 1px solid rgba(14, 165, 233, 0.08);
}

.product-meta span {
  font-size: 0.8rem;
  color: #64748b;
}

.product-meta strong {
  color: #334155;
}

.product-description {
  margin-bottom: var(--space-4, 1rem);
  line-height: 1.7;
  font-size: 0.88rem;
  color: #475569;
}

.product-actions {
  display: flex;
  gap: var(--space-3, 0.75rem);
  margin-top: var(--space-4, 1rem);
}

/* Therapy area tags on cards */
.therapy-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0369a1;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  padding: 0.2rem 0.65rem;
  border-radius: 2rem;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

/* =====================
   NO RESULTS
   ===================== */
.no-results {
  text-align: center;
  padding: var(--space-16, 4rem) var(--space-6, 1.5rem);
  color: #94a3b8;
  animation: fadeSlideUp 0.5s ease both;
}

.no-results h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.5rem;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.no-results p { font-size: 0.95rem; }

.hidden { display: none !important; }

/* =====================
   PRODUCT MODAL
   ===================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal__content {
  position: relative;
  background: #ffffff;
  border-radius: 1.75rem;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(3, 105, 161, 0.25);
  animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  overflow: hidden;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: 1px solid rgba(14, 165, 233, 0.12);
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  position: relative;
  overflow: hidden;
}

.modal__header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0369a1, #0ea5e9, #38bdf8);
}

.modal__header h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  color: #0369a1;
  font-size: 1.3rem;
  margin: 0;
  padding-right: 1rem;
}

.modal__close {
  background: rgba(14, 165, 233, 0.1);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  color: #0369a1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.modal__close:hover { background: rgba(14, 165, 233, 0.2); transform: rotate(90deg); }

.modal__body {
  padding: 1.5rem 1.75rem;
}

.product-details {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.product-details p {
  font-size: 0.9rem;
  color: #334155;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(14, 165, 233, 0.08);
  margin: 0;
}

.product-details p:last-child { border-bottom: none; }

.product-details strong {
  color: #0369a1;
  font-weight: 600;
}

.modal__footer {
  padding: 1.25rem 1.75rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  border-top: 1px solid rgba(14, 165, 233, 0.1);
  background: #fafafa;
}

.header__logo-img {
    max-height: 50px; /* Adjust based on your header size */
    width: auto;
    display: block;
}