/* ===== Färgtema: blå ===== */
:root {
  --bg: #e9f1ff;              /* ljusblå bakgrund */
  --primary: #005bbb;         /* mörkare blå */
  --primary-dark: #004c99;    /* ännu lite mörkare */
  --text: #1c1c1c;
  --card-bg: #ffffff;
}

/* ===== Grundlayout ===== */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2rem;
}

/* ===== Header ===== */
.site-header {
  background: var(--primary);
  color: #fff;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.header-inner h1 {
  margin: 0;
}

.tagline {
  margin-top: 0.2rem;
  opacity: 0.95;
}

/* små kontaktuppgifter i header */
.contact-mini p {
  margin: 0.1rem 0;
  font-size: 0.9rem;
}

.site-header a {
  color: #fff;
  text-decoration: none;
}

/* ===== Navigation ===== */
.main-nav {
  border-top: 1px solid rgba(255,255,255,0.3);
  margin-top: 0.5rem;
}

.nav-inner a {
  margin-right: 1rem;
  font-size: 0.95rem;
}

.nav-inner a:hover {
  text-decoration: underline;
}

/* ===== Hero/Visitkort ===== */
.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.hero-text {
  flex: 2;
  min-width: 240px;
}

.business-card {
  flex: 1;
  min-width: 240px;
  background: var(--card-bg);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  border-left: 6px solid var(--primary);
}

.business-card h3 {
  margin-top: 0;
}

.business-card a {
  color: var(--primary-dark);
}

/* ===== Sökruta ===== */
.parts-search {
  margin-top: 2rem;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.search-form input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #aac7ff;
  background: #fff;
}

.search-form button {
  padding: 0.6rem 1.3rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.search-form button:hover {
  background: var(--primary-dark);
}

/* ===== Produktkort ===== */
.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.part-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 0.8rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border-top: 4px solid var(--primary);
}

.part-card img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.part-truck {
  font-size: 0.9rem;
  color: #444;
}

.part-price {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0.3rem 0;
}

.part-status {
  font-size: 0.85rem;
  color: #007a00;
  font-weight: 600;
}

.part-desc {
  font-size: 0.9rem;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--primary);
  color: #fff;
  padding: 1rem 0;
  margin-top: 3rem;
}

.site-footer a {
  color: #fff;
  text-decoration: underline;
}

/* ===== Mobil ===== */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; }
}
/* Klickbar produktbild */
.part-img { cursor: zoom-in; }

/* Modal */
.modal { display: none; }
.modal.open { display: block; }

.modal-lock { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 999;
}

.modal-content {
  position: fixed;
  z-index: 1000;
  inset: 5% 5%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(0,0,0,0.04);
}

.modal-header h3 {
  margin: 0;
  font-size: 1rem;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-main {
  flex: 1;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem;
  background: #f7f9ff;
}

.modal-main-img {
  width: 100%;
  height: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.nav-btn {
  height: 44px;
  width: 44px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.15);
  background: #fff;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.modal-thumbs {
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem;
  overflow-x: auto;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.thumb {
  height: 70px;
  width: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  flex: 0 0 auto;
}

.thumb.active {
  border-color: rgba(0,91,187,0.9); /* matchar din blå */
}

/* Mobil */
@media (max-width: 600px) {
  .modal-content { inset: 3% 3%; }
  .modal-main { grid-template-columns: 40px 1fr 40px; }
  .thumb { height: 60px; width: 80px; }
}
/* Sålda produkter */
.part-card.sold {
  opacity: 0.55;
  filter: grayscale(100%);
}

.part-card.sold .part-price {
  text-decoration: line-through;
}

.part-card.sold .part-status {
  color: #a00000;
  font-weight: 700;
}

.sold-toggle {
  margin-top: 0.5rem;
}

.sold-toggle a {
  font-size: 0.9rem;
  color: #004c99;
}
