/* Podstawowy layout kontenera */
.price-history-container {
  display: inline-block;
  margin-top: 15%;
}

/* Przycisk otwierający */
.price-history-open.button {
  cursor: pointer;
  padding: 8px 14px;
  font-size: 14px;
}

/* Body lock (usuwane po zamknięciu) */
body.price-history-modal-open {
  overflow: hidden;
}

/* Modal - tło */
.price-history-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);

  /* FLEX centrum + marginesy 10% */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10%; /* marginesy od każdej krawędzi */
  box-sizing: border-box;
}

/* Wnętrze modala */
.price-history-modal-inner {
  background: #ffffff;
  border-radius: 6px;
  width: 100%;
  max-width: 900px;
  max-height: 80vh;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  padding: 18px;
  position: relative;
  box-sizing: border-box;
  animation: ph-fade-in .12s ease-in;

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Animacja */
@keyframes ph-fade-in {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Przyciski zamykania */
.price-history-close {
  position: absolute;
  right: 10px;
  top: 8px;
  background: transparent;
  border: 0;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #333;
}

/* Loader */
.price-history-loader {
  text-align: center;
  padding: 20px;
  font-size: 14px;
  color: #666;
}

/* Treść */
.price-history-content {
  display: block;
  flex: 1 1 auto;
  overflow: auto;
  padding-top: 8px;
}

/* === Tabela historii === */
/* Treść - kontener tabeli */
.price-history-content {
  display: block;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: auto; /* <-- horyzontalny scroll na mobile */
  padding-top: 8px;
  -webkit-overflow-scrolling: touch;
}

/* Tabela historii */
.price-history-table {
  width: 100%;
  min-width: 600px; /* wymuś szerokość minimalną, żeby pojawił się scroll */
  border-collapse: collapse;
  font-size: 14px;
  margin: 0;
}

.price-history-table thead th {
  text-align: left;
  padding: 10px 8px;
  background: #f7f7f7;
  border-bottom: 2px solid #ddd;
  font-weight: 600;
  position: sticky; /* nagłówek zawsze widoczny */
  top: 0;
  z-index: 2;
}

.price-history-table tbody td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  color: #333;
}

/* Alternatywne wiersze */
.price-history-table tbody tr:nth-child(odd) {
  background: #fff;
}

/* Komunikaty */
.price-history-no-records,
.price-history-error {
  padding: 20px;
  text-align: center;
  color: #666;
}

/* Małe ekrany */
@media (max-width: 640px) {
  .price-history-table {
    font-size: 12px;
  }
  .price-history-table th,
  .price-history-table td {
    padding: 6px 4px;
  }
}

/* Estetyczne drobiazgi */
.price-history-table tbody td small {
  color: #777;
  font-size: 12px;
}