/* Base styles */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #333;
  background-color: #fafafa;
}

/* Top navigation */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 40px;
  background-color: #0a0a0a;
  color: #d4af37;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.logo a {
  font-size: 24px;
  font-weight: bold;
  color: #d4af37;
  text-decoration: none;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
}

nav a {
  color: #d4af37;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
  color: #ffffff;
}

.contact-info {
  font-size: 14px;
  color: #d4af37;
}

/* Hero section */
.hero {
  position: relative;
  height: 90vh;
  background: url('images/hero.png') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 70px;
}

.hero-overlay {
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 40px;
  border-radius: 8px;
  max-width: 80%;
  text-align: center;
}

.hero h1 {
  margin: 0 0 20px 0;
  font-size: 36px;
}

.hero p {
  margin: 0 0 20px 0;
  font-size: 18px;
}

.cta-button {
  display: inline-block;
  padding: 12px 24px;
  background-color: #d4af37;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.cta-button:hover {
  background-color: #bfa12a;
}

/* Section styles */
section {
  padding: 60px 40px;
  margin-top: 60px;
}

section h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 28px;
}

.intro p,
.about p {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Offers and results */
.offers {
  background-color: #f5f5f5;
  padding-top: 100px;
}

.offer-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  width: 300px;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-info {
  padding: 15px;
  text-align: left;
  color: #333;
}

.card-info h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
}

.card-info p {
  margin: 0 0 10px 0;
  color: #666;
}

.card-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  color: #444;
}

.card-info li {
  margin-bottom: 5px;
}

.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #d41e1e;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

/* Search form */
.search-form {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.search-form .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.search-form label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.search-form input,
.search-form select {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 120px;
}

.search-form button {
  padding: 10px 20px;
  background-color: #d4af37;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  margin-top: auto;
}

.search-form button:hover {
  background-color: #bfa12a;
}

/* Sell & buy section */
.sell-buy {
  padding-top: 100px;
}
.sell-buy .grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}
.sell-buy .grid-item {
  flex: 1 1 250px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.sell-buy .grid-item h3 {
  margin-top: 0;
  color: #d4af37;
}
.sell-buy .grid-item p {
  color: #555;
}

/* Testimonials */
.testimonials {
  padding-top: 100px;
}
.testimonial-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}
.testimonial-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  width: 300px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-style: italic;
}
.testimonial-card span {
  display: block;
  margin-top: 10px;
  font-weight: bold;
  color: #333;
}

/* Contact */
.contact {
  background-color: #f5f5f5;
  padding-top: 100px;
}
.contact-details p {
  margin: 5px 0;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 500px;
  margin: 0 auto 20px auto;
}
.contact-form input,
.contact-form textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}
.contact-form button {
  padding: 10px 20px;
  background-color: #d4af37;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  align-self: flex-start;
}
.contact-form button:hover {
  background-color: #bfa12a;
}

/* Footer */
footer {
  background-color: #0a0a0a;
  color: #d4af37;
  text-align: center;
  padding: 20px;
}

/* Description section fix */
.offer-container,
.offer-container > * {
  margin-bottom: 0 !important;
}

.description-block {
  margin-top: 5px !important;
  padding-top: 0 !important;
  max-width: 90%;
  border: none;
}

.description-block h3 {
  margin: 5px 0 10px 0 !important;
  padding: 0 !important;
}

.description-block pre {
  margin: 0 !important;
  padding: 0 !important;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.6;
  font-family: inherit;
  color: #333;
  background: none;
  border: none;
}
.gallery {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-photo-wrapper {
  position: relative;
  width: 100%;
}

.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  font-size: 24px;
  border-radius: 4px;
  z-index: 10;
}

.prev-btn {
  left: 10px;
}

.next-btn {
  right: 10px;
}

.gallery-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
}
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#lightbox img {
  max-width: 90%;
  max-height: 80%;
  box-shadow: 0 0 15px #fff;
}

.close-lightbox {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  font-size: 30px;
  border-radius: 4px;
  z-index: 10;
  transform: translateY(-50%);
}

.lightbox-btn:hover {
  background-color: rgba(255, 255, 255, 0.6);
}

.lightbox-btn.prev-btn {
  left: 20px;
}

.lightbox-btn.next-btn {
  right: 20px;
}

/* Naprawa problemu z pozycją opisu przy krótkim tekście */
.description-block {
  display: block;
  width: 100% !important;
  clear: both;
  float: none;
}

#offer-detail {
  display: flex;
  flex-wrap: wrap;
}

#offer-detail .gallery {
  flex: 1 1 60%;
  min-width: 300px;
}

#offer-detail .details {
  flex: 1 1 35%;
  min-width: 250px;
}

/* Opis zawsze bezpośrednio pod galerią */
#offer-detail .description-block {
  flex: none;
  width: 100%;
  margin-top: 10px;
  padding: 0;
}
/* MOBILE RESPONSIVE FIXES */

/* Zdjęcia dopasowane do ekranu */
img {
  max-width: 100%;
  height: auto;
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  color: #d4af37;
  cursor: pointer;
}

@media (max-width: 768px) {
  .top-bar {
    flex-wrap: wrap;
  }

  nav ul {
    flex-direction: column;
    background-color: #0a0a0a;
    position: absolute;
    top: 60px;
    right: 0;
    width: 200px;
    display: none;
    padding: 10px;
    z-index: 999;
  }

  nav ul.show {
    display: flex;
  }

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .card {
    width: 100% !important;
  }

  .contact-form input,
  .contact-form textarea {
    width: 100%;
  }
}

.about p {
  text-align: justify;
}


/* Fix: odstęp od górnej belki + brak luki pod zdjęciami */
.offer-container {
  margin-top: 0 !important;
  padding-top: 80px;
  align-items: flex-start;
}

.gallery img.main-photo {
  display: block;
  margin-bottom: 0 !important;
}

.thumbnails {
  margin-bottom: 0 !important;
}

.description-block {
  margin-top: 0 !important;
  padding-top: 10px !important;
}

/* Fix: responsywna galeria na stronie oferty */
@media (max-width: 768px) {
  .offer-container {
    flex-direction: column;
  }
  #offer-detail .gallery {
    flex: 1 1 100%;
    width: 100%;
  }
  #offer-detail .details {
    flex: 1 1 100%;
    width: 100%;
  }
  .gallery img.main-photo {
    width: 100% !important;
    height: auto !important;
    max-height: 300px !important;
    object-fit: contain !important;
  }
  .thumbnails {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .thumbnails img {
    width: 70px !important;
    height: 55px !important;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  /* Ukryj niepotrzebne elementy */
  header, footer, nav, .menu-toggle, .contact-info,
  #sticky-call, .thumbnails, .print-button,
  .contact-form-offer, .gallery-btn, h4,
  a[href^="tel"] {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
    margin: 0;
  }

  /* Layout wydruku — wszystko w jednej kolumnie */
  .offer-container {
    display: block !important;
    padding-top: 0 !important;
    margin: 0 !important;
  }

  /* Nagłówek wydruku */
  .offer-container::before {
    content: "KRK Property | krkproperty.pl | tel. 725 302 793";
    display: block;
    text-align: center;
    font-size: 13pt;
    font-weight: bold;
    color: #000;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 8px;
    margin-bottom: 16px;
  }

  /* Główne zdjęcie — jedno, wyśrodkowane */
  .main-photo-wrapper {
    text-align: center;
    margin-bottom: 16px;
  }

  .gallery img.main-photo {
    max-width: 60% !important;
    max-height: 280px !important;
    object-fit: contain !important;
    border: 1px solid #ccc;
  }

  /* Szczegóły oferty */
  .details {
    background: none !important;
    padding: 0 !important;
    margin-bottom: 16px;
  }

  .details h2 {
    font-size: 16pt;
    margin: 8px 0;
  }

  .details h3 {
    font-size: 13pt;
    margin: 4px 0 12px 0;
    color: #000;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
  }

  td {
    padding: 4px 6px;
    border-bottom: 1px solid #ddd;
    font-size: 11pt;
  }

  /* Opis */
  .description-block {
    margin-top: 12px !important;
    page-break-inside: avoid;
  }

  .description-block h3 {
    font-size: 13pt;
    border-top: 1px solid #d4af37;
    padding-top: 8px;
  }

  /* Stopka wydruku z kontaktem */
  .description-block::after {
    content: "Kontakt: Krystian Czekaj | tel. 725 302 793 | kczekaj@krkproperty.pl | www.krkproperty.pl";
    display: block;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
    font-size: 10pt;
    color: #555;
    text-align: center;
  }

  /* Linki bez podkreśleń */
  a {
    text-decoration: none !important;
    color: #000 !important;
  }
}
