/* --- ALAPVETŐ VÁLTOZÓK ÉS SZÍNEK --- */
:root {
  --bg-color: #f8fafc;           /* Világos, tiszta háttér */
  --card-bg: #ffffff;            /* Fehér kártyák */
  --text-main: #0f172a;          /* Sötétkék/fekete szöveg */
  --text-muted: #64748b;         /* Szürke kiegészítő szöveg */
  
  --primary: #0ea5e9;            /* Fő kék szín (gombok, árak) */
  --primary-hover: #0284c7;      
  
  --success: #10b981;            /* Zöld a vásárláshoz */
  --success-hover: #059669;
  
  --danger: #ef4444;             /* Piros (pl. törlés) */
  --danger-hover: #dc2626;

  --border: #e2e8f0;             /* Halvány szürke keretek */
  --radius: 12px;                /* Kellemes lekerekítés */
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* --- ALAP BEÁLLÍTÁSOK --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body { 
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, sans-serif; 
  background: var(--bg-color); 
  color: var(--text-main);
  line-height: 1.6;
}

/* --- FEJLÉC ÉS NAVIGÁCIÓ --- */
header { 
  background: #0f172a; 
  color: white; 
  padding: 16px 40px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  position: sticky; 
  top: 0; 
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

header h2 {
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  font-weight: 800;
}

header nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

header a { 
  color: #cbd5e1; 
  text-decoration: none; 
  font-weight: 600; 
  transition: color 0.2s ease; 
}

header a:hover { 
  color: var(--primary); 
}

/* --- KONTÉNER --- */
.container { 
  max-width: 1100px; 
  margin: 40px auto; 
  padding: 0 20px; 
}

/* --- ŰRLAP ELEMEK (Input, Select, Gombok) --- */
input, select { 
  width: 100%; 
  padding: 12px 16px; 
  margin-bottom: 20px; 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  font-size: 1rem;
  color: var(--text-main);
  background: #fcfcfc;
  transition: all 0.2s ease;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2); /* Szép kék ragyogás kattintáskor */
}

input[type="file"] {
  border: 1px dashed var(--border);
  cursor: pointer;
  background: #f8fafc;
}

button { 
  background: var(--primary); 
  color: white; 
  padding: 14px 20px; 
  border: none; 
  border-radius: 8px; 
  cursor: pointer; 
  font-weight: 700; 
  font-size: 1rem;
  width: 100%; 
  transition: all 0.2s ease;
}

button:hover { 
  background: var(--primary-hover); 
  transform: translateY(-2px); /* Kicsit felemelkedik */
  box-shadow: var(--shadow-md);
}

button:active {
  transform: translateY(0);
}

.btn-success { background: var(--success); }
.btn-success:hover { background: var(--success-hover); }

/* --- KÁRTYÁK (Feladás, Kosár, Fizetés) --- */
.card { 
  background: var(--card-bg); 
  padding: 30px; 
  border-radius: var(--radius); 
  box-shadow: var(--shadow-md); 
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.card h2, .card h3 {
  margin-bottom: 20px;
  color: var(--text-main);
  font-weight: 700;
}

/* --- SZŰRŐ PANEL (Főoldal teteje) --- */
.filter-panel { 
  background: var(--card-bg); 
  padding: 20px 25px; 
  border-radius: var(--radius); 
  margin-bottom: 30px; 
  display: flex; 
  gap: 20px; 
  flex-wrap: wrap; 
  align-items: flex-end; 
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.filter-panel > div {
  flex: 1;
  min-width: 200px;
}

.filter-panel label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-panel input, .filter-panel select {
  margin-bottom: 0; /* Itt ne legyen alsó margó, mert rontja a dizájnt */
}

/* --- TERMÉK RÁCS ÉS KÁRTYÁK --- */
.grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
  gap: 25px; 
}

.product { 
  background: var(--card-bg); 
  border-radius: var(--radius); 
  padding: 20px; 
  box-shadow: var(--shadow-sm); 
  border: 1px solid var(--border);
  text-align: left; 
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

/* Látványos hover effekt a termékeken */
.product:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #bae6fd;
}

.product img { 
  width: 100%; 
  height: 200px; 
  object-fit: cover; 
  border-radius: 8px; 
  margin-bottom: 15px; 
  background: #f1f5f9; 
  border: 1px solid #f1f5f9;
}

.product h3 { 
  margin: 10px 0 5px 0; 
  font-size: 1.25rem; 
  font-weight: 700;
  color: var(--text-main);
  /* Ha túl hosszú a szöveg, levágja 3 ponttal: */
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
}

.price { 
  color: var(--primary); 
  font-weight: 800; 
  font-size: 1.5rem; 
  margin: 5px 0 15px 0; 
}

.meta { 
  color: var(--text-muted); 
  font-size: 0.85em; 
  margin-bottom: 20px; 
  flex-grow: 1; /* Hogy a gomb mindig alulra kerüljön */
}

.product button {
  margin-top: auto;
}

/* --- CÍMKÉK / JELVÉNYEK (Állapot, Kategória) --- */
.badge { 
  display: inline-block; 
  padding: 4px 10px; 
  border-radius: 20px; 
  font-size: 0.75rem; 
  font-weight: 700; 
  margin-bottom: 5px; 
  margin-right: 5px; 
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-cat { background: #e0f2fe; color: #0284c7; }
.badge-cond { background: #fef3c7; color: #d97706; }

/* --- KOSÁR SPECIFIKUS DIZÁJN --- */
#cartItems > div {
  background: #f8fafc;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

#cartItems > div:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

#totalPrice {
  font-size: 1.5rem;
  font-weight: 800;
}

/* --- FELUGRÓ ABLAK (MODAL) ÉS CHAT --- */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.8); z-index: 1000;
  justify-content: center; align-items: center; padding: 20px;
}
.modal-content {
  background: var(--card-bg); width: 100%; max-width: 900px; max-height: 90vh;
  border-radius: var(--radius); overflow-y: auto; padding: 30px; position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
}
@media (max-width: 768px) { .modal-content { grid-template-columns: 1fr; } }
.close-btn {
  position: absolute; top: 15px; right: 20px; font-size: 28px; cursor: pointer;
  color: var(--text-muted); background: none; border: none; width: auto; padding: 0; line-height: 1;
}
.close-btn:hover { color: var(--danger); background: none; box-shadow: none; transform: none; }

.chat-box {
  border: 1px solid var(--border); border-radius: 8px; height: 250px; overflow-y: auto;
  padding: 15px; margin-bottom: 10px; background: #f8fafc; display: flex; flex-direction: column; gap: 10px;
}
.chat-msg { background: white; padding: 10px 14px; border-radius: 8px; font-size: 0.9em; box-shadow: var(--shadow-sm); border: 1px solid #e2e8f0; }
.chat-msg strong { color: var(--primary); }
.chat-msg small { color: var(--text-muted); float: right; font-size: 0.8em; margin-top: 2px;}

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }
.btn-outline { background: transparent; color: var(--text-main); border: 1px solid var(--border); }
.btn-outline:hover { background: #f1f5f9; transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* =========================================
   MOBILBARÁT MEGJELENÉS (RESPONSIVE DESIGN) 
   ========================================= */

/* 1. Érintésbarát gombok és beviteli mezők (ujj-kompatibilis méret) */
input, select, button {
  min-height: 44px; 
}

/* 2. Chat oldal alap osztályai (hogy mobilokon át lehessen rendezni) */
.chat-layout { display: flex; gap: 20px; height: 75vh; }
.chat-sidebar { width: 320px; overflow-y: auto; padding: 15px; }
.chat-main { flex: 1; display: flex; flex-direction: column; padding: 20px; }

/* 3. MOBIL NÉZET SZABÁLYAI (768px alatti képernyőkre) */
@media (max-width: 768px) {
  
  /* Fejléc összecsukása: Menüpontok gomb-szerűvé alakítása */
  header {
    flex-direction: column;
    padding: 15px;
    gap: 15px;
  }
  
  header nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  
  header nav a {
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    font-size: 0.85rem;
  }

  /* Szűrő panel egymás alá rendezése */
  .filter-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  
  .filter-panel > div {
    width: 100%;
  }

  /* Chat oldal mobilra igazítása (egymás alá kerül a lista és a chat) */
  .chat-layout {
    flex-direction: column;
    height: auto;
  }
  
  .chat-sidebar {
    width: 100%;
    max-height: 200px; /* Kisebb lista, hogy a chat is kiférjen */
  }
  
  .chat-main {
    height: 450px;
  }

  /* Felugró ablak (Modal) finomhangolása */
  .modal-content {
    padding: 20px;
    padding-top: 45px; /* Hogy a bezáró (X) gomb elférjen */
  }
  
  .close-btn {
    top: 5px;
    right: 15px;
  }
}