/* ================= HERO ================= */
.dmn-hero {
  background: url("../img/domena5.jpg") no-repeat center center;
  background-size: cover;
  color: #fff;
  text-align: center;
  padding: 80px 20px;
  position: relative;
}

.dmn-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(61, 15, 98, 0.124);
  z-index: 0;
}

.dmn-hero-container {
  position: relative;
  z-index: 1;
}

.dmn-hero-title {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 15px;
  color: #fff;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
}

/* ================= SEARCH ================= */
.dmn-search {
  margin: 40px auto;
  max-width: 600px;
  display: flex;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  background: #fff;
}

.dmn-search input[type="text"] {
  flex: 1;
  padding: 18px 24px;
  font-size: 18px;
  border: none;
  outline: none;
  color: #333;
}

.dmn-search button {
  background: #ffcc00;
  color: #373737;
  border: none;
  padding: 0 30px;
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
  transition: 0.2s;
}

.dmn-search button:hover {
  background: #ffb400;
}

/* ================= MAIN LAYOUT ================= */
.dmn-content {
  margin: 40px auto;
  padding: 0 20px;
  width: 100%;
  max-width: 1140px; /* dopasowane do .container */
  box-sizing: border-box;
}

.dmn-main {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  width: auto;
  transition: all 0.3s ease;
  flex-direction: row;
  justify-content: center; /* poprawka literówki */
  padding: 0; /* brak odstępu domyślnie */
}

.dmn-main.active {
  padding: 40px; /* odstęp dopiero jak coś się pojawi */
}

/* Wyniki domen */
.dmn-results {
  flex: 1 1 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.1);
  padding: 25px 30px;
  text-align: left;
  transition: flex 0.3s ease;
}

.dmn-results h2 {
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: 600;
  color: #333;
}

/* Koszyk domen */
.dmn-cart {
  flex: 0 0 30%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  padding: 25px;
  display: none;
  transition: all 0.3s ease;
}

.dmn-cart h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

/* Ustawienie szerokości gdy koszyk jest widoczny */
.dmn-main.with-cart .dmn-results {
  flex: 0 0 70%;
}
.dmn-main.with-cart .dmn-cart {
  display: block;
}

/* ================= TABELA DOMEN ================= */
.dmn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.dmn-table td {
  padding: 14px 10px;
  border-bottom: 1px solid #eee;
}

.dmn-table tr:last-child td {
  border-bottom: none;
}

.dmn-table td:nth-child(2) {
  font-weight: bold;
}

.dmn-reserve-btn {
  background: #5b2ca0;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.dmn-reserve-btn:hover {
  background: #431f7a;
}

/* ================= LISTA W KOSZYKU ================= */
#cartList {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

#cartList li {
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f8f8;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 8px;
}

#cartList li button.remove-domain {
  background: none;
  border: none;
  color: #d9534f;
  font-size: 14px;
  cursor: pointer;
}

#cartList li button.remove-domain:hover {
  color: #b52b27;
}

/* ================= SWITCH ================= */
.dmn-contact-box {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.switch {
  position: relative;
  display: inline-block;
  padding-left: 30px;
  font-size: 15px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
}

.switch input {
  display: none;
}

.switch .slider {
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #ccc;
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .slider {
  background: #5b2ca0;
}

/* ================= FORM KOSZYK ================= */
#cartForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#cartForm input {
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border 0.2s;
}

#cartForm input:focus {
  border-color: #5b2ca0;
}

.dmn-submit-btn {
  background: #ffcc00;
  border: none;
  padding: 12px;
  font-size: 16px;
  margin-top: 20px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: 0.2s;
}

.dmn-submit-btn:hover {
  background: #ffb400;
}

#cartStatus {
  margin-top: 10px;
  font-size: 15px;
  color: #333;
}

/* ================= RESPONSYWNOŚĆ ================= */
@media (max-width: 900px) {
  .dmn-main {
    flex-direction: column;
  }
  .dmn-results,
  .dmn-cart {
    flex: 1 1 100%;
  }
}

/* Nagłówki tabeli */
.dmn-table th {
  text-align: left;
  font-weight: 500;
  font-size: 16px;
  color: #141414;
  padding: 0 10px 12px 10px;
  position: relative;
}

/* Gradientowy pasek pod nagłówkiem */
.dmn-table th::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px; /* grubość paska */
  background: linear-gradient(90deg, #924fff, #ff66cc, #cccccc, #ffcc00);
  border-radius: 2px;
}

/* Wyrównanie treści */
.dmn-table td {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid #eee;
  font-size: 15px;
  color: #444;
}

@media (max-width: 600px) {
  /* HERO */
  .dmn-hero {
    padding: 40px 15px;
    text-align: center;
  }
  .dmn-hero-title {
    font-size: 26px;
    line-height: 1.3;
  }

  /* SEARCH */
  .dmn-search {
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
  }
  .dmn-search input[type="text"] {
    font-size: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
  }
  .dmn-search button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border-radius: 0 0 12px 12px;
  }

  /* MAIN LAYOUT */
  .dmn-main {
    flex-direction: column;
    gap: 20px;
  }
  .dmn-results,
  .dmn-cart {
    padding: 18px 16px;
    border-radius: 8px;
  }

  /* TABLE */
  .dmn-table {
    font-size: 14px;
  }
  .dmn-table td,
  .dmn-table th {
    padding: 10px 6px;
  }

  /* KOSZYK */
  .dmn-cart h3 {
    font-size: 18px;
  }
  #cartList li {
    font-size: 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  #cartList li button.remove-domain {
    align-self: flex-end;
  }

  /* FORM KOSZYK */
  #cartForm input {
    font-size: 14px;
    padding: 10px 12px;
  }
  .dmn-submit-btn {
    font-size: 15px;
    padding: 10px;
  }
}

#search {
  display: none;
}

@media (max-width: 900px) {
  .dmn-main.with-cart {
    flex-direction: column !important;
  }
  .dmn-main.with-cart .dmn-results,
  .dmn-main.with-cart .dmn-cart {
    flex: 1 1 100% !important;
    width: 100% !important;
    display: block !important;
  }
}

@media (max-width: 600px) {
  /* ukryj nagłówki i kolumny Status + Przeznaczenie */
  .dmn-table th:nth-child(2),
  .dmn-table th:nth-child(3),
  .dmn-table td:nth-child(2),
  .dmn-table td:nth-child(3) {
    display: none;
  }

  /* tabela bardziej kompaktowa */
  .dmn-table {
    font-size: 14px;
  }
  .dmn-table td,
  .dmn-table th {
    padding: 10px 6px;
  }
}

/* --- FIX: Mobile layout (telefon) --- */
.dmn-results,
.dmn-cart {
  box-sizing: border-box;
}

@media (max-width: 900px) {
  /* nie rozpychaj wrappera i daj równy padding */
  .container .dmn-main {
    padding: 0 16px !important;
    margin: 0 auto;
  }

  .dmn-hero {
    margin-bottom: 20px;
  }

  .dmn-main {
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 16px !important;
  }
  .dmn-main.active {
    margin-top: 20px;
    padding: 0 !important;
  } /* zero „40” na mobile */

  /* pełna szerokość i brak przesunięcia w prawo */
  .dmn-results,
  .dmn-cart,
  .dmn-main.with-cart .dmn-results,
  .dmn-main.with-cart .dmn-cart {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    display: block !important;
  }

  /* tabela nie „przykleja się” do prawej, przewijanie w razie czego */
  .dmn-results-inner {
    width: 100%;
    overflow-x: auto;
  }
  .dmn-table {
    width: 100%;
    table-layout: fixed;
  }
  .dmn-table td:first-child {
    word-break: break-word;
  }

  /* ukryj Status i Przeznaczenie na telefonie */
  .dmn-table th:nth-child(2),
  .dmn-table th:nth-child(3),
  .dmn-table td:nth-child(2),
  .dmn-table td:nth-child(3) {
    display: none;
  }

  /* ciaśniejsze paddingi */
  .dmn-table td,
  .dmn-table th {
    padding: 10px 6px;
  }
  .dmn-results,
  .dmn-cart {
    margin-top: 20px;
    padding: 18px 16px;
    border-radius: 8px;
  }
}
