:root {
  --primary-color: #2c3e50;
  --secondary-color: #0098FF;
  --accent-color: #27ae60; /* Zmieniamy z czerwonego na zielony */
  --success-color: #27ae60; /* Dodajemy nową zmienną dla zieleni */
  --light-gray: #ecf0f1;
  --dark-gray: #7f8c8d;
  --szary: #BDBDBD;
  --black: #000000;
  --white: #ffffff;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'Roboto Mono', monospace;
}

body {
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
  color: var(--primary-color);
  line-height: 1.6;
}

.color-value, code, pre {
  font-family: var(--font-mono);
}

h1 {
  font-weight: 700; /* Montserrat wygląda lepiej z boldem */
  /* ... */
}

details summary {
  font-weight: 600;
  /* ... */
}

.total {
  font-weight: 500;
  /* ... */
}

@supports (font-variation-settings: normal) {
  body {
    font-family: 'Inter var', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  }
}

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Roboto+Mono&display=swap');

header {
  text-align: center;
  padding: 30px 20px;
  background-color: var(--white);
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
}

.logo {
  max-width: 180px;
  height: auto;
  margin-bottom: 15px;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  margin-top: 10px;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.gallery {
  text-align: center;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

#main-photo {
  width: 100%;
  max-width: 800px;
  height: 500px;
  border-radius: 12px;
  box-shadow: var(--box-shadow);
  object-fit: cover;
  transition: var(--transition);
}

.thumbnails {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--szary);
  padding: 15px 25px;
  text-align: center;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.total-price {
  font-weight: 700;
  font-size: 24px;
  color: var(--secondary-color);
  background: white;
  padding: 10px 30px;
  border-radius: 30px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--secondary-color);
}

.total-price:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}
/* Dodaj padding na dole body, aby zawartość nie była zasłaniana przez przyklejony footer */
body {
  padding-bottom: 80px; /* Dostosuj tę wartość w zależności od wysokości twojego footera */
}

.thumbnails img {
  cursor: pointer;
  width: 120px;
  height: 80px;
  border: 2px solid transparent;
  border-radius: 8px;
  object-fit: cover;
  transition: var(--transition);
}

.thumbnails img:hover {
  border-color: var(--secondary-color);
  transform: translateY(-3px);
}

.thumbnails img.active {
  border-color: var(--secondary-color);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.main-photo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

/* Nowoczesne rozwijane sekcje */
details {
  background: var(--white);
  margin: 20px auto;
  padding: 0;
  border-radius: 12px;
  box-shadow: var(--box-shadow);
  max-width: 1000px;
  overflow: hidden;
  transition: var(--transition);
}

details[open] {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

details summary {
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  padding: 20px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--primary-color);
  transition: var(--transition);
}

details summary:hover {
  background-color: var(--light-gray);
}

details summary::after {
  content: "+";
  font-size: 24px;
  font-weight: 400;
  color: var(--secondary-color);
  transition: var(--transition);
}

details[open] summary::after {
  content: "−";
  transform: rotate(0deg);
}

details[open] summary {
  border-bottom: 1px solid var(--light-gray);
}

details > div {
  padding: 20px;
}

#total-price {
  font-weight: 700;
  font-size: 35px;
  color: var(--secondary-color); /* Zmiana na zielony */

}

footer {
  padding: 25px;
  background: var(--szary);
  text-align: center;
  font-size: 16px;
  color: var(--black);
  margin-top: 40px;
}

.total {
  font-size: 20px;
  text-align: center;
  margin: 30px auto;
  padding: 20px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--box-shadow);
  max-width: 500px;
  /* Dodajemy obramowanie */
  border: 2px dashed var(--secondary-color);
    outline: 2px solid var(--success-color);
  outline-offset: 3px;
}

.total span {
  font-weight: 700;
  color: var(--success-color); /* Zmiana na zielony */
}

.price-highlight {
  color: var(--success-color);
  font-weight: 600;
}



/* Style dla tabeli z danymi technicznymi */
.specs-table-container {
  margin: 20px 0;
  overflow-x: auto;
  border-radius: 8px;
}

.specs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 16px;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
}

.specs-table th, 
.specs-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--light-gray);
}

.specs-table th {
  font-weight: 600;
  color: var(--white);
  background-color: var(--secondary-color);
  width: 40%;
}

.specs-table td {
  font-weight: 500;
  color: var(--primary-color);
  background-color: var(--white);
}

.specs-table tr:last-child td {
  border-bottom: none;
}

.specs-table tr:hover td {
  background-color: rgba(52, 152, 219, 0.05);
}

/* Style dla wyposażenia podstawowego */
.standard-equipment {
  background-color: var(--white);
  padding: 25px;
  border-radius: 12px;
  margin: 25px 0;
  box-shadow: var(--box-shadow);
}

.standard-equipment h3 {
  color: var(--secondary-color);
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 22px;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 10px;
  font-weight: 600;
}

.equipment-list {
  columns: 2;
  column-gap: 40px;
  padding-left: 0;
  list-style-type: none;
}

.equipment-list li {
  margin-bottom: 12px;
  break-inside: avoid;
  position: relative;
  color: var(--primary-color);
  font-size: 16px;
  line-height: 1.6;
  padding-left: 25px;
}

.equipment-list li:before {
  content: "✓";
  color: var(--secondary-color);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.error {
  color: #721c24;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Style dla konfiguratora kolorów */
.color-configurator {
  margin: 40px auto;
  padding: 30px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--box-shadow);
  max-width: 1000px;
}

.color-configurator h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 30px;
  font-size: 26px;
  font-weight: 700;
  text-align: center;
}

.color-table-container {
  overflow-x: auto;
  margin-bottom: 30px;
  border-radius: 8px;
}

.color-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 16px;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
}

.color-table th {
  padding: 18px;
  text-align: left;
  background-color: var(--primary-color);
  color: var(--white);
  font-weight: 600;
  border-bottom: 2px solid var(--light-gray);
}

.color-table td {
  padding: 18px;
  border-bottom: 1px solid var(--light-gray);
  vertical-align: middle;
}

.part-name-cell {
  font-weight: 600;
  color: var(--primary-color);
  min-width: 180px;
}

.colors-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.color-cell {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.color-cell:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.color-cell.selected {
  box-shadow: 0 0 0 3px var(--secondary-color), 0 4px 12px rgba(0,0,0,0.2);
  transform: scale(1.1);
}

.color-cell.selected::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'><path d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/></svg>");
  background-size: contain;
}

.selected-colors {
  margin-top: 40px;
  padding: 30px;
  background-color: var(--light-gray);
  border-radius: 12px;
  border: none;
}

.selected-colors h4 {
  margin-top: 0;
  margin-bottom: 25px;
  font-size: 20px;
  color: var(--primary-color);
  text-align: center;
  font-weight: 600;
}

#color-selections {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

#color-selections li {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--white);
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: var(--transition);
}

#color-selections li:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.color-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.part-name {
  font-weight: 600;
  color: var(--primary-color);
}

.color-value {
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  color: var(--dark-gray);
}

/* Animacje */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

details > div {
  animation: fadeIn 0.3s ease-out;
}

.kategoria {
  margin-bottom: 2rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
}

.option-group {
  margin-bottom: 1.5rem;
}

.opcja {
  margin: 0.5rem 0;
  padding: 0.5rem;
  border-radius: 4px;
  background: #f9f9f9;
  transition: all 0.3s;
}

.opcja.disabled-option {
  opacity: 0.6;
  text-decoration: line-through;
  background: #f0f0f0;
}

.opcja.disabled-option label {
  cursor: not-allowed;
}

.opcja.disabled-option input[type="checkbox"] {
  pointer-events: none;
}

.quantity-controls {
  margin-left: 10px;
}

.quantity-input {
  width: 50px;
  margin-left: 5px;
  padding: 3px;
}

.cena {
  color: green;
  font-weight: bold;
  margin-left: 10px;
}

.error {
  color: red;
  padding: 1rem;
  background: #ffeeee;
  border-radius: 4px;
}

.quantity-range {
  color: #666;
  font-size: 0.9em;
}

.quantity-controls {
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
}

.quantity-controls input {
  margin-left: 5px;
}

.cena {
  margin-left: 10px;
  font-weight: bold;
  color: green;
  min-width: 80px;
  display: inline-block;
}

/* Responsywność */
@media (max-width: 1200px) {
  .gallery {
    padding: 20px 30px;
  }
  
  details {
    margin: 20px 30px;
  }
}

@media (max-width: 992px) {
  #main-photo {
    height: 400px;
  }
  
  .thumbnails img {
    width: 100px;
    height: 70px;
  }
  
  .color-configurator {
    padding: 25px;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
    line-height: 1.5;
  }
  
  h1 {
    letter-spacing: -0.3px;
  }
}

/* Lepsze wyświetlanie cyfr w cenie */
#total-price {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
  #main-photo {
    height: 350px;
  }
  
  .thumbnails img {
    width: 80px;
    height: 56px;
  }
  
  .equipment-list {
    columns: 1;
  }
  
  .specs-table th, 
  .specs-table td {
    padding: 12px 15px;
  }
  
  .color-table {
    font-size: 14px;
  }
  
  .color-table th,
  .color-table td {
    padding: 14px;
  }
  
  .color-cell {
    width: 40px;
    height: 40px;
  }
  
  details summary {
    font-size: 18px;
    padding: 16px;
  }
}

@media (max-width: 576px) {
  header {
    padding: 20px 15px;
  }
  
  .logo {
    max-width: 140px;
  }
  
  #main-photo {
    height: 250px;
    border-radius: 8px;
  }
  
  .thumbnails {
    gap: 8px;
  }
  
  .thumbnails img {
    width: 60px;
    height: 42px;
  }
  
  .color-configurator {
    padding: 20px 15px;
  }
  
  .color-table th,
  .color-table td {
    padding: 10px 8px;
    font-size: 13px;
  }
  
  .color-cell {
    width: 32px;
    height: 32px;
  }
  
  #color-selections li {
    padding: 12px 18px;
    font-size: 14px;
  }
  
  .total {
    font-size: 18px;
    padding: 15px;
  }
  
  #total-price {
    font-size: 20px;
  }
}