/* PillowHub - Pillow Comparison Directory */
:root {
  --primary: #5B4B8A;
  --primary-dark: #483A6E;
  --secondary: #8FD6E1;
  --accent: #F4A261;
  --bg-light: #FAF9FC;
  --bg-white: #FFFFFF;
  --text-dark: #2D2D3A;
  --text-muted: #6B6B7A;
  --border: #E5E5EB;
  --success: #4CAF50;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* Header */
header {
  background: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo svg {
  width: 32px;
  height: 32px;
}

nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav a {
  color: var(--text-dark);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.2s;
}

nav a:hover::after {
  width: 100%;
}

.mobile-menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  margin: 5px 0;
  transition: 0.3s;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 4rem 1.5rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: white;
}

.btn-secondary {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.25);
  color: white;
}

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

/* Section */
section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

/* Category Cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.category-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-icon svg {
  width: 40px;
  height: 40px;
  color: var(--primary);
}

.category-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

.category-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.category-card .btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.9rem;
}

/* Product Comparison Table */
.comparison-table-wrapper {
  overflow-x: auto;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.comparison-table th,
.comparison-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  background: var(--bg-light);
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
}

.comparison-table tr:hover {
  background: var(--bg-light);
}

.comparison-table .product-cell {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.comparison-table .product-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-light);
}

.comparison-table .product-name {
  font-weight: 600;
  color: var(--text-dark);
}

.comparison-table .product-brand {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #FFB800;
}

.rating-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-left: 0.25rem;
}

.price {
  font-weight: 600;
  color: var(--success);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge-soft { background: #E8F5E9; color: #2E7D32; }
.badge-medium { background: #FFF3E0; color: #E65100; }
.badge-firm { background: #E3F2FD; color: #1565C0; }
.badge-side { background: #F3E5F5; color: #7B1FA2; }
.badge-back { background: #E0F7FA; color: #00838F; }
.badge-stomach { background: #FBE9E7; color: #BF360C; }
.badge-all { background: #F5F5F5; color: #616161; }

/* Product Cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.product-card-image {
  height: 200px;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-body {
  padding: 1.5rem;
}

.product-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.product-card .brand {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.product-card .specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.product-card .price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Filters */
.filters {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-group select {
  padding: 0.625rem 2rem 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-white);
  font-size: 0.95rem;
  color: var(--text-dark);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6B7A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

/* Content Sections */
.content-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.content-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.content-section h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-dark);
}

.content-section p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.content-section ul, .content-section ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.content-section li {
  margin-bottom: 0.5rem;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.feature-content h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text-dark);
}

.feature-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Quick Quiz */
.quiz-section {
  background: linear-gradient(135deg, var(--secondary) 0%, #7BC4D0 100%);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  color: var(--text-dark);
}

.quiz-section h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.quiz-section p {
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Footer */
footer {
  background: var(--text-dark);
  color: white;
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: white;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: rgba(255,255,255,0.7);
  transition: color 0.2s;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
}

.affiliate-disclosure {
  background: rgba(255,255,255,0.05);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}

/* Breadcrumb */
.breadcrumb {
  padding: 1rem 0;
  display: flex;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb span {
  color: var(--border);
}

/* Page Header */
.page-header {
  background: var(--bg-white);
  padding: 2rem 0;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-muted);
  max-width: 700px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    box-shadow: var(--shadow);
  }

  nav ul.active {
    display: flex;
  }

  nav li {
    border-bottom: 1px solid var(--border);
  }

  nav a {
    display: block;
    padding: 1rem;
  }

  .mobile-menu {
    display: block;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .quiz-section {
    padding: 2rem 1.5rem;
  }

  .filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .filter-group select {
    width: 100%;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Spec Table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table tr {
  border-bottom: 1px solid var(--border);
}

.spec-table tr:last-child {
  border-bottom: none;
}

.spec-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 40%;
  background: var(--bg-light);
}

.spec-table td {
  padding: 0.75rem 1rem;
  color: var(--text-dark);
}

/* Pros/Cons */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.pros, .cons {
  padding: 1.5rem;
  border-radius: var(--radius);
}

.pros {
  background: #E8F5E9;
}

.cons {
  background: #FFEBEE;
}

.pros h4, .cons h4 {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pros h4 { color: #2E7D32; }
.cons h4 { color: #C62828; }

.pros ul, .cons ul {
  list-style: none;
  margin: 0;
}

.pros li, .cons li {
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.pros li::before {
  content: '+';
  position: absolute;
  left: 0;
  color: #2E7D32;
  font-weight: bold;
}

.cons li::before {
  content: '-';
  position: absolute;
  left: 0;
  color: #C62828;
  font-weight: bold;
}

@media (max-width: 600px) {
  .pros-cons {
    grid-template-columns: 1fr;
  }
}
