/* ============================================================
   KKY STYLE
   Tasarım token'ları panelden /kky/data/config.json üzerinden
   JS ile --ds-* CSS değişkenlerine yazılır.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* ---- Layout ---- */
  --header-h:       56px;
  --sidebar-w:      290px;
  --sidebar-closed: 48px;
  --menu-w:         160px;

  /* ---- Marka renkleri (panelden değiştirilmez, sabit) ---- */
  --green: #62b3a1;
  --blue:  #233970;
  --red:   #e53e3e;

  /* ---- Tasarım token'ları (panelden override edilir) ---- */
  --ds-bg:               #f7f7f8;        /* sayfa arka planı */
  --ds-card-bg:          #ffffff;        /* kart arka planı */
  --ds-card-border:      1.5px solid #e8e8ea;  /* kart çerçevesi */
  --ds-card-radius:      10px;           /* kart köşe yuvarlaklığı */
  --ds-card-shadow:      none;           /* kart gölgesi */
  --ds-thumb-bg:         transparent;   /* görsel alanı arka planı */
  --ds-accent:           #62b3a1;        /* vurgu rengi (butonlar) */
  --ds-text:             #111111;
  --ds-muted:            #888888;
  --ds-line:             #e8e8ea;
  --ds-grid-min:         150px;          /* kart min genişliği */
  --ds-grid-gap:         10px;           /* kartlar arası boşluk */
  --ds-sidebar-speed:    0.28s;          /* sepet açılma hızı */
  --ds-font:             'Segoe UI', system-ui, -apple-system, sans-serif;

  /* ---- Buton & Modal token'ları ---- */
  --ds-btn-radius:       8px;
  --ds-btn-padding:      11px 16px;
  --ds-btn-font-size:    13px;
  --ds-modal-radius:     14px;
  --ds-modal-img-ratio:  4/3;       /* modal görsel oranı */
  --ds-thumb-size:       100%;      /* kart görsel yüksekliği (aspect-ratio ile) */

  /* ---- Menü token'ları ---- */
  --ds-menu-bg:          #ffffff;   /* sol menü arka planı */
  --ds-menu-text:        #444444;   /* pasif kategori yazı rengi */
  --ds-menu-active-bg:   #eef8f6;   /* aktif kategori arka planı */
  --ds-menu-active-text: #62b3a1;   /* aktif kategori yazı rengi */
  --ds-menu-hover-bg:    #f0f7f5;   /* hover arka planı */
  --ds-menu-border:      #e8e8ea;   /* menü sağ kenarlık */
  --ds-menu-style:       light;     /* light | dark */

  /* Kısayollar */
  --bg:   var(--ds-bg);
  --card: var(--ds-card-bg);
  --text: var(--ds-text);
  --muted: var(--ds-muted);
  --line: var(--ds-line);
  --rc:   var(--ds-card-radius);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--ds-font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--ds-header-bg, #ffffff);
  border-bottom: 1px solid var(--ds-header-border, #e8e8ea);
  z-index: 100;
  display: flex;
  align-items: center;
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 100%;
  width: 100%;
}

.site-header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.site-header-logo img {
  height: var(--ds-header-logo-h, 32px);
  width: auto;
  object-fit: contain;
}

.site-header-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--ds-header-logo-color, #111111);
  letter-spacing: -0.3px;
}

.site-header-divider {
  width: 1px;
  height: 20px;
  background: var(--ds-header-border, #e8e8ea);
  flex-shrink: 0;
}

.site-header-tagline {
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-header-tagline-color, #888888);
}

/* ============================================================
   SOL MENÜ
   ============================================================ */

.left-menu {
  position: fixed;
  top: var(--header-h); left: 0; bottom: 0;
  width: var(--menu-w);
  background: var(--ds-menu-bg);
  border-right: 1px solid var(--ds-menu-border);
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.left-menu::-webkit-scrollbar { width: 3px; }
.left-menu::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

.left-menu-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 16px 13px 8px;
}

.left-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  padding: 9px 12px 9px 10px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ds-menu-text);
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.left-menu-item:hover {
  background: var(--ds-menu-hover-bg);
  color: var(--ds-menu-active-text);
}

.left-menu-item.active {
  border-left-color: var(--ds-menu-active-text);
  background: var(--ds-menu-active-bg);
  color: var(--ds-menu-active-text);
  font-weight: 700;
}

.left-menu-item.active::after {
  content: "›";
  font-size: 14px;
  font-weight: 700;
  color: var(--ds-menu-active-text);
  margin-left: auto;
}

.left-menu-item img {
  width: 20px; height: 20px;
  object-fit: contain; flex-shrink: 0;
}

.left-menu-item span {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
}

.menu-icon-placeholder {
  width: 20px; height: 20px;
  border-radius: 4px; background: #eee; flex-shrink: 0;
}

.menu-loader {
  padding: 10px 13px;
  font-size: 11px; color: var(--muted);
}


/* ============================================================
   ANA İÇERİK
   ============================================================ */

.products {
  margin-left: var(--menu-w);
  margin-right: var(--sidebar-closed);
  min-height: 100vh;
  padding: 24px 20px 100px;
  padding-top: calc(var(--header-h) + 24px);
  transition: margin-right var(--ds-sidebar-speed) ease;
}

body.sidebar-open .products {
  margin-right: var(--sidebar-w);
}

.products-head { margin-bottom: 18px; }
.products-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.products-head p  { margin: 0; font-size: 13px; color: var(--muted); }

.summary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--rc);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.summary-line {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 13px; font-weight: 600; color: var(--text);
}

.summary-item { white-space: nowrap; }

/* ============================================================
   ÜRÜN GRİDİ
   ============================================================ */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--ds-grid-min), 1fr));
  gap: var(--ds-grid-gap);
}

.category-head {
  grid-column: 1 / -1;
  padding: 0 0 10px;
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
}

.category-head:first-child { margin-top: 0; }
.category-head h2 { margin: 0 0 3px; font-size: 18px; font-weight: 700; }
.category-head p  { margin: 0; font-size: 13px; color: var(--muted); }

/* ============================================================
   ÜRÜN KARTI
   Çerçeve ve arka plan panelden kontrol edilir.
   PNG görseller için "frameless" modu: border yok, bg şeffaf.
   ============================================================ */

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--ds-card-bg);
  border: var(--ds-card-border);
  border-radius: var(--rc);
  box-shadow: var(--ds-card-shadow);
  overflow: visible;           /* dekupe görseller taşabilsin */
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

/* overflow:visible ile köşe yuvarlama için clip-path yerine pseudo */
.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--rc);
  pointer-events: none;
}

.product-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.09);
  transform: translateY(-2px);
}

/* Çerçeveli mod (varsayılan) */
body:not(.frameless-cards) .product-card:hover {
  border-color: #ccc;
}

/* Çerçevesiz mod — panelden aktif edilince */
body.frameless-cards .product-card {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.frameless-cards .product-card:hover {
  transform: translateY(-3px);
  box-shadow: none !important;
}

body.frameless-cards .product-bottom {
  border-top: none;
  background: transparent;
  text-align: center;
}

.product-card.selected-box {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

/* Görsel */
.product-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: var(--ds-thumb-bg);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: #ccc; font-size: 12px; font-weight: 600;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  border-radius: var(--rc) var(--rc) 0 0;
  overflow: hidden;
}

/* Çerçevesiz modda görsel taşabilir */
body.frameless-cards .product-thumb {
  overflow: visible;
  background-color: transparent;
  border-radius: 0;
}

.product-card:hover .product-thumb { transform: scale(1.04); }

/* Alt bilgi */
.product-bottom {
  padding: 8px 9px 10px;
  border-top: 1px solid #f0f0f0;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--ds-card-bg);
  border-radius: 0 0 var(--rc) var(--rc);
}

.product-title-bottom {
  font-size: 11.5px; font-weight: 500; line-height: 1.35; color: var(--text);
}

.product-price-bottom {
  font-size: 12px; font-weight: 700; color: var(--blue);
}

/* Eklendi rozet */
.added-badge {
  position: absolute; top: 7px; left: 7px; z-index: 5;
  background: var(--blue); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
  pointer-events: none;
  animation: badgePop 0.2s ease;
}

@keyframes badgePop {
  from { opacity: 0; transform: scale(0.75); }
  to   { opacity: 1; transform: scale(1); }
}

/* Hover ekle butonu */
.card-quick-add {
  position: absolute;
  top: 6px; right: 6px; z-index: 5;
  border: none; border-radius: 20px;
  padding: 3px 8px;
  font-size: 10px; font-weight: 700;
  background: var(--ds-accent); color: #fff;
  cursor: pointer;
  opacity: 0; transform: translateY(-3px);
  transition: opacity 0.16s, transform 0.16s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.14);
  white-space: nowrap; line-height: 1.4;
}

.product-card:hover .card-quick-add { opacity: 1; transform: translateY(0); }
.card-quick-add:disabled { background: #bbb; cursor: not-allowed; }

/* Mobilde hover çalışmaz — hızlı ekle butonunu gizle, karta tıklayınca modal açılır */
@media (hover: none), (max-width: 768px) {
  .card-quick-add { display: none !important; }
}

/* Inline qty kontrolü */
.inline-qty-controls {
  position: absolute;
  bottom: 44px;
  left: 50%; transform: translateX(-50%);
  z-index: 6;
  display: flex; align-items: center; gap: 2px;
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 24px;
  padding: 2px 4px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  white-space: nowrap;
}

.qty-btn {
  width: 20px; height: 20px;
  border: none; border-radius: 50%;
  background: var(--blue); color: #fff;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0; line-height: 1;
  transition: background 0.15s;
}

.qty-btn:hover { background: var(--green); }

.qty-btn[data-action="remove"] {
  background: #f5f5f5; color: #aaa;
  border: 1px solid #ddd; font-size: 11px;
}

.qty-btn[data-action="remove"]:hover {
  background: #fee2e2; color: var(--red); border-color: #fca5a5;
}

.qty-count {
  min-width: 18px; text-align: center;
  font-size: 11px; font-weight: 700; color: var(--text);
}

/* Kilitli ürün */
.product-locked { opacity: 0.5; }

.product-lock-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.45);
  color: var(--blue); font-size: 11px; font-weight: 700;
  pointer-events: none; text-align: center; padding: 8px;
  border-radius: var(--rc);
}

/* Boş kategori */
.category-empty {
  grid-column: 1 / -1;
  padding: 28px; text-align: center;
  color: var(--muted); font-size: 13px;
  background: #fff; border-radius: var(--rc);
  border: 1.5px dashed #ddd;
}

/* Skeleton */
.product-card.skeleton {
  pointer-events: none;
  animation: skeletonPulse 1.5s ease-in-out infinite;
  border: 1.5px solid var(--line) !important;
  background: #fff !important;
}

.skeleton-thumb { width: 100%; aspect-ratio: 1/1; background: #ebebeb; }
.skeleton-line  { height: 10px; background: #ebebeb; border-radius: 4px; margin: 5px 9px; }
.skeleton-line.short { width: 50%; }

@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ============================================================
   SAĞ SEPET
   ============================================================ */

.sidebar {
  position: fixed;
  top: var(--header-h); right: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-left: 1px solid var(--line);
  z-index: 90;
  display: flex; flex-direction: column;
  box-shadow: -3px 0 14px rgba(0,0,0,0.05);
  transform: translateX(calc(100% - var(--sidebar-closed)));
  transition: transform var(--ds-sidebar-speed) ease;
}

.sidebar:not(.collapsed)    { transform: translateX(0); }
.sidebar.collapsed          { cursor: pointer; }

.sidebar.collapsed::before {
  content: ""; position: absolute;
  left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--green);
}

.sidebar.collapsed .sidebar-body,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .sidebar-title-text {
  opacity: 0; pointer-events: none;
}

/* Mobilde alttan yukarı çıkar */
@media (max-width: 768px) {
  .sidebar {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 85vh;
    border-left: none;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
    transform: translateY(100%);
  }
  .sidebar:not(.collapsed) { transform: translateY(0); }
  .sidebar.collapsed {
    transform: translateY(100%);
    cursor: default;
  }
  .sidebar.collapsed::before { display: none; }
  .sidebar.collapsed .sidebar-body,
  .sidebar.collapsed .sidebar-footer,
  .sidebar.collapsed .sidebar-title-text {
    opacity: 1; pointer-events: auto;
  }
}

.sidebar-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 14px; border-bottom: 1px solid var(--line);
  min-height: 62px; flex-shrink: 0;
}

.sidebar-title { display: flex; align-items: center; gap: 10px; }

.gift-icon { font-size: 24px; position: relative; flex-shrink: 0; line-height: 1; }

.gift-count {
  position: absolute; right: -10px; bottom: -7px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #dbeafe; color: #1d4ed8;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

.sidebar-title-text { font-size: 15px; font-weight: 700; }

.toggle-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: 7px;
  background: #f5f5f7; cursor: pointer;
  font-size: 15px; color: #555;
  display: flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0; transition: background 0.15s;
}

.toggle-btn:hover { background: #e9e9eb; }

.sidebar-body { flex: 1; overflow-y: auto; padding: 10px; }
.sidebar-body::-webkit-scrollbar { width: 3px; }
.sidebar-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

.sidebar-list { display: flex; flex-direction: column; gap: 8px; }

.sidebar-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff;
}

.sidebar-thumb {
  width: 46px; height: 46px; border-radius: 7px;
  background: #f5f5f5;
  background-size: contain; background-position: center; background-repeat: no-repeat;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #bbb;
  flex-shrink: 0; border: 1px solid #eee;
}

.sidebar-info { flex: 1; min-width: 0; }
.sidebar-info strong { display: block; font-size: 11.5px; line-height: 1.35; margin-bottom: 2px; }
.sidebar-info .price { font-size: 12px; font-weight: 700; color: var(--blue); }

.sidebar-qty-controls { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }

.mini-btn {
  width: 22px; height: 22px;
  border: 1px solid var(--line); border-radius: 5px;
  background: #f5f5f7; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  padding: 0; transition: background 0.12s, color 0.12s;
}

.mini-btn:hover { background: var(--green); color: #fff; border-color: var(--green); }
.mini-btn[data-action="remove"] { font-size: 11px; color: #ccc; }
.mini-btn[data-action="remove"]:hover { background: #fee2e2; color: var(--red); border-color: #fca5a5; }

.mini-count { min-width: 16px; text-align: center; font-size: 12px; font-weight: 700; }

.sidebar-footer { border-top: 1px solid var(--line); padding: 12px; flex-shrink: 0; }

.totals { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; margin-bottom: 8px; }

.capacity-line { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.progress { height: 5px; background: #eee; border-radius: 99px; overflow: hidden; margin-bottom: 10px; }
.progress-bar { height: 100%; width: 0%; background: var(--green); transition: width 0.3s ease; }

.shipping-nudge {
  background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: 8px; padding: 7px 10px;
  font-size: 11.5px; color: #9a3412;
  margin-bottom: 10px; line-height: 1.5;
}
.shipping-nudge strong { color: #c2410c; }

.checkout-btn {
  width: 100%; border: none; border-radius: 8px;
  padding: 12px; background: var(--ds-accent); color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background 0.15s;
}
.checkout-btn:hover { filter: brightness(0.9); }

/* ============================================================
   MODAL
   ============================================================ */

.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.52);
  display: none; align-items: flex-start; justify-content: center;
  padding: 16px; z-index: 120;
  overflow-y: auto;
  touch-action: none;
}
.modal.show { display: flex; }

.modal-card {
  width: 100%; max-width: 480px;
  background: #fff; border-radius: var(--ds-modal-radius);
  overflow: visible; box-shadow: 0 24px 56px rgba(0,0,0,0.22);
  margin: auto;
}

.modal-image {
  width: 100%; aspect-ratio: var(--ds-modal-img-ratio);
  background: #f5f5f5;
  background-size: contain; background-position: center; background-repeat: no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: #ccc; font-size: 13px; font-weight: 600;
}

.modal-body { padding: 18px; }
.modal-body h3 { margin: 0 0 7px; font-size: 18px; font-weight: 700; }
.modal-body p  { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--muted); }

.modal-price { font-size: 20px; font-weight: 700; color: var(--blue); margin-bottom: 14px; }

.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; border: none; border-radius: var(--ds-btn-radius); padding: var(--ds-btn-padding); font-size: var(--ds-btn-font-size); font-weight: 700; cursor: pointer; transition: background 0.15s; }
.btn-secondary { background: #f0f0f2; color: #333; }
.btn-secondary:hover { background: #e5e5e7; }
.btn-primary   { background: var(--ds-accent); color: #fff; }
.btn-primary:hover { filter: brightness(0.9); }

.summary-modal-card { max-width: 520px; }
.summary-box { background: #f7f7f9; border: 1px solid #eee; border-radius: 9px; padding: 12px; margin-bottom: 10px; }
.summary-box h4 { margin: 0 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.summary-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; line-height: 1.5; padding: 3px 0; }

/* ---- Adım uyarısı (kutu/kırpık zorunlu) ---- */
.step-warning {
  position: fixed;
  top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 500;
  background: #1a1a2e;
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  border-left: 4px solid #f5a623;
  display: flex; align-items: center; gap: 10px;
  animation: warningSlide 0.25s ease;
  white-space: nowrap;
}

@keyframes warningSlide {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* Mobilde sidebar açıkken arka planı kilitle — sadece mobil */
@media (max-width: 768px) {
  body.sidebar-open {
    overflow: hidden;
    touch-action: none;
  }
  body.sidebar-open .products,
  body.sidebar-open #productGrid {
    pointer-events: none;
  }
}
body.dark-menu .left-menu { background: var(--ds-menu-bg); border-right-color: rgba(255,255,255,0.08); }
body.dark-menu .left-menu-title { color: rgba(255,255,255,0.4); }
body.dark-menu .left-menu-item { color: rgba(255,255,255,0.7); }
body.dark-menu .left-menu-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
body.dark-menu .left-menu-item.active { color: var(--ds-menu-active-text); }
/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 960px) {
  :root { --sidebar-w: 260px; --menu-w: 140px; }
}

@media (max-width: 768px) {
  :root { --menu-w: 0px; --sidebar-w: 250px; --sidebar-closed: 36px; --header-h: 48px; }

  .site-header-divider,
  .site-header-tagline { display: none; }

  /* Menü üste yatay tab bar */
  .left-menu {
    position: fixed;
    top: var(--header-h); left: 0; right: 0; bottom: auto;
    width: 100%; height: 44px;
    flex-direction: row;
    overflow-x: auto; overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid var(--ds-menu-border);
    background: var(--ds-menu-bg);
    z-index: 80;
    padding: 0;
    gap: 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  .left-menu::-webkit-scrollbar { display: none; }

  .left-menu-title { display: none; }

  .left-menu-item {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0 14px;
    height: 44px;
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    opacity: 0.55;
  }

  .left-menu-item img { width: 18px; height: 18px; }
  .left-menu-item span { display: inline; }
  .left-menu-item .menu-icon-placeholder { display: none; }
  .left-menu-item img[src=""] { display: none; }
  .left-menu-item.active::after { display: none; }

  .left-menu-item.active {
    border-bottom: 3px solid var(--green);
    border-left: none;
    color: var(--ds-menu-active-text);
    font-weight: 700;
    opacity: 1;
  }

  /* İçerik alanı — üstteki menü + header kadar boşluk */
  .products {
    margin-left: 0;
    margin-right: 0;
    padding: 12px 10px 80px;
    padding-top: calc(var(--header-h) + 44px + 12px);
  }

  /* Mobilde sidebar alttan çıkıyor — sağ margin gerekmez */
  body.sidebar-open .products {
    margin-right: 0;
  }

  .product-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 7px; }
}

@media (max-width: 480px) {
  :root { --menu-w: 46px; --sidebar-w: min(80vw, 260px); --sidebar-closed: 30px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
}

/* ============================================================
   KİŞİSELLEŞTİRME ALANLARI (modal içi)
   ============================================================ */
.modal-personalization-wrap {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #fff8f0;
  border: 1px solid #f0e0c8;
  border-radius: 10px;
}

.modal-personalization-title {
  font-size: 13px;
  font-weight: 700;
  color: #555;
  margin-bottom: 10px;
}

.modal-pers-field {
  margin-bottom: 10px;
}

.modal-pers-field:last-child {
  margin-bottom: 0;
}

.modal-pers-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  margin-bottom: 5px;
}

.modal-pers-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  background: #fff;
  color: #333;
  outline: none;
  transition: border-color 0.15s;
}

.modal-pers-field textarea:focus {
  border-color: var(--ds-accent);
}

.modal-photo-drop {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.modal-photo-drop:hover,
.modal-photo-drop.drag-over {
  border-color: var(--ds-accent);
  background: #f0faf8;
}

.modal-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #999;
  font-size: 12px;
}

.modal-photo-placeholder span:first-child {
  font-size: 22px;
}

.modal-photo-remove {
  margin-top: 6px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 11px;
  color: #888;
  cursor: pointer;
}

.modal-photo-remove:hover {
  background: #fee;
  border-color: #f99;
  color: #c00;
}

/* ============================================================
   MOBİL SEPET BARI
   ============================================================ */
.mobile-cart-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  padding: 8px 12px 12px;
  background: transparent;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (max-width: 768px) {
  .mobile-cart-bar { display: block; }
}

/* Sepet açıkken mobil cart bar'ı gizle */
body.sidebar-open .mobile-cart-bar {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

.mobile-cart-btn {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  background: var(--ds-accent); color: #fff;
  border: none; border-radius: 14px;
  padding: 13px 18px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}

.mobile-cart-btn-icon { font-size: 18px; }
.mobile-cart-btn-text { flex: 1; text-align: left; }
.mobile-cart-badge {
  background: #fff; color: var(--ds-accent);
  border-radius: 20px; padding: 2px 8px;
  font-size: 12px; font-weight: 800;
}
.mobile-cart-total { font-size: 14px; font-weight: 700; }

/* Modal açıkken mobil cart bar ve nav'ı gizle */
.modal.show ~ * .mobile-cart-bar,
body:has(.modal.show) .mobile-cart-bar,
.modal.show ~ * .mobile-cart-nav,
body:has(.modal.show) .mobile-cart-nav {
  display: none !important;
}

/* Mobilde sidebar footer butonlarını gizle — nav butonları kullanılıyor */
@media (max-width: 768px) {
  .sidebar-footer .checkout-btn,
  .sidebar-footer .clear-cart-btn {
    display: none !important;
  }
}

/* ============================================================
   MOBİL SEPET NAVİGASYON BUTONLARI
   ============================================================ */
.mobile-cart-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 201;
  padding: 8px 12px 12px;
  background: transparent;
  gap: 8px;
}

@media (max-width: 768px) {
  body.sidebar-open .mobile-cart-nav {
    display: flex;
  }
}

.mobile-nav-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ds-accent); color: #fff;
  border: none; border-radius: 14px;
  padding: 13px 18px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  transition: background 0.2s;
}

.mobile-nav-btn:active {
  filter: brightness(0.9);
}

.mobile-nav-btn.back {
  background: #f5f5f7;
  color: #333;
}

.mobile-nav-btn.back:active {
  background: #e5e5e7;
}
/* Native Zuppi integration */
.product-thumb img{width:100%;height:100%;object-fit:contain}.kky-status{color:#235f53;overflow-wrap:anywhere}.kky-line{display:grid;grid-template-columns:52px minmax(0,1fr);gap:10px;padding:12px 0;border-bottom:1px solid #ddd}.kky-line>img{width:52px;height:60px;object-fit:contain}.kky-line-copy{min-width:0;overflow-wrap:anywhere}.kky-line-copy small{display:block}.kky-line-actions{grid-column:1/-1;display:flex;gap:8px;align-items:center;flex-wrap:wrap}.kky-line-actions button{padding:5px 8px;border:1px solid #ccc;background:white;border-radius:4px;cursor:pointer}.modal-image img{max-width:100%;max-height:100%;object-fit:contain}#kky-personal-form label{display:block;margin:14px 0}#kky-personal-form input,#kky-personal-form select,#kky-personal-form textarea{display:block;box-sizing:border-box;width:100%;padding:10px;border:1px solid #ccc;border-radius:5px;margin-top:6px;font:inherit}#kky-personal-form small{display:block;color:#666;margin-top:5px}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,a:focus-visible{outline:2px solid #234376;outline-offset:3px}#mobileCartSheet,#mobileCartNav,#summaryModal,#mobileSheetOverlay{display:none!important}#kky-more{grid-column:1/-1;padding:12px}.modal{overflow:auto}.modal-card{max-height:90vh;overflow:auto}
@media(max-width:768px){body.sidebar-open .sidebar{display:flex!important;position:fixed!important;inset:0 0 64px 0!important;width:100%!important;max-width:none!important;transform:none!important;z-index:1000!important}body.sidebar-open .sidebar.collapsed{transform:translateX(100%)!important}.sidebar-body{overflow:auto}.sidebar-header{flex-shrink:0}.sidebar-footer{flex-shrink:0}.mobile-cart-bar{z-index:1001}#modalPersonalization{min-width:0}.modal-card{width:94vw!important;max-height:92vh}.site-header-tagline{font-size:13px}.product-thumb{height:150px!important}}
@media(min-width:769px){.sidebar.collapsed .toggle-btn{position:absolute;left:7px;top:64px;margin:0}}#kky-modal-error{color:#ad2e29;font-size:14px}.product-thumb{cursor:pointer}.site-header-logo img{height:48px}
@media(max-width:768px){.left-menu-item{width:auto;opacity:1;min-height:44px}.product-card .card-quick-add{display:block!important;position:static;opacity:1;transform:none;margin:8px;width:calc(100% - 16px);min-height:40px;white-space:normal;box-shadow:none;font-size:11px}.product-grid{align-items:start}}
#shippingNudge,.sidebar-footer .progress{display:none!important}.kky-cart-status{font-size:13px;color:#a52b24;overflow-wrap:anywhere}.kky-cart-status:empty{display:none}@media(max-width:768px){body.sidebar-open .sidebar{inset:0!important;max-height:none!important}.sidebar-footer .checkout-btn{display:block!important;min-height:44px}.sidebar-footer .clear-cart-btn{display:block!important;min-height:36px}.sidebar-body{min-height:0}}
.modal{z-index:2000!important}.clear-cart-btn{font:inherit;font-size:13px;border:1px solid #ddd;background:#fff;border-radius:6px;padding:8px;width:100%;margin-top:8px;cursor:pointer}
.kky-cart-status{color:#4d5957}
[hidden]{display:none!important}
/* v1.57: one continuous category feed */
:root{--header-h:80px}.site-header-logo{position:relative;width:96px;height:64px;overflow:hidden;flex:none}.site-header-logo img{position:absolute!important;left:-18px;top:-42px;width:130px!important;height:130px!important;max-width:none!important;margin:0}#productGrid{display:block}.kky-category-section{scroll-margin-top:calc(var(--header-h) + 28px);min-height:320px;padding:12px 0 32px;border-bottom:1px solid #e2e8e5}.kky-category-section>h2{font-size:21px;margin:12px 0 18px;color:#243d36}.kky-category-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}.kky-category-locked .kky-category-grid{filter:grayscale(1);opacity:.42}.kky-category-locked .product-thumb{cursor:not-allowed}.kky-category-locked .card-quick-add{cursor:not-allowed}.kky-lock-note{color:#68716d;font-size:14px;margin-bottom:16px}.kky-more{display:block;margin:16px auto;padding:12px 20px;min-height:44px}.left-menu-item.active{background:#d8f0e8;border-left:5px solid #35a78c;color:#227e68;font-weight:750}.left-menu-item.active::after{color:#227e68}.kky-loading{font-size:14px;color:#68716d}@media(max-width:768px){:root{--header-h:72px}.site-header-inner{height:72px}.kky-category-section{scroll-margin-top:132px;min-height:320px}.kky-category-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.kky-category-section>h2{font-size:20px}.left-menu-item.active{border-left:0;border-bottom:4px solid #35a78c;background:#d8f0e8}.site-header-logo{height:64px}.kky-category-grid .product-card{min-width:0}}

/* v1.58: softer gift builder surfaces and spacious category navigation */
:root{--menu-w:224px;--ds-bg:#f5f8f7;--ds-card-radius:18px;--ds-card-border:1px solid #e5eeea;--ds-card-shadow:0 5px 18px #254e3e09;--ds-btn-radius:12px}
.site-header{box-shadow:0 3px 20px #254e3e08}.site-header-tagline{color:#37594f;font-weight:650}
.left-menu{padding:14px 10px;background:linear-gradient(180deg,#fff,#f4faf7);box-shadow:4px 0 24px #254e3e05;gap:6px}
.left-menu-title{padding:12px 14px 16px;color:#638177;letter-spacing:1.4px}
.left-menu-item{min-height:52px;padding:12px 14px;white-space:normal;font-size:14px;line-height:1.4;border-radius:13px;border-left:4px solid transparent;transition:background .2s,box-shadow .2s,transform .2s}
.left-menu-item:hover{background:#eaf5ef;box-shadow:0 4px 12px #2556420a;transform:translateX(2px)}
.left-menu-item.active{background:linear-gradient(115deg,#d6f1e6,#eaf8f0);border-left:4px solid #35a78c;box-shadow:0 4px 14px #2b927a16;color:#216d58}
.products-head{padding:22px 24px;background:linear-gradient(115deg,#e6f4ed,#f7faf5);border:1px solid #deebe3;border-radius:20px;margin-bottom:16px}.products-head h2{font-size:25px;color:#243f35;margin-bottom:8px}.products-head p{color:#60796e;line-height:1.5}
.summary{border-radius:12px;background:#fff;border:1px solid #e2ebe6;color:#436052;padding:12px 16px}
.kky-category-section{padding:16px 0 36px;border-bottom:0}.kky-category-section>h2{display:flex;align-items:center;gap:12px;font-size:22px;margin-bottom:22px}.kky-category-section>h2::before{content:'';width:7px;height:26px;border-radius:8px;background:linear-gradient(#80cbb3,#35a78c);box-shadow:0 3px 9px #35a78c30;flex:none}
.kky-category-grid{gap:16px}.product-card{overflow:hidden;box-shadow:0 5px 18px #254e3e09;transition:transform .2s,box-shadow .2s,border-color .2s}.product-card:hover{transform:translateY(-4px);box-shadow:0 12px 28px #254e3e16;border-color:#acd6c5}.product-thumb{background:linear-gradient(145deg,#fff,#f4f8f5);border-radius:16px 16px 0 0}.product-title-bottom{line-height:1.5;color:#294238}.product-price-bottom{color:#247a60;font-weight:750}.card-quick-add{border-radius:12px;box-shadow:0 5px 14px #25775b26;font-weight:700;min-height:40px}
.kky-category-locked .product-card:hover{transform:none;box-shadow:0 5px 18px #254e3e09}.kky-lock-note{background:#edf1ee;border-radius:10px;padding:10px 14px;width:fit-content}
.gift-icon,.toggle-btn,.mobile-cart-btn-icon{filter:drop-shadow(0 3px 4px #244c3525)}.toggle-btn{border-radius:12px;transition:box-shadow .2s,background .2s}.toggle-btn:hover{background:#e7f5ed;box-shadow:0 4px 12px #254e3e15}.sidebar{box-shadow:-6px 0 28px #254e3e0b}.sidebar-header,.sidebar-footer{background:#f8fbf9}.kky-line-actions button{border-color:#deebe3;border-radius:8px}.kky-line-actions button:hover{background:#e9f5ee}.checkout-btn,.btn-primary{box-shadow:0 5px 15px #27765b20}.modal-card{border-radius:22px;box-shadow:0 24px 80px #183d3238}.modal-image{background:#f5f9f6}#kky-personal-form select,#kky-personal-form input,#kky-personal-form textarea{border-color:#d9e5de;border-radius:10px}#kky-personal-form select:focus,#kky-personal-form input:focus,#kky-personal-form textarea:focus{outline:2px solid #62b3a1;outline-offset:2px}
@media(max-width:1024px) and (min-width:769px){:root{--menu-w:196px}.products{padding-left:16px;padding-right:16px}.left-menu-item{font-size:13px}}
@media(max-width:768px){.left-menu{padding:6px 10px;gap:6px}.left-menu-item{min-height:44px;white-space:nowrap;border-left:0;border-radius:10px;padding:9px 14px;font-size:13px;flex-shrink:0}.left-menu-item.active{border-left:0;border-bottom:4px solid #35a78c}.left-menu-item:hover{transform:none}.products-head{padding:18px 16px;border-radius:16px}.products-head h2{font-size:22px}.kky-category-grid{gap:12px}.kky-category-section>h2{font-size:20px}.product-card .card-quick-add{font-size:13px;border-radius:10px}.modal-card{border-radius:18px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{transition:none!important;animation:none!important}}
.product-card:focus-within .card-quick-add{opacity:1;transform:none}

/* v1.59: bounded, uncropped product photos and optional personalization */
.modal{touch-action:auto;overscroll-behavior:contain}.modal-card{min-width:0}.modal-image{aspect-ratio:auto;height:clamp(180px,36vh,340px);padding:16px;flex-shrink:0;overflow:hidden}.modal-image img{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:contain;object-position:center}.modal-body{min-width:0;overflow-wrap:anywhere}.modal-body h3{line-height:1.4}.kky-personal-details{border-top:1px solid #e0eae4;margin-top:20px;padding-top:16px}.kky-personal-details h4{margin:0 0 12px;color:#294238;font-size:15px}.modal-actions{position:sticky;bottom:-18px;background:white;padding:12px 0;margin-top:12px;z-index:1}@media(max-width:768px){.modal-image{height:clamp(160px,30vh,260px);padding:12px}.modal-card{max-height:calc(100dvh - 32px)} }
.modal-actions{bottom:0;padding:12px 0 4px}.modal-body{padding-bottom:22px}
