 /* Заден фон */
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex; /* видим при зареждане */
    align-items: center;
    justify-content: center;
    z-index: 9999; /* винаги най-отгоре */
  }

  /* Popup прозорец */
  .popup {
    position: relative; /* за позиционирането на X бутона */
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    max-width: 800px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
    z-index: 999;
  }

  .popup img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
  }

  /* Бутон "Затвори" */
  .popup button {
    background: crimson;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
  }

  .popup button:hover {
    background: darkred;
  }

  /* X бутон (идва след .popup button, за да го замени по стил) */
  .popup .popup-x {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
  }

  .popup .popup-x:hover {
    background: #000;
  }

  @keyframes fadeIn {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
  }