body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #ffffff;
  color: #111827;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 1rem;
}

.product-card {
  background: white;
  overflow: hidden;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 1.5rem;
}

/* Bildegalleri */
.image-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.main-image-container {
  background-color: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-image {
  width: 100%;
  height: 100%;
  max-height: 400px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.thumbnail-container {
  display: flex;
  gap: 0.75rem;
}

.thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.thumbnail:hover {
  border-color: #9ca3af;
}

.thumbnail.active {
  border-color: #111827;
  box-shadow: 0 0 0 2px #d1d5db;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Produktinformasjon */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-title {
  font-size: 2rem;
  font-weight: bold;
  color: #111827;
}

.product-subtitle {
  color: #6b7280;
  margin-bottom: 1rem;
}

.rating {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.star {
  color: #fbbf24;
  font-size: 1.25rem;
}

.price {
  font-size: 2rem;
  font-weight: bold;
  color: #111827;
  margin-bottom: 1.5rem;
}

/* Produkthandlinger */
.product-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.quantity-selector {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

.quantity-btn {
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.quantity-btn:hover {
  background-color: #f3f4f6;
}

.quantity-display {
  padding: 0.5rem 1rem;
  font-weight: 500;
  min-width: 60px;
  text-align: center;
}

.add-to-cart-btn {
  flex: 1;
  background-color: #111827;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.2s ease;
}

.add-to-cart-btn:hover {
  background-color: #000000;
}

.cart-icon {
  width: 20px;
  height: 20px;
}

/* Modellvelger */
.model-selector {
  width: 100%;
}

.model-dropdown {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background-color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.model-dropdown:focus {
  outline: none;
  border-color: #6b7280;
  box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.1);
}

/* Produktdetaljer */
.product-details {
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.detail-label {
  font-weight: 500;
  color: #374151;
}

.detail-value {
  color: #111827;
}

.availability {
  color: #059669;
  font-weight: 500;
}

/* Fire handlingsknapper */
.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.action-btn:hover {
  background-color: #f9fafb;
}

.action-icon {
  width: 20px;
  height: 20px;
  color: #374151;
}

/* Faner */
.tabs-section {
  border-top: 1px solid #e5e7eb;
}

.tab-buttons {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  justify-content: center;
}

.tab-button {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.tab-button:hover {
  color: #374151;
  background-color: #f9fafb;
}

.tab-button.active {
  color: #111827;
  background-color: #f9fafb;
  border-bottom-color: #111827;
}

.tab-content {
  padding: 1.5rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.feature-list {
  list-style: none;
  margin-top: 1rem;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.feature-icon {
  width: 16px;
  height: 16px;
  color: #6b7280;
}

/* Rich HTML (intro_html) typography + table styling */
.rich-html h2,
.rich-html h3 {
  margin: 0.5rem 0 0.75rem;
  line-height: 1.3;
}

.rich-html p {
  margin: 0.5rem 0 1rem;
}

.rich-html ul,
.rich-html ol {
  margin: 0.5rem 0 1rem 1.25rem;
}

.rich-html table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.rich-html thead th {
  background: #f9fafb;
}

.rich-html th,
.rich-html td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.rich-html tbody tr:nth-child(even) {
  background: #fafafa;
}

/* Model specs box above the buy button */
.model-specs {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  background: #f9fafb;
  margin: 8px 0 12px;
}
.model-specs.hidden {
  display: none;
}
.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.spec {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
}
.spec-label {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 4px;
}
.spec-value {
  font-weight: 600;
  color: #111827;
}
@media (max-width: 640px) {
  .spec-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Top Specs (max 4 chips) --- */
#top-specs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 10px;
}
@media (max-width: 900px) {
  #top-specs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.spec-chip {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
}
.spec-chip .spec-name {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 4px;
}
.spec-chip .spec-value {
  font-weight: 600;
  color: #111827;
  line-height: 1.2;
}

/* --- Asset viewers in tabs --- */
.asset-slot iframe {
  width: 100%;
  height: 700px;
}

.asset-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.asset-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px;
}
.asset-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  display: block;
}
.asset-caption {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #374151;
}

/* Generic asset slots (PDFs, images, links) */
.asset-slot {
  display: block;
  padding: 0.5rem 0;
}
.asset-slot a {
  color: #1f2937;
  text-decoration: underline;
}
.asset-slot iframe,
.asset-slot img {
  max-width: 100%;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.asset-switchbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 6px;
}
.asset-switch {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
}
.asset-switch:hover {
  background: #f9fafb;
}
.asset-switch.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

/* Relaterte produkter */
.related-products {
  border-top: 1px solid #e5e7eb;
  padding: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  color: #111827;
  margin-bottom: 1.5rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.product-card-small {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.product-card-small:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.product-card-small img {
  width: 100%;
  height: 160px;
  object-fit: contain;
}

.product-info-small {
  padding: 1rem;
}

.product-info-small h3 {
  font-weight: 500;
  color: #111827;
  margin-bottom: 0.5rem;
}

.price-small {
  color: #111827;
  font-weight: bold;
}

/* Horizontal scroller for related products */
#related-products {
  display: flex;
  gap: 1rem;
  padding-bottom: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
#related-products::-webkit-scrollbar {
  height: 8px;
}
#related-products::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}
#related-products::-webkit-scrollbar-track {
  background: transparent;
}

.product-card-small {
  flex: 0 0 260px; /* fixed card width */
  scroll-snap-align: start;
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}
.breadcrumb a {
  color: #374151;
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb .sep {
  margin: 0 6px;
  color: #9ca3af;
}

#sheetContent { display: flex; flex-direction: column; }
#sheetButtons { order: 0; }
#sheetViewer  { order: 1; }

@media (min-width: 1024px) {
  #related-products {
    gap: 1.25rem;
  }
  .product-card-small {
    flex-basis: 280px;
  }
}

/* Responsivt design */
@media (max-width: 768px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }

  .tab-buttons {
    flex-wrap: wrap;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }

  .container {
    padding: 1rem;
  }

  .product-layout {
    margin-top: 40px;
  }
}
