/* ============ Header (isolated) ============ */
:root{
  --hdr-bg:#ffffff;
  --hdr-text:#0f172a;
  --muted:#64748b;
  --border:#e5e7eb;
  --primary:#ef4444;
  --shadow:0 8px 24px rgba(2,8,23,.06), 0 1px 2px rgba(2,8,23,.05);
}

.header{
  background:var(--hdr-bg);
  color:var(--hdr-text);
  position:sticky;
  top:0;
  z-index:1010;
  border-bottom:1px solid var(--border);
}

/* !!! SADECE HEADER İÇİN CONTAINER !!! */
.header .container{
  max-width:1180px;
  margin:0 auto;
  padding:0 16px;
}

/* ---------- top row ---------- */
.header .top{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:12px;
  min-height:68px;
}

/* hamburger (mobile) */
.header .hamburger{
  display:none;
  width:40px;height:40px;
  border:1px solid var(--border);
  background:#fff;border-radius:10px;
  align-items:center;justify-content:center;
  position:relative;cursor:pointer;
}
.header .hamburger span,
.header .hamburger span:before,
.header .hamburger span:after{
  content:""; display:block; height:2px; width:18px;
  background:var(--hdr-text); border-radius:2px;
  position:absolute;
}
.header .hamburger span{ transform:translateY(0); }
.header .hamburger span:before{ transform:translateY(-6px); }
.header .hamburger span:after{ transform:translateY(6px); }

/* logo */
.header .logo{display:flex;align-items:center;gap:10px;color:inherit;text-decoration:none;}
.header .logo-badge{
  width:34px;height:34px;border-radius:10px;background:#ef4444;
  color:#fff;display:grid;place-items:center;font-weight:800;
}
.header .brand-name{font-weight:800;}
.header .pill{
  font-size:12px;background:#e8fff1;color:#15a34a;
  border:1px solid #c7f2d6;border-radius:999px;
  padding:3px 8px;font-weight:700;
}

/* search */
.header .search{display:flex;gap:8px;align-items:center;justify-content:center;}
.header .search input{
  width:100%; max-width:680px; height:40px; border:1px solid var(--border);
  border-radius:12px; padding:0 12px; outline:0;
}
.header .search button{
  height:40px; padding:0 16px; border-radius:12px; border:0;
  background:var(--primary); color:#fff; font-weight:800; cursor:pointer;
}

/* toolbar */
.header .toolbar{display:flex;gap:8px;}
.header .btn{
  display:inline-flex;align-items:center;gap:8px;
  height:40px;padding:0 12px;border-radius:12px;border:1px solid var(--border);
  text-decoration:none;color:inherit;background:#fff;
}
.header .badge{
  min-width:18px;height:18px;border-radius:999px;background:#ef4444;color:#fff;
  font-size:12px;display:grid;place-items:center;padding:0 5px;
}

/* ---------- main menu row ---------- */
.header .mainmenu{border-top:1px solid var(--border);}
.header .menu-list{display:flex;align-items:center;gap:8px;padding:8px 0;margin:0;list-style:none;}
.header .menu-link{
  display:inline-flex;align-items:center;gap:6px;
  height:38px;padding:0 12px;border-radius:10px;text-decoration:none;color:inherit;
  border:1px solid transparent;font-weight:600;
}
.header .menu-link:hover{background:#f8fafc;border-color:var(--border);}
.header .has-dropdown{position:relative;}
.header .caret{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid currentColor}

/* dropdown */
.header .dropdown{
  position:absolute; left:0; top:calc(100% + 8px);
  min-width:320px; background:#fff; border:1px solid var(--border); border-radius:12px;
  box-shadow:var(--shadow); padding:10px; display:none;
}
.header .has-dropdown.open .dropdown{display:block;}
.header .dropdown-grid{display:grid;grid-template-columns:1fr 1fr; gap:6px;}
.header .dropdown-link{
  display:block; padding:8px 10px; border-radius:8px; text-decoration:none; color:inherit;
  border:1px solid transparent;
}
.header .dropdown-link:hover{background:#f8fafc;border-color:var(--border);}
.header .dropdown-link.is-active{background:#eef6ff;border-color:#cfe6ff;}

/* ---------- mobile drawer ---------- */
#mobileBackdrop{
  position:fixed; inset:0; background:rgba(15,23,42,.45);
  opacity:0; pointer-events:none; z-index:1008; transition:opacity .2s ease;
}
#mobileBackdrop.show{opacity:1; pointer-events:auto;}

.mobile-drawer{
  position:fixed; inset:0 auto 0 0; width:320px; max-width:86%;
  background:#fff; border-right:1px solid var(--border); box-shadow:var(--shadow);
  transform:translateX(-100%); transition:transform .25s ease; z-index:1009;
  display:flex; flex-direction:column;
}
.mobile-drawer.open{transform:translateX(0);}
.drawer-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px; border-bottom:1px solid var(--border); font-weight:800;
}
.drawer-close{
  width:32px;height:32px;border-radius:8px;border:1px solid var(--border);
  background:#fff;cursor:pointer;
}
.mobile-nav a{
  display:block; padding:12px 14px; text-decoration:none; color:inherit; border-bottom:1px solid #f1f5f9;
}
.mobile-nav details{border-bottom:1px solid #f1f5f9;}
.mobile-nav summary{list-style:none; cursor:pointer; padding:12px 14px; font-weight:700;}
.mobile-nav summary::-webkit-details-marker{display:none;}
.mobile-nav .dd{padding:6px 8px 12px;}
.mobile-nav .dd a{padding:8px 12px; border:1px solid transparent; border-radius:8px; margin:4px 6px; display:inline-block;}
.mobile-nav .dd a:hover{background:#f8fafc;border-color:var(--border);}

/* ---------- responsive ---------- */
@media (max-width: 1024px){
  .header .search input{max-width:520px;}
}
@media (max-width: 860px){
  .header .top{grid-template-columns:40px 1fr auto;}
  .header .hamburger{display:inline-flex;}
  .header .brand-name{display:none;}
  .header .mainmenu{display:none;}
}

/* ============ Toasts ============ */
#toastContainer{
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none; /* tıklama toasta geçsin */
}

.toast{
  pointer-events: auto;
  min-width: 260px;
  max-width: 360px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 14px 38px rgba(2,8,23,.18), 0 4px 10px rgba(2,8,23,.08);
  border-radius: 12px;
  overflow: hidden;
  transform: translateY(12px);
  opacity: 0;
  animation: toast-in .22s ease-out forwards;
  font-size: 14px;
}

.toast.hide{
  animation: toast-out .18s ease-in forwards;
}

.toast-body{
  padding: 12px 14px 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.35;
  color: #0f172a;
}

.toast-success { border-left: 4px solid #10b981; }
.toast-error   { border-left: 4px solid #ef4444; }
.toast-info    { border-left: 4px solid #0ea5e9; }

.toast-close{
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0 4px;
}
.toast-close:hover{ color:#0f172a; }

@keyframes toast-in {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
@keyframes toast-out {
  from { transform: translateY(0);   opacity: 1; }
  to   { transform: translateY(8px); opacity: 0; }
}

/* küçük ekranlarda sağ-sol boşluk */
@media (max-width: 480px){
  #toastContainer{ right: 10px; left: 10px; }
  .toast{ width: 100%; max-width: none; }
}
