/* Use consistent design tokens from sap-styles.css */
.sap-homepage {
  color: #333;
  background: #ffffff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  box-sizing: border-box;
  overflow: visible;
  position: relative;
}

.sap-container { max-width: 100%; padding: 0; margin: 0; }

.sap-hero { 
  position: relative; 
  padding: 4rem 0 3rem; 
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  margin-bottom: 3rem;
  z-index: 10;
  overflow: visible;
  border-bottom: 1px solid #a5b4fc;
}

/* Clean hero variant */
.sap-hero--clean {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border: none;
  text-align: center;
  position: relative;
}

/* Add subtle pattern overlay */
.sap-hero--clean::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.04) 2px, transparent 2px),
    radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.sap-hero-bg {
  display: none; /* Remove background gradient */
}

.sap-hero-content {
  position: relative;
  z-index: 2;
}

.sap-hero-title { 
  font-size: 2rem; 
  line-height: 1.2; 
  margin: 0 0 1.5rem; 
  font-weight: 600; 
  color: #333;
  text-align: center;
}
.sap-hero-subtitle { 
  font-size: 1rem; 
  color: #666; 
  margin: 0 auto 2rem; 
  max-width: 65ch; 
  line-height: 1.6;
  text-align: center;
}

/* Hero Actions Layout */
.sap-hero-actions {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  margin: 2rem 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Search Wrapper - takes up more space */
.sap-hero-search-wrapper {
  flex: 1;
  position: relative;
}

.sap-hero-search {
  width: 100%;
}

/* Clean Search Input Group */
.sap-search-input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid #e1e5ea;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.sap-search-input-group:focus-within {
  border-color: #0073aa;
  box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
}

.sap-hero-search input[type="search"] {
  width: 100%;
  padding: 1rem 1.5rem;
  background: transparent;
  color: #333;
  border: none;
  outline: none;
  font-size: 1.1rem;
  font-weight: 400;
  border-radius: 50px;
}

.sap-hero-search input[type="search"]::placeholder {
  color: #888;
  font-weight: 400;
}

/* Compatibility Check Button */
.sap-hero-compatibility {
  flex-shrink: 0;
}

.sap-compatibility-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: transparent;
  color: #0073aa;
  border: 2px solid #0073aa;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.sap-compatibility-trigger:hover {
  background: #0073aa;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.sap-compatibility-trigger svg {
  width: 20px;
  height: 20px;
}

/* Search Results Dropdown */
.sap-hero-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #ffffff;
  border: 2px solid #e1e5ea;
  border-top: none;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  max-height: 400px;
  overflow-y: auto;
  margin-top: -2px;
}

/* Hero Badges - Updated styling */
.sap-hero-badges { 
  display: flex; 
  gap: 1rem; 
  flex-wrap: wrap; 
  justify-content: center;
  margin-top: 2rem;
}

/* Updated badge styling */
.sap-badge {
  background: #f8f9fa;
  border: 1px solid #e1e5ea;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  color: #666;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.sap-section { 
  padding: 3rem 0; 
  position: relative;
  overflow: visible;
}
.sap-section--alt { 
  background: #f5f5f5; 
}
.sap-section-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 1.5rem; 
}
.sap-section-header h2 { 
  margin: 0; 
  font-size: 2rem; 
  font-weight: 600;
  color: #333;
}
.sap-link { 
  color: #0073aa; 
  text-decoration: none; 
  font-weight: 500;
  transition: color 0.2s ease;
}
.sap-link:hover { color: #005177; }

/* Dimension Form Styles */
.sap-dimension-section {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 2rem;
  margin: 3rem 0;
  position: relative;
  z-index: 5;
}

.sap-dimension-form {
  max-width: 800px;
  margin: 0 auto;
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  box-shadow: none;
}

.sap-dimension-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.sap-input-group {
  display: flex;
  flex-direction: column;
}

.sap-input-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 0.5rem;
}

.sap-input-group input {
  padding: 0.6rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.sap-input-group input:focus {
  outline: none;
  border-color: #0073aa;
}

.sap-compatibility-results {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #f5f5f5;
  border-radius: 4px;
  border: 1px solid #ddd;
}

/* Use suitcase grid styling for consistency */
.sap-airline-grid-4x2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (max-width: 767px) {
  .sap-airline-grid-4x2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Align with sap-suitcase-item styling */
.sap-airline-card {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  text-align: center;
  transition: box-shadow 0.3s ease;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 120px;
  font-size: 0.9rem;
}

.sap-airline-card:hover {
  opacity: 0.9;
}

/* Make airline stat boxes fully clickable */
.sap-airline-stat { position: relative; }
.sap-airline-stat .sap-card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  text-decoration: none;
}

.sap-airline-name {
  font-weight: normal;
  color: #333;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.sap-airline-count {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.3;
}

.sap-card-link {
  text-decoration: none;
  color: #333;
  display: block;
}

.sap-card-link:hover {
  color: #0073aa;
}

/* Only airline cards use full-card clickable overlay */
.sap-airline-card {
  position: relative;
}
.sap-airline-card .sap-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Homepage suitcase grid now uses standard sap-suitcase-grid but with 4 columns on desktop */
.sap-homepage .sap-suitcase-grid {
  grid-template-columns: repeat(4, 1fr);
  position: static;
}

.sap-homepage .sap-suitcase-item {
  position: static;
}

.sap-homepage .sap-suitcase-item .sap-card-link {
  position: static;
  display: block;
}

@media (max-width: 767px) {
  .sap-homepage .sap-suitcase-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Remove unused styles - suitcases now use standard sap-suitcase-item layout */

/* Remove card actions since cards are now fully clickable */

/* Compatibility Results */
.sap-airline-grid-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.sap-airline-result {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.sap-airline-result h4 {
  margin: 0 0 0.5rem;
}

.sap-airline-result h4 a {
  color: #333;
  text-decoration: none;
}

.sap-airline-result h4 a:hover {
  color: #0073aa;
}

.sap-compat-info {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
}

.sap-card {
  background: #ffffff;
  border: 1px solid var(--sap-border); 
  border-radius: var(--sap-radius);
  box-shadow: var(--sap-shadow); 
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex; 
  flex-direction: column; 
  overflow: hidden;
}
.sap-card:hover { 
  transform: translateY(-2px); 
  border-color: var(--sap-accent); 
  box-shadow: var(--sap-shadow-hover); 
}

.sap-card-media { 
  aspect-ratio: 4/3; 
  overflow: hidden; 
  background: var(--sap-surface); 
}
.sap-card-media img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block; 
  transition: transform 0.2s ease;
}
.sap-card:hover .sap-card-media img {
  transform: scale(1.05);
}

.sap-card-body { padding: var(--sap-space-4); }
.sap-card-title { 
  margin: 0 0 0.5rem; 
  font-size: 1.1rem; 
  font-weight: 600;
  color: var(--sap-text);
}
.sap-card-meta { 
  margin: 0; 
  color: var(--sap-muted); 
  font-size: 0.9rem; 
}

.sap-chips { 
  list-style: none; 
  padding: 0 var(--sap-space-4) var(--sap-space-4); 
  margin: 0; 
  display: flex; 
  gap: 0.5rem; 
  flex-wrap: wrap; 
}
.sap-chips li { 
  background: #f0f0f1; 
  border: 1px solid #ddd; 
  padding: 0.25rem 0.5rem; 
  border-radius: 999px; 
  font-size: 0.8rem; 
  color: #666;
  font-weight: 500;
}

.sap-card-cta { padding: 0 var(--sap-space-4) var(--sap-space-4); margin-top: auto; }

.sap-btn {
  appearance: none; 
  border: 1px solid transparent; 
  border-radius: 4px;
  padding: 0.75rem 1.25rem; 
  font-weight: 500; 
  font-size: 0.9rem;
  cursor: pointer; 
  text-decoration: none; 
  display: inline-flex; 
  align-items: center; 
  gap: 0.5rem;
  transition: all 0.2s ease;
  text-align: center;
}
.sap-btn--primary { 
  color: #ffffff; 
  background: #0073aa; 
}
.sap-btn--primary:hover { 
  background: #005177;
  color: #ffffff;
  text-decoration: none;
}
.sap-btn--ghost { 
  color: #0073aa; 
  background: transparent; 
  border-color: #0073aa; 
}
.sap-btn--ghost:hover { 
  background: #0073aa;
  color: #ffffff;
}

.sap-cta { 
  text-align: center; 
  background: #f5f5f5; 
  border: 1px solid #ddd; 
  border-radius: 4px; 
  padding: 3rem; 
}
.sap-cta h2 { 
  margin-top: 0; 
  margin-bottom: 1rem; 
  color: #333;
  font-weight: 600;
}
.sap-cta p { 
  margin-top: 0; 
  margin-bottom: 0;
  color: #666; 
  font-size: 1.1rem;
}
.sap-cta-actions { 
  display: flex; 
  justify-content: center; 
  gap: 1rem; 
  margin-top: 1.5rem; 
}

/* Modal Styles */
.sap-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sap-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.sap-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 6px 14px rgba(0,0,0,.10);
  padding: 2rem;
  border: 1px solid #ddd;
  margin: 1.5rem;
}

.sap-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background-color 0.2s ease;
}

.sap-modal-close:hover {
  background: #ddd;
}

/* Search Results Overlay */
.sap-hero-search-results {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 6px 14px rgba(0,0,0,.10);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 4px;
}

.sap-search-section {
  padding: 1rem;
}

.sap-search-section:not(:first-child) {
  border-top: 1px solid #ddd;
}

.sap-search-section h3 {
  margin: 0 0 0.8rem;
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sap-search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sap-search-result-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.sap-search-result-item:hover {
  background: #f5f5f5;
}

.sap-search-result-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.sap-search-result-image {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
}

.sap-search-result-title {
  font-size: 0.9rem;
  font-weight: 500;
}

.sap-search-result-meta {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.25rem;
}

.sap-search-loading,
.sap-search-no-results {
  padding: 1.5rem;
  text-align: center;
  color: #666;
  font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .sap-homepage {
    padding: 1rem;
  }
  .sap-hero {
    padding: 3rem 0 2rem;
  }
  .sap-hero-actions {
    flex-direction: column;
    max-width: 100%;
    gap: 1rem;
  }
  .sap-hero-search-wrapper {
    width: 100%;
  }
  .sap-hero-compatibility {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .sap-search-input-group {
    border-radius: 25px;
  }
  .sap-hero-search input[type="search"] {
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
  }
  .sap-compatibility-trigger {
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
    width: 100%;
    justify-content: center;
  }
  .sap-hero-search-results {
    border-radius: 0 0 15px 15px;
  }
  .sap-hero-badges {
    gap: 0.8rem;
    margin-top: 1.5rem;
  }
  .sap-badge {
    font-size: 0.8rem;
    padding: 0.35rem 0.8rem;
  }
  .sap-dimension-inputs {
    grid-template-columns: 1fr;
  }
  .sap-airline-grid-4x2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .sap-section {
    padding: 2rem 0;
  }
  .sap-hero {
    padding: 2rem 0 1.5rem;
  }
  .sap-hero-actions {
    gap: 0.8rem;
  }
  .sap-hero-search input[type="search"] {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
  }
  .sap-compatibility-trigger {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }
  .sap-compatibility-trigger span {
    display: none;
  }
  .sap-compatibility-trigger::after {
    content: 'Enter Dimensions';
  }
  .sap-hero-badges {
    justify-content: center;
    margin-top: 1.2rem;
  }
  .sap-section-header {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }
  .sap-dimension-form {
    padding: 1rem;
  }
  .sap-airline-grid-4x2 {
    grid-template-columns: 1fr;
  }
}

/* ========================= POLISH OVERRIDES ========================= */
/* Base typography and layout smoothing */
.sap-homepage {
  background: var(--sap-bg);
}
.sap-homepage * { box-sizing: border-box; }
.sap-homepage h1, .sap-homepage h2, .sap-homepage h3 { color: #202428; letter-spacing: 0.2px; }
.sap-homepage p { color: var(--sap-muted); }

/* Hero polish */
.sap-hero { background: var(--sap-surface); }
.sap-hero .sap-container { display: flex; justify-content: center; }
.sap-hero-content { max-width: 960px; width: 100%; }
.sap-hero-title { font-weight: 700; }
.sap-hero-subtitle { font-size: 1.05rem; }
.sap-hero-badges { gap: 10px; }
.sap-badge { background: var(--sap-surface-alt); border-color: var(--sap-border); }

/* Section headings */
.sap-section h2 { font-weight: 700; letter-spacing: 0.1px; }

/* Inputs and focus */
.sap-input-group input, .sap-hero-search input[type="search"] {
  background: #fff;
  border-color: #e1e5ea;
}
.sap-input-group input:focus, .sap-hero-search input[type="search"]:focus {
  border-color: #9ac7e6;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}

/* Buttons */
.sap-btn--primary { background: var(--sap-accent); }
.sap-btn--primary:hover { background: var(--sap-accent-hover); }
.sap-btn--ghost { border-color: var(--sap-accent); color: var(--sap-accent); }
.sap-btn--ghost:hover { background: var(--sap-accent); color: #fff; }

/* Airline cards polish */
.sap-airline-card { border-color: var(--sap-border); }
.sap-airline-card:hover { border-color: #c6d9e8; }
.sap-airline-count { color: var(--sap-accent); }

/* Suitcase product cards */
.sap-trending-suitcase-card { border-color: var(--sap-border); box-shadow: var(--sap-shadow); }
.sap-trending-suitcase-card:hover { box-shadow: var(--sap-shadow-hover); }
.sap-suitcase-name a { font-weight: 600; }

/* Compatibility count accent */
.sap-compat-count { color: #0a76d7; }

/* Modal animations */
.sap-modal { opacity: 0; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease; }
.sap-modal[style*="display: block"] { opacity: 1; transform: translateY(0); }
.sap-modal-content { animation: sapModalIn .22s ease; }
@keyframes sapModalIn { from { transform: translateY(8px); opacity: .9; } to { transform: translateY(0); opacity: 1; } }

/* Search dropdown polish */
.sap-hero-search-results { border-color: var(--sap-border); box-shadow: var(--sap-shadow-hover); }
.sap-search-result-item { padding: 10px 12px; }
.sap-search-result-item:hover { background: #f6f9fc; }

/* Grid gaps */
.sap-airline-grid-4x2 { gap: 20px; }
.sap-suitcase-grid-4x2 { gap: 22px; }

/* Section spacing */
.sap-section { padding-top: 56px; padding-bottom: 56px; }

/* Fine-tune headings on mobile */
@media (max-width: 640px) {
  .sap-hero-title { font-size: 1.8rem; }
  .sap-hero-subtitle { font-size: 1rem; }
}
