/* Reset i podstawy */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f9f9f9;
  color: #333;

  /* Wycentrowanie strony */
  display: flex;
  justify-content: center; /* poziome wycentrowanie */
}

#page-wrapper {
  max-width: 1000px; /* maksymalna szerokość strony */
  width: 100%;
  background: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Nagłówek */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #0077ff, #005fcc);
  padding: 12px 20px;
  color: white;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  position: relative;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.logo {
  height: 40px;
  user-select: none;
}
nav a {
  color: white;
  font-weight: 600;
  margin-right: 18px;
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}
nav a:last-child {
  margin-right: 0;
}
nav a:hover,
nav a:focus {
  color: #ffdd00;
}

/* Info użytkownika */
#userInfo {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 600;
  opacity: 0;
  animation: fadeIn 0.9s forwards;
}
#userInfo span {
  background: rgba(255 255 255 / 0.18);
  padding: 7px 14px;
  border-radius: 30px;
  user-select: none;
  box-shadow: 0 0 10px rgba(255 255 255 / 0.3);
  transition: background-color 0.3s ease;
}
#userInfo span:hover,
#userInfo span:focus {
  background: rgba(255 255 255 / 0.35);
}
#userInfo button {
  background-color: #ffdd00;
  border: none;
  color: #004a00;
  padding: 7px 16px;
  font-weight: 700;
  border-radius: 30px;
  box-shadow: 0 5px 14px rgba(255 221 0, 0.6);
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
#userInfo button:hover,
#userInfo button:focus {
  background-color: #e6c800;
  box-shadow: 0 7px 20px rgba(230 200 0, 0.8);
  outline: none;
}

/* Animacja fadeIn */
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Główna zawartość */
main {
  padding: 2rem;
  text-align: center;
  flex-grow: 1;
}

/* Produkty wycentrowane */
#products {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.product-card {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  width: 200px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.product-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

/* Przyciski dodawania produktów - ładne */
.product-card button {
  background-color: #ffdd00;
  color: #004a00;
  border: none;
  border-radius: 25px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(255 221 0, 0.6);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  margin-top: 10px;
}
.product-card button:hover,
.product-card button:focus {
  background-color: #e6c800;
  box-shadow: 0 7px 20px rgba(230 200 0, 0.8);
  outline: none;
}

/* Animacja dodawania produktu (np. migotanie) */
@keyframes addToCartAnim {
  0%   { box-shadow: 0 0 10px 3px #0077ff; }
  50%  { box-shadow: 0 0 20px 7px #00aaff; }
  100% { box-shadow: 0 0 10px 3px #0077ff; }
}

/* Koszyk modal + animacja */
#cartModal {
  position: fixed;
  top: 70px;
  right: 20px;
  width: 320px;
  max-width: 90vw;
  background: white;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 20px;
  opacity: 0;
  transform: translateX(30px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 1000;
  outline: none;
}
#cartModal.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
#cartModal h2 {
  margin-top: 0;
  font-weight: 700;
  margin-bottom: 12px;
  color: #005fcc;
}
#cartItems {
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding-left: 18px;
  list-style-type: none;
}
#cartItems li {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#cartItems button.remove-btn {
  background: #ff4444;
  border: none;
  color: white;
  border-radius: 6px;
  padding: 3px 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
#cartItems button.remove-btn:hover {
  background: #cc0000;
}
#cartModal p {
  font-weight: 600;
  margin-bottom: 18px;
}
#cartModal button {
  background-color: #005fcc;
  border: none;
  color: white;
  padding: 8px 20px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  tran
