/* ═══════════════════════════════════════════════════
   shared.css  —  Tokens, Header, Footer, Modal,
                  Cart Sidebar, Toast
   (index.html ve product-detail.html tarafından kullanılır)
═══════════════════════════════════════════════════ */

/* ── TOKENS ────────────────────────────────────── */
:root {
  --primary:       #1e293b;
  --primary-light: #334155;
  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --bg:            #ffffff;
  --bg-alt:        #f1f5f9;
  --border:        #e2e8f0;
  --card-bg:       #ffffff;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.05);
  --shadow:        0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --radius:        8px;
  --radius-lg:     12px;
  --container:     1600px;
  --header-height: 70px;
  --tf:            all 0.2s ease;
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; -webkit-font-smoothing:antialiased; }
body { font-family:"Inter",system-ui,sans-serif; color:var(--text); background:var(--bg); line-height:1.5; overflow-x:hidden; }
a { text-decoration:none; color:inherit; }

/* ── HEADER ─────────────────────────────────────── */
.main-header {
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:200;
  transition:box-shadow .25s;
}
.main-header.scrolled { box-shadow:0 4px 24px rgba(0,0,0,.08); border-bottom-color:transparent; }
.header-top {
  max-width:var(--container); margin:0 auto;
  display:flex; align-items:center; gap:.75rem;
  height:var(--header-height); padding:0 clamp(.75rem,3vw,1.5rem);
}
.logo-text { font-size:1.3rem; font-weight:800; color:var(--primary); white-space:nowrap; flex-shrink:0; }
.logo-text .accent { color:var(--accent); }

.search-container { flex:1; max-width:540px; position:relative; }
.search-input-wrapper { position:relative; display:flex; align-items:center; }
.search-input {
  width:100%; height:42px; padding:0 1rem 0 3rem;
  background:var(--bg-alt); border:1.5px solid transparent;
  border-radius:999px; font-family:inherit; font-size:.9rem;
  font-weight:500; color:var(--text); outline:none;
  transition:background .2s,border-color .2s,box-shadow .2s;
}
.search-input:focus { background:#fff; border-color:var(--accent); box-shadow:0 6px 20px rgba(37,99,235,.1); }
.search-input::placeholder { color:var(--text-muted); }
.search-icon { position:absolute; left:.9rem; top:50%; transform:translateY(-50%); width:18px; height:18px; color:var(--text-muted); pointer-events:none; }

.header-actions { display:flex; align-items:center; gap:.6rem; margin-left:auto; flex-shrink:0; }
.action-btn {
  position:relative; display:flex; align-items:center; justify-content:center;
  width:42px; height:42px; border-radius:10px;
  background:var(--bg-alt); border:1px solid var(--border);
  color:var(--primary); transition:var(--tf); cursor:pointer; text-decoration:none;
}
.action-btn:hover { background:#fff; border-color:var(--accent); color:var(--accent); }
.action-btn svg { width:21px; height:21px; }
.action-btn .badge {
  position:absolute; top:-5px; right:-5px;
  min-width:18px; height:18px; padding:0 4px;
  background:var(--accent); color:#fff;
  border-radius:999px; font-size:.68rem; font-weight:700;
  display:none; align-items:center; justify-content:center;
}
.action-btn .badge.show { display:flex; }

.auth-buttons { display:flex; align-items:center; gap:.6rem; }
.btn-login {
  padding:.45rem 1rem; border:1.5px solid var(--border);
  border-radius:var(--radius); font-size:.85rem; font-weight:600;
  background:#fff; color:var(--primary); cursor:pointer; font-family:inherit; transition:var(--tf);
}
.btn-login:hover { border-color:var(--accent); color:var(--accent); }
.btn-register {
  padding:.45rem 1rem; border:none;
  border-radius:var(--radius); font-size:.85rem; font-weight:600;
  background:var(--accent); color:#fff; cursor:pointer; font-family:inherit; transition:var(--tf);
}
.btn-register:hover { background:var(--accent-hover); }

.profile-toggle {
  display:flex; align-items:center; gap:.5rem;
  padding:.35rem .7rem; border-radius:50px;
  background:var(--bg-alt); border:1px solid var(--border);
  cursor:pointer; transition:var(--tf); color:var(--text); font-family:inherit;
}
.profile-toggle:hover { background:#fff; border-color:var(--accent); }
.profile-avatar {
  width:30px; height:30px; border-radius:50%;
  background:linear-gradient(135deg,var(--accent),#3b82f6);
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:.78rem; font-weight:700; flex-shrink:0;
}
.profile-name { font-size:.85rem; font-weight:600; }

.header-hamburger {
  display:none; width:40px; height:40px; border-radius:10px;
  background:var(--bg-alt); border:1px solid var(--border);
  align-items:center; justify-content:center;
  color:var(--primary); cursor:pointer; flex-shrink:0;
}
.header-hamburger:hover { background:var(--border); }

/* ── LOGIN NOTICE ───────────────────────────────── */
.login-notice {
  background:#eff6ff; border-bottom:1px solid #bfdbfe;
  padding:.5rem 1.5rem; text-align:center;
  font-size:.85rem; color:#1e40af;
}
.login-notice a { color:var(--accent); font-weight:600; cursor:pointer; }
.login-notice a:hover { text-decoration:underline; }
.login-notice button { background:none; border:none; color:var(--accent); font-weight:600; cursor:pointer; font-family:inherit; font-size:inherit; padding:0; }
.login-notice button:hover { text-decoration:underline; }

/* ── BACK LINK ──────────────────────────────────── */
.back-link {
  display:inline-flex; align-items:center; gap:.5rem;
  color:var(--text-muted); font-size:.9rem; font-weight:500;
  margin:1.5rem 0 0; transition:color .2s;
}
.back-link:hover { color:var(--accent); }

/* ── CART SIDEBAR ───────────────────────────────── */
.cart-sidebar {
  position:fixed; top:0; right:0;
  width:min(440px,90vw); height:100vh;
  background:#fff; z-index:500;
  transform:translateX(100.1%);
  transition:transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow:-10px 0 30px rgba(0,0,0,.1);
  display:flex; flex-direction:column;
  visibility:hidden;
}
.cart-sidebar.active { transform:translateX(0); visibility:visible; }
#cartSidebarPanel { display:flex; flex-direction:column; flex:1; min-height:0; }

.cart-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.4);
  z-index:499; opacity:0; pointer-events:none;
  transition:opacity .35s;
}
.cart-overlay.active { opacity:1; pointer-events:auto; }

body.sidebar-open { overflow:hidden; }

.sidebar-header {
  padding:1.25rem 1.5rem; border-bottom:1px solid var(--border);
  display:flex; justify-content:space-between; align-items:center;
}
.sidebar-header h3 { font-size:1.1rem; font-weight:700; }
.sidebar-cart-title {
  display:flex; align-items:center; gap:.5rem;
  font-size:1.1rem; font-weight:700; margin:0;
}
.sidebar-cart-title svg { flex-shrink:0; color:var(--accent); }
.sidebar-cart-count {
  display:none; align-items:center; justify-content:center;
  min-width:22px; height:22px; padding:0 .35rem;
  background:var(--accent); color:#fff; border-radius:999px;
  font-size:.72rem; font-weight:700;
}
.sidebar-cart-count.show { display:inline-flex; }
.cart-badge-count { display:none; }
.cart-badge-count.show { display:inline-flex; }
.sidebar-close-btn {
  width:34px; height:34px; border-radius:10px;
  background:#fff; border:none; box-shadow:0 2px 8px rgba(0,0,0,.08);
  color:var(--text-muted); cursor:pointer; font-size:1.4rem;
  display:flex; align-items:center; justify-content:center;
  transition:var(--tf);
}
.sidebar-close-btn:hover { transform:rotate(90deg); color:var(--accent); }

.sidebar-content { flex:1; overflow-y:auto; padding:1rem 1.25rem; }
.sidebar-content::-webkit-scrollbar { width:4px; }
.sidebar-content::-webkit-scrollbar-thumb { background:var(--border); border-radius:2px; }

.sidebar-footer { padding:1rem 1.25rem; border-top:1px solid var(--border); background:#f8fafc; }
.total-row { display:flex; justify-content:space-between; align-items:center; font-size:1rem; font-weight:700; margin-bottom:.5rem; }
.sidebar-vat-note { font-size:.75rem; color:var(--text-muted); display:block; margin-bottom:.75rem; }
.sidebar-buttons { display:flex; flex-direction:column; gap:.6rem; }
.btn-checkout {
  width:100%; padding:.75rem; border:none; border-radius:var(--radius);
  background:var(--accent); color:#fff; font-size:.9rem; font-weight:700;
  cursor:pointer; font-family:inherit; transition:var(--tf); text-align:center;
}
.btn-checkout:hover { background:var(--accent-hover); }
.btn-continue {
  width:100%; padding:.7rem; border:1.5px solid var(--border); border-radius:var(--radius);
  background:#fff; color:var(--text); font-size:.875rem; font-weight:600;
  cursor:pointer; font-family:inherit; transition:var(--tf); text-align:center;
}
.btn-continue:hover { border-color:var(--accent); color:var(--accent); }

/* Mini cart item */
.mini-cart-item {
  display:grid; grid-template-columns:60px 1fr;
  grid-template-rows:auto auto auto auto;
  gap:.4rem .75rem;
  padding-bottom:1rem; margin-bottom:1rem;
  border-bottom:1px solid var(--border); position:relative;
}
.mini-cart-item img,
.mini-cart-item-placeholder {
  grid-column:1; grid-row:1/5; width:60px; height:60px;
  border-radius:6px; align-self:start;
}
.mini-cart-item img { object-fit:cover; }
.mini-cart-item-placeholder {
  display:flex; align-items:center; justify-content:center;
  background:var(--bg-alt); color:var(--text-muted);
  font-size:1.25rem; font-weight:700;
}
.mci-head   { grid-column:2; grid-row:1; min-width:0; }
.mci-title  { font-size:.875rem; font-weight:600; line-height:1.3; color:var(--text); }
.mci-meta   { font-size:.72rem; color:var(--text-muted); margin-top:.15rem; }
.mci-unit-row {
  grid-column:2; grid-row:2;
  display:flex; align-items:center; gap:.5rem; flex-wrap:wrap;
}
.mci-unit-sel {
  flex:1; min-width:0; height:28px; padding:0 1.25rem 0 .45rem;
  border:1px solid var(--border); border-radius:6px;
  font-size:.72rem; font-weight:600; color:var(--text);
  background:#fff; font-family:inherit; cursor:pointer;
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right .35rem center; background-size:.65rem;
}
.mci-unit-price { font-size:.72rem; color:var(--text-muted); white-space:nowrap; }
.mci-stepper-row {
  grid-column:2; grid-row:3;
  display:flex; align-items:center; gap:.5rem;
}
.mci-stepper {
  display:flex; align-items:center;
  border:1px solid var(--border); border-radius:6px; overflow:hidden;
  background:#fff;
}
.mci-step-btn {
  width:28px; height:28px; border:none; background:var(--bg-alt);
  color:var(--text); cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:var(--tf);
}
.mci-step-btn:hover { background:var(--border); color:var(--accent); }
.mci-qty-input {
  width:42px; height:28px; border:none; border-left:1px solid var(--border);
  border-right:1px solid var(--border); text-align:center;
  font-size:.78rem; font-weight:700; color:var(--text); font-family:inherit;
  -moz-appearance:textfield;
}
.mci-qty-input::-webkit-outer-spin-button,
.mci-qty-input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.mci-line-total { flex:1; font-size:.875rem; font-weight:700; color:var(--text); text-align:right; }
.mci-remove-btn {
  width:28px; height:28px; border:none; border-radius:6px;
  background:transparent; color:var(--text-muted); cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:var(--tf);
}
.mci-remove-btn:hover { background:#fee2e2; color:#dc2626; }
.mixed-qty-sidebar { grid-column:2; grid-row:2; }
.mci-totals { grid-column:2; grid-row:3; display:flex; align-items:center; padding-top:.35rem; border-top:1px solid var(--bg-alt); }

.empty-mini { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:3rem 1rem; }
.empty-mini-icon { font-size:2.5rem; margin-bottom:.75rem; opacity:.6; }
.empty-mini-text { font-size:.95rem; color:var(--text-muted); margin-bottom:1.25rem; font-weight:500; }
.empty-mini-cta { padding:.55rem 1.25rem; background:var(--accent); color:#fff; border-radius:var(--radius); font-size:.875rem; font-weight:600; }

/* ── MODAL ──────────────────────────────────────── */
.modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.5);
  backdrop-filter:blur(4px); z-index:400;
  display:none; align-items:center; justify-content:center;
}
.modal-overlay.open { display:flex; }
.modal-box {
  background:#fff; border-radius:var(--radius-lg);
  padding:2rem; width:100%; max-width:380px; margin:1rem;
  box-shadow:var(--shadow-lg); position:relative;
}
.modal-close {
  position:absolute; top:.875rem; right:.875rem;
  background:var(--bg-alt); border:none; color:var(--text-muted);
  width:28px; height:28px; border-radius:50%; cursor:pointer;
  font-size:1.1rem; display:flex; align-items:center; justify-content:center; transition:var(--tf);
}
.modal-close:hover { background:var(--border); }
.modal-tabs { display:flex; background:var(--bg-alt); border-radius:var(--radius); padding:3px; gap:3px; margin-bottom:1.25rem; }
.modal-tab { flex:1; padding:.45rem; border:none; background:none; font-family:inherit; font-size:.875rem; font-weight:600; color:var(--text-muted); cursor:pointer; border-radius:6px; transition:var(--tf); }
.modal-tab.active { background:#fff; color:var(--text); box-shadow:var(--shadow-sm); }
.modal-box h2 { font-size:1.35rem; font-weight:800; margin-bottom:.25rem; }
.modal-sub { font-size:.875rem; color:var(--text-muted); margin-bottom:1.25rem; }
.form-field { margin-bottom:.875rem; }
.form-field label { display:block; font-size:.8rem; font-weight:600; color:var(--text-muted); margin-bottom:.3rem; }
.form-field input {
  width:100%; background:var(--bg-alt); border:1.5px solid var(--border);
  border-radius:var(--radius); padding:.625rem .875rem;
  font-size:.9rem; font-family:inherit; color:var(--text); outline:none; transition:border-color .2s;
}
.form-field input:focus { border-color:var(--accent); background:#fff; }
.btn-submit { width:100%; background:var(--accent); border:none; color:#fff; padding:.75rem; border-radius:var(--radius); font-size:.9rem; font-weight:700; cursor:pointer; font-family:inherit; margin-top:.25rem; transition:var(--tf); }
.btn-submit:hover { background:var(--accent-hover); }
.modal-note { font-size:.75rem; color:var(--text-muted); text-align:center; margin-top:.75rem; }

/* ── TOAST ──────────────────────────────────────── */
.toast-container { position:fixed; bottom:1.5rem; left:50%; transform:translateX(-50%); z-index:9999; display:flex; flex-direction:column; gap:.5rem; width:calc(100vw - 2rem); max-width:400px; pointer-events:none; }
.toast { background:rgba(15,23,42,.96); backdrop-filter:blur(8px); color:#fff; padding:.75rem 1.25rem; border-radius:var(--radius-lg); box-shadow:0 10px 30px rgba(0,0,0,.3); font-size:.875rem; font-weight:500; border:1px solid rgba(255,255,255,.1); pointer-events:auto; animation:toastIn .3s ease forwards; }
.toast.success { background:rgba(37,99,235,.95); border-left:4px solid #93c5fd; }
@keyframes toastIn { from { transform:translateY(60px); opacity:0; } to { transform:translateY(0); opacity:1; } }

/* ── FOOTER ─────────────────────────────────────── */
.site-footer { background:var(--primary); color:#94a3b8; margin-top:4rem; }
.footer-inner { max-width:var(--container); margin:0 auto; display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:2.5rem; padding:2.5rem clamp(.75rem,3vw,1.5rem); }
.footer-brand .brand-name { font-size:1.2rem; font-weight:800; color:#fff; margin-bottom:.5rem; }
.footer-brand .brand-name .accent { color:#60a5fa; }
.footer-brand p { font-size:.875rem; line-height:1.6; }
.footer-col h4 { font-size:.78rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#cbd5e1; margin-bottom:.875rem; }
.footer-col a { display:block; font-size:.875rem; margin-bottom:.5rem; color:#94a3b8; transition:color .2s; }
.footer-col a:hover { color:#fff; }
.footer-bottom { border-top:1px solid #334155; padding:1rem clamp(.75rem,3vw,1.5rem); text-align:center; font-size:.8rem; max-width:var(--container); margin:0 auto; }

/* ── FILTER DROPDOWN ────────────────────────────── */
.filter-dropdown {
  border:1.5px solid var(--border); border-radius:10px; background:#fff;
  color:var(--text); padding:.5rem 2.25rem .5rem .875rem;
  font-size:.875rem; font-weight:600; cursor:pointer; outline:none; font-family:inherit;
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right .875rem center; background-size:.875rem;
  box-shadow:var(--shadow-sm); transition:var(--tf);
}
.filter-dropdown:hover { border-color:#cbd5e1; background-color:var(--bg-alt); }
.filter-dropdown:disabled { opacity:.4; cursor:not-allowed; pointer-events:none; }

/* ── MISC ───────────────────────────────────────── */
.container { max-width:var(--container); margin:0 auto; padding:0 clamp(.75rem,3vw,1.5rem); }
.badge-new { background:linear-gradient(135deg,#10b981,#059669); color:#fff; font-size:.6rem; font-weight:800; padding:.18rem .5rem; border-radius:5px; text-transform:uppercase; letter-spacing:.05em; box-shadow:0 4px 8px rgba(16,185,129,.25); white-space:nowrap; }
.sale-label-inline { background:#dc2626; color:#fff; font-size:.6rem; font-weight:800; padding:.18rem .5rem; border-radius:5px; text-transform:uppercase; white-space:nowrap; }

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width:1024px) { .header-hamburger { display:flex; } }
@media (max-width:767px) {
  .profile-name { display:none; }
  .footer-inner { grid-template-columns:1fr 1fr; }
  .footer-brand { grid-column:1/-1; }
}
@media (max-width:480px) { .footer-inner { grid-template-columns:1fr; } }
