/* Modern 2025 Design System */
:root {
  /* Colors */
  --primary: #0891b2;
  --primary-hover: #0e7490;
  --secondary: #10b981;
  --background: #ffffff;
  --foreground: #4b5563;
  --card: #f9fafb;
  --border: #e2e8f0;
  --muted: #6b7280;
  --accent: #10b981;

  /* Typography */
  --font-sans: "Geist Sans", system-ui, -apple-system, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, sans-serif;

  /* Spacing */
  --radius: 0.5rem;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .nav {
    display: flex;
  }
}

.nav-link {
  color: var(--foreground);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-container {
  position: relative;
  display: none;
}

@media (min-width: 640px) {
  .search-container {
    display: block;
  }
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
}

.search-input {
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  width: 16rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.1);
}

.icon-btn {
  padding: 0.5rem;
  border: none;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  border-radius: var(--radius);
  transition: background-color 0.2s;
}

.icon-btn:hover {
  background-color: var(--card);
}

.icon-btn i {
  font-size: 1.25rem;
}

/* Main Content */
.main {
  padding: 2rem 0;
}

.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--muted);
  max-width: 32rem;
  margin: 0 auto;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  /* Added flexbox layout for consistent card heights */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.product-image-container {
  position: relative;
  overflow: hidden;
}

.product-image {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
}

.product-card:hover .product-overlay {
  background: rgba(0, 0, 0, 0.2);
  opacity: 1;
}

.product-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--secondary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: calc(var(--radius) * 0.5);
  font-size: 0.75rem;
  font-weight: 500;
}

.product-content {
  padding: 1.5rem;
  /* Make content area flexible to push footer to bottom */
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.product-description {
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.feature-badge {
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--foreground);
  padding: 0.25rem 0.5rem;
  border-radius: calc(var(--radius) * 0.5);
  font-size: 0.75rem;
}

.product-price {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  /* Push price to bottom of content area */
  margin-top: auto;
}

.product-footer {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--background);
}

.btn-outline {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--card);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-large {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Product Details Page */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

.breadcrumb-link {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb-current {
  color: var(--muted);
}

.product-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .product-details {
    grid-template-columns: 1fr 1fr;
  }
}

.main-image {
  margin-bottom: 1rem;
}

.detail-image {
  width: 100%;
  height: 25rem;
  object-fit: cover;
  border-radius: var(--radius);
}

.image-thumbnails {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.thumbnail {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: calc(var(--radius) * 0.5);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.thumbnail.active,
.thumbnail:hover {
  opacity: 1;
}

.detail-title {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.detail-description {
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.features-section {
  margin-bottom: 2rem;
}

.features-title {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.features-list {
  list-style: none;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.feature-item i {
  color: var(--secondary);
  font-size: 1.25rem;
}

.price-section {
  margin-bottom: 2rem;
}

.detail-price {
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .action-buttons {
    flex-direction: row;
  }
}

/* Footer */
.footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-title {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

.footer-subtitle {
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-text {
  color: var(--muted);
  margin-bottom: 1rem;
}

.footer-link {
  display: block;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }
}