﻿/* Comparison specific styles - inheriting main.css */

/* Adjust for fixed nav from main.css */
body {
  padding-top: 80px; 
}

/* Hero */
.hero {
  padding: 3rem 5% 2rem;
  text-align: center;
  background: var(--bg-surface-2); /* Use variable */
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
  color: var(--brand-primary);
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

/* Product Type Selector */
.type-selector {
  padding: 2rem 5%;
  background: #f5f5f7;
}

.type-selector .container {
  max-width: 1200px;
  margin: 0 auto;
}

.type-selector h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  text-align: center;
}

.type-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.type-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid #d2d2d7;
  border-radius: 980px;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
}

.type-btn:hover {
  border-color: #0071e3;
}

.type-btn.active {
  background: #0071e3;
  color: #fff;
  border-color: #0071e3;
}

/* Comparison Container */
.comparison-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 5%;
}

/* Product Selection */
.product-selection {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

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

@media (max-width: 900px) {
  .product-selection {
  grid-template-columns: repeat(2, 1fr);
  }
}

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

.product-selector {
  background: #f5f5f7;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  position: relative;
}

.product-selector h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.product-dropdown {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  cursor: pointer;
}

.product-image {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
  background: #fff;
  border-radius: 8px;
}

.product-image img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.product-name {
  font-weight: 600;
  font-size: 1.25rem;
  margin-top: 0.5rem;
}

/* Comparison Table */
.comparison-table {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  border: 1px solid #f5f5f7;
}

.table-header {
  display: grid;
  grid-template-columns: 220px repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e8e8ed;
  position: sticky;
  top: 73px;
  z-index: 100;
}

@media (max-width: 1200px) {
  .table-header {
  grid-template-columns: 220px repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .table-header {
  grid-template-columns: 220px repeat(2, 1fr);
  }
}

.table-header > div {
  padding: 1.5rem;
  font-weight: 600;
  color: #1d1d1f;
  font-size: 1.1rem;
}

.table-row {
  display: grid;
  grid-template-columns: 220px repeat(4, 1fr);
  border-bottom: 1px solid #f5f5f7;
  transition: background-color 0.2s;
}

.table-row:hover {
  background-color: #fafafa;
}

@media (max-width: 1200px) {
  .table-row {
  grid-template-columns: 220px repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .table-row {
  grid-template-columns: 220px repeat(2, 1fr);
  }
}

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

.spec-label {
  padding: 1.5rem;
  font-weight: 500;
  background: #fafafa;
  border-right: 1px solid #f5f5f7;
  color: #424245;
}

.spec-value {
  padding: 1.5rem;
  color: #1d1d1f;
  font-weight: 400;
}

.spec-category {
  grid-column: 1 / -1;
  padding: 1rem 1.5rem;
  background: #f5f5f7;
  color: #1d1d1f;
  font-weight: 600;
  font-size: 1.125rem;
  border-bottom: 1px solid #e8e8ed;
  border-top: 1px solid #e8e8ed;
}

/* Actions */
.actions {
  text-align: center;
  padding: 2rem 0;
}

.btn {
  padding: 0.875rem 1.75rem;
  border-radius: 980px;
  border: 1px solid #0071e3;
  color: #0071e3;
  background: transparent;
  text-decoration: none;
  display: inline-block;
  margin: 0.5rem;
  transition: all 0.3s;
}

.btn:hover {
  background: #0071e3;
  color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  .table-header,
  .table-row {
  display: flex;
  flex-direction: column;
  }

  .spec-label {
  border-right: none;
  border-bottom: 1px solid #e8e8ed;
  }

  .type-buttons {
  flex-direction: column;
  }

  .type-btn {
  width: 100%;
  }
}

/* Hide/show based on selection */
.hidden {
  display: none;
}

/* ============================================
   ADDITIONAL MOBILE RESPONSIVE IMPROVEMENTS
   ============================================ */

/* Enhanced tablet view */
@media (max-width: 1024px) {
  nav {
    padding: 0.8rem 3%;
  }
  
  .hero {
    padding: 2.5rem 3% 1.5rem;
  }
  
  .type-selector {
    padding: 1.5rem 3%;
  }
  
  .comparison-container {
    padding: 1.5rem 3%;
  }
}

/* Mobile improvements */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }
  
  nav {
    padding: 0.8rem 4%;
    position: sticky;
  }
  
  nav .nav-container {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  nav .logo {
    font-size: 1.2rem;
  }
  
  nav a {
    font-size: 0.8rem;
  }
  
  .hero {
    padding: 2rem 4% 1.5rem;
  }
  
  .hero h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    margin-bottom: 0.75rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .type-selector {
    padding: 1.5rem 4%;
  }
  
  .type-selector h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .type-buttons {
    gap: 0.75rem;
  }
  
  .type-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    width: 100%;
  }
  
  .comparison-container {
    padding: 1.5rem 4%;
  }
  
  .product-selection {
    gap: 1rem;
    margin-bottom: 2rem;
  }
  
  .product-selector {
    padding: 1rem;
  }
  
  .product-selector h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .product-dropdown {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  .product-image {
    height: 150px;
    margin: 0.75rem 0;
  }
  
  .product-image img {
    max-height: 130px;
  }
  
  .product-name {
    font-size: 1.1rem;
  }
  
  /* Mobile table layout */
  .comparison-table {
    border-radius: 12px;
    overflow: visible;
  }
  
  .table-header {
    display: none;
  }
  
  .table-row {
    display: block;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #e8e8ed;
    padding-bottom: 0.5rem;
  }
  
  .table-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
  }
  
  .spec-label {
    border-right: none;
    border-bottom: none;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    background: #f5f5f7;
    border-radius: 8px 8px 0 0;
  }
  
  .spec-value {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    background: #fff;
    border-bottom: 1px solid #f5f5f7;
  }
  
  .spec-value:last-child {
    border-radius: 0 0 8px 8px;
  }
  
  .spec-category {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    margin-top: 0.5rem;
    border-radius: 8px;
  }
  
  .actions {
    padding: 1.5rem 0;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
    margin: 0.5rem auto;
    display: block;
    padding: 0.75rem 1.5rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  nav .logo {
    font-size: 1rem;
  }
  
  nav a {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
  
  .hero {
    padding: 1.5rem 3% 1rem;
  }
  
  .hero h1 {
    font-size: clamp(1.3rem, 7vw, 1.8rem);
  }
  
  .hero p {
    font-size: 0.9rem;
  }
  
  .type-selector {
    padding: 1rem 3%;
  }
  
  .type-selector h2 {
    font-size: 1rem;
  }
  
  .type-btn {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
  }
  
  .comparison-container {
    padding: 1rem 3%;
  }
  
  .product-selector {
    padding: 0.75rem;
  }
  
  .product-selector h3 {
    font-size: 0.95rem;
  }
  
  .product-dropdown {
    padding: 0.5rem;
    font-size: 0.85rem;
  }
  
  .product-image {
    height: 120px;
  }
  
  .product-image img {
    max-height: 110px;
  }
  
  .product-name {
    font-size: 1rem;
  }
  
  .spec-label,
  .spec-value {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .spec-category {
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
  }
}

/* Prevent horizontal scroll */
@media (max-width: 768px) {
  * {
    max-width: 100%;
  }
  
  .comparison-table,
  .product-selection,
  .type-buttons {
    overflow-x: hidden;
  }
}
