/* ===== PROFESSIONAL E-COMMERCE THEME ===== */
/* Optimized for Trust, Conversions & User Experience */

/* Import clean, professional font + premium serif */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700;800&display=swap');

/* CSS Variables for Trust-Building Color Palette */
:root {
  /* Primary Colors - Blue for Trust */
  --primary-blue: #0066c0;
  --primary-blue-dark: #004d99;
  --primary-blue-light: #0080ff;
  
  /* Accent Colors - Orange for Action */
  --accent-orange: #ff9900;
  --accent-orange-dark: #e68a00;
  --accent-green: #28a745;
  
  /* Backgrounds */
  --bg-white: #ffffff;
  --bg-light: #f8f9fa;
  --bg-gray: #f0f2f5;
  
  /* Text Colors */
  --text-dark: #333333;
  --text-medium: #666666;
  --text-light: #999999;
  
  /* Borders & Shadows */
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light));
  --gradient-hero: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* ===== GLOBAL RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  /* Background will be set per page for variety */
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== MODERN HEADER ===== */
header {
  background: #2d3748;
  position: relative;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 20px;
  min-height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s ease;
  letter-spacing: -0.5px;
}

.brand:hover {
  color: #ffd814;
}

/* Header Logo */
.header-logo {
  height: 35px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.brand:hover .header-logo {
  transform: scale(1.05);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

nav ul li a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  transition: all 0.3s ease;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

nav ul li a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

nav ul li a.favorites-link {
  background: rgba(231, 76, 60, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

nav ul li a.favorites-link:hover {
  background: rgba(231, 76, 60, 0.25);
  border-color: rgba(231, 76, 60, 0.5);
  color: #ffffff;
  transform: translateY(-2px);
}

/* ===== HERO SECTION ===== */
/* Hero styles are now in index.php for customization */

/* ===== PRODUCT SECTIONS ===== */
.product-gallery {
  padding: 3rem 0;
  background: transparent;
}

.product-gallery:nth-child(even) {
  background: transparent;
}

/* Section Header with View All Link */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.product-gallery h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  text-align: left;
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: 0.75rem;
}

.product-gallery h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #a8c7fa, #fcc6f5);
  border-radius: 2px;
}

.view-all-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.view-all-link:hover {
  color: #004d99;
  background: rgba(0, 102, 192, 0.05);
  transform: translateX(4px);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 0;
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ===== ELEVATED PRODUCT CARDS ===== */
.product-card {
  background: var(--bg-white);
  border: 1px solid rgba(0, 102, 192, 0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%; /* Ensure all cards fill the same height */
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 4px 8px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 102, 192, 0.08);
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(168, 199, 250, 0.03) 0%, rgba(252, 198, 245, 0.03) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  pointer-events: none;
}

.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.08),
    0 16px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(168, 199, 250, 0.3);
  border-color: rgba(168, 199, 250, 0.4);
}

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

.product-card-image {
  width: 100%;
  height: 220px; /* Fixed height for all images */
  object-fit: contain; /* Show full image without cutting */
  transition: transform 0.3s ease;
  background: var(--bg-gray);
  flex-shrink: 0; /* Prevent image from shrinking */
  padding: 0.5rem; /* Add padding so image doesn't touch edges */
}

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

.product-card-content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.product-card-content h3 {
  font-size: 1.05rem;
  font-weight: 400;
  margin: 0 0 0.5rem 0;
  color: var(--text-dark);
  line-height: 1.4;
  min-height: 2.8em; /* Fixed height for 2 lines (2 x 1.4em line-height) */
  max-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-prime-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 1.2em;
  margin-bottom: 0.5rem;
}

.product-brand {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  line-height: 1.2;
}

.product-card-content p {
  color: var(--text-medium);
  line-height: 1.5;
  margin-bottom: auto; /* Push footer to bottom */
  font-size: 0.85rem;
  min-height: 4.5em; /* Fixed height for 3 lines (3 x 1.5em) */
  max-height: 4.5em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== PRODUCT RATING ===== */
.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  min-height: 1.5em; /* Reserve space for rating */
  line-height: 1.5;
}

.rating-stars {
  display: flex;
  gap: 0.15rem;
  color: #ffa41c;
  font-size: 0.95rem;
}

.rating-stars i {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.rating-value {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.rating-count {
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ===== PRIME LOGO ===== */
.prime-badge {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.prime-badge img {
  height: 18px;
  width: auto;
  max-width: 65px;
  object-fit: contain;
  opacity: 0.9;
}

/* ===== PRODUCT CARD FOOTER ===== */
.product-card-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  position: relative;
  z-index: 1;
  margin-top: 0.5rem; /* Move price closer up */
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.price-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.product-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: flex-start;
  line-height: 1;
  white-space: nowrap;
}

.product-price .cents {
  font-size: 0.6em;
  font-weight: 600;
  margin-left: 0.1em;
  vertical-align: top;
  position: relative;
  top: 0.1em;
}

.product-actions {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.product-actions .secondary {
  flex: 0 0 auto;
  min-width: 80px;
}

.product-actions .primary {
  width: 100%;
  text-align: center;
}

/* ===== TRUST-BUILDING BUTTONS ===== */
.cta-button {
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
}

/* Primary CTA - Orange for Maximum Conversion with High Contrast */
.cta-button.primary {
  background: var(--accent-orange);
  color: #000000;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(255, 153, 0, 0.3);
}

.cta-button.primary:hover {
  background: var(--accent-orange-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 153, 0, 0.4);
}

/* Secondary CTA - Subtle for Details */
.cta-button.secondary {
  background: var(--bg-white);
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue);
}

.cta-button.secondary:hover {
  background: var(--primary-blue);
  color: var(--bg-white);
  transform: translateY(-2px);
}

/* ===== FAVORITE TOGGLE ===== */
.favorite-toggle {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 1.1rem;
  z-index: 2;
  backdrop-filter: blur(8px);
}

.favorite-toggle:hover {
  background: var(--bg-white);
  color: #e74c3c;
  transform: scale(1.15);
  border-color: #e74c3c;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.favorite-toggle.favorited {
  background: #e74c3c;
  color: var(--bg-white);
  border-color: #e74c3c;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.favorite-toggle.favorited:hover {
  background: #c0392b;
  transform: scale(1.15);
}

/* ===== FOOTER ===== */
footer {
  background: var(--text-dark);
  color: var(--bg-white);
  padding: 2.5rem 0 1.5rem;
  text-align: center;
  margin-top: 3rem;
}

footer p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

footer a {
  color: var(--accent-orange);
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--accent-orange-dark);
  text-decoration: underline;
}

/* ===== BADGES & LABELS ===== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.featured {
  background: var(--accent-orange);
  color: var(--bg-white);
}

.badge.new {
  background: var(--accent-green);
  color: var(--bg-white);
}

/* ===== LOADING ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
  }
}

@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .brand {
    font-size: 1.3rem;
  }
  
  .header-logo {
    height: 30px;
    max-width: 120px;
  }
  
  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  nav ul li a {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }
  
  .hero {
    padding: 2rem 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .product-gallery {
    padding: 2rem 0;
  }
  
  /* Horizontal Scrolling Product Cards on Mobile */
  .product-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 1rem;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding: 0.5rem 0 1.5rem 0;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }
  
  /* Hide scrollbar for Chrome, Safari and Opera */
  .product-grid::-webkit-scrollbar {
    display: none;
  }
  
  /* Product cards take fixed width and don't shrink */
  .product-grid .product-card {
    flex: 0 0 280px; /* Fixed width, no shrink */
    min-width: 280px;
    max-width: 280px;
    min-height: 480px; /* Fixed minimum height for consistency */
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }
  
  .product-actions {
    gap: 0.5rem;
  }
  
  .product-price {
    font-size: 1.225rem; /* 30% smaller than 1.75rem */
    text-align: center;
    justify-content: center;
  }
  
  /* Add padding to container to show first/last card properly */
  .product-gallery .container {
    overflow: visible;
  }
  
  /* Optional: Add scroll indicator hint */
  .product-grid::after {
    content: '';
    flex: 0 0 1px;
    width: 1px;
  }
}

@media (max-width: 480px) {
  nav ul li a {
    font-size: 0.8rem;
    padding: 0.45rem 0.6rem;
  }
  
  /* Smaller card width for very small screens */
  .product-grid .product-card {
    flex: 0 0 260px;
    min-width: 260px;
    max-width: 260px;
    min-height: 460px; /* Slightly smaller but still consistent */
  }
  
  .product-gallery h2 {
    font-size: 1.5rem;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ===== PROFESSIONAL SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ===== SMOOTH SCROLL BEHAVIOR ===== */
html {
  scroll-behavior: smooth;
}

/* ===== FOCUS STATES FOR ACCESSIBILITY ===== */
a:focus,
button:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
  header,
  footer,
  .favorite-toggle,
  .cta-button {
    display: none;
  }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--text-dark);
  color: var(--bg-white);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  max-width: 300px;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-notification.toast-success {
  background: var(--accent-green);
  color: var(--bg-white);
}

.toast-notification.toast-error {
  background: #e74c3c;
  color: var(--bg-white);
}

.toast-notification.toast-info {
  background: var(--primary-blue);
  color: var(--bg-white);
}

@media (max-width: 640px) {
  .toast-notification {
    bottom: 20px;
    right: 20px;
    left: 20px;
    max-width: none;
  }
}
