:root {
  --light: #f7f7f7;
  --text: #222;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--light);
  color: var(--text);
}

/* ---------- Hlavička ---------- */
.flex-header {
  background-color: #0056b3;
  color: white;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 600;
}

/* ---------- Přihlášení / Odhlášení ---------- */
.admin-bar a {
  text-decoration: none;
  font-weight: bold;
  color: white;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background 0.3s ease;
  margin-left: 0.5rem;
}

.admin-bar a:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ---------- Mřížka kategorií ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 3rem auto;
  padding: 0 1rem;
  justify-items: center;
}

.category-card {
  color: white;
  text-align: center;
  font-weight: 600;
  text-decoration: none;
  padding: 1rem;
  height: 140px;
  width: 100%;
  max-width: 260px;
  border-radius: 1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.category-card i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: white;
}

.category-card span {
  font-size: 1.1rem;
  color: white;
}

/* ---------- Barvy kategorií ---------- */
.category-card.fotbal     { background: #2e8b57; }
.category-card.florbal    { background: #6a5acd; }
.category-card.basketbal  { background: #ff8c00; }
.category-card.plavani    { background: #20b2aa; }
.category-card.bezky      { background: #4682b4; }
.category-card.cyklistika { background: #8fbc8f; }
.category-card.lyzovani   { background: #1e90ff; }
.category-card.atletika   { background: #dc143c; }
.category-card.special {
  background: #0056b3;
  pointer-events: none;
}
.category-card.special i,
.category-card.special span {
  color: white;
}

/* ---------- Hlavička produktů ---------- */
.products-header {
  color: white;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.products-header a.back-link {
  color: white;
  font-size: 1.2rem;
  text-decoration: none;
}
.products-header a.back-link:hover {
  color: #e0e0e0;
}
.products-header h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}
.products-header.fotbal         { background-color: #2e8b57; }
.products-header.florbal        { background-color: #6a5acd; }
.products-header.basketbal      { background-color: #ff8c00; }
.products-header.plavani        { background-color: #20b2aa; }
.products-header.bezky          { background-color: #4682b4; }
.products-header.bezeckelyzovani { background-color: #235a9b; }
.products-header.cyklistika     { background-color: #8fbc8f; }
.products-header.lyzovani       { background-color: #1e90ff; }
.products-header.atletika       { background-color: #dc143c; }

/* ---------- Mřížka produktů ---------- */
.grid.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
  justify-items: center;
}

/* ---------- Produktová karta ---------- */
.card {
  border-radius: 1rem;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  padding: 1rem;
}

.card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  padding: 1rem;
  background: white;
}

.card h3 {
  margin: 0.5rem 0 0.5rem;
  font-size: 1.1rem;
  color: #0056b3;
}

.card .category {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1rem;
}

/* ---------- Barevné pozadí karet ---------- */
.card.fotbal         { background-color: #9acfa1; }
.card.florbal        { background-color: #e3dcf9; }
.card.basketbal      { background-color: #ffe4c2; }
.card.plavani        { background-color: #d4f1f0; }
.card.bezky          { background-color: #d6e9f7; }
.card.bezeckelyzovani { background-color: #a7cdee; }
.card.cyklistika     { background-color: #e2f2e2; }
.card.lyzovani       { background-color: #cfe5ff; }
.card.atletika       { background-color: #f7d4d4; }

/* ---------- Zpráva když nejsou produkty ---------- */
.no-products {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 1.2rem;
  color: var(--text);
  margin-top: 2rem;
}

/* ---------- Odkaz zpět v admin.php ---------- */
.back-link-admin {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: #0056b3;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  background: #eaeaea;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: background 0.3s ease;
}
.back-link-admin:hover {
  background: #d5d5d5;
}

/* ---------- Responzivita ---------- */
@media (max-width: 600px) {
  .flex-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .flex-header h1,
  .products-header h2 {
    font-size: 2rem;
  }

  .category-card {
    height: 120px;
  }

  .category-card i {
    font-size: 1.5rem;
  }

  .category-card span {
    font-size: 1rem;
  }

  .card img {
    height: 160px;
  }

  .card h3 {
    font-size: 1rem;
  }
}
