/* KANO Tasarla  Mobile Polish
   Sadece UI grnm iyiletirme (JS davran deitirmez)
*/

@media (max-width: 900px) {
  :root{
    --kano-dock-h: 78px;
    --kano-gap: 10px;
    --kano-radius: 22px;
  }

  /* ====== VIEWPORT LOCK (prevents 'green area') ======
     We keep the editor exactly between header and dock.
     Requires JS: body.kano-v18-mobile-dock (already added in tasarla.js)
  */
  body.kano-v18-mobile-dock{
    height: 100%;
    overflow: hidden;
    padding-bottom: 0 !important;
  }
  html:has(body.kano-v18-mobile-dock){
    height: 100%;
    overflow: hidden;
  }

  /* override the huge padding-bottom coming from mobile_overrides_iphone1.css */
  body.kano-v18-mobile-dock .designer-center{
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }

  /* lock editor viewport */
  body.kano-v18-mobile-dock .designer-editor,
  body.kano-v18-mobile-dock .designer-center{
    height: calc(100dvh - var(--kanoHeaderH, 56px) - var(--kano-dock-h) - env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
  }

  /* preview area fills remaining space */
  body.kano-v18-mobile-dock .designer-preview{
    height: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  :root{ --kanoHeaderH: 56px; }

  /* Canvas area: do NOT create fake bottom space (green area).
     We lock the editor viewport instead. */

  /* Backdrop (JS display:block/none yapyor) */
  #kanoDockBackdrop{
    background: rgba(0,0,0,.35);
  }

  /* ====== BOTTOM DOCK ====== */
  #kanoMobileDock{
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: var(--kano-dock-h);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--kano-gap);
    z-index: 9999;

    background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 -10px 30px rgba(0,0,0,.10);
  }

  .kano-dock-btn{
    height: 56px;
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,.10);
    background: rgba(255,255,255,.98);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 6px;
    -webkit-tap-highlight-color: transparent;
  }

  .kano-dock-ico{
    width: 24px; height: 24px;
    display: grid;
    place-items: center;
  }

  .kano-dock-ico svg{
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .kano-dock-ico img{
    width: 22px;
    height: 22px;
    display: block;
  }

  .kano-dock-txt{
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    opacity: .92;
  }

  /* Primary CTA: Sipari Ver (btnOrder dock iine tanyor) */
  #btnOrder.kano-dock-orderbtn{
    width: 100%;
    height: 56px;
    border-radius: 18px;
    border: 0;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: .2px;
    box-shadow: 0 10px 20px rgba(0,0,0,.12);
  }

  /* ====== SHEETS (Add / Product) ======
     JS bodyye kano-add-open / kano-product-open atyor.
  */
  #kanoAddSheet,
  #kanoProductSheet{
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--kano-dock-h) + 12px + env(safe-area-inset-bottom));
    z-index: 9998;

    background: rgba(255,255,255,.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0,0,0,.10);
    border-radius: var(--kano-radius);
    box-shadow: 0 18px 40px rgba(0,0,0,.14);

    max-height: min(44vh, 340px);
    overflow: auto;

    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }

  /* Kk handle hissi */
  #kanoAddSheet::before,
  #kanoProductSheet::before{
    content:"";
    display:block;
    width: 52px;
    height: 5px;
    border-radius: 999px;
    margin: 10px auto 6px;
    background: rgba(0,0,0,.14);
  }

  body.kano-add-open #kanoAddSheet{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  body.kano-product-open #kanoProductSheet{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Sheet i padding */
  #kanoAddSheet .kano-sheet-inner,
  #kanoProductSheet .kano-sheet-inner{
    padding: 8px 10px 12px;
  }

  /* Add sheet itemlar daha premium ve daha az plastik */
  .kano-sheet-item{
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,.10);
    background: rgba(255,255,255,.98);
    padding: 12px 14px;
    font-weight: 700;
  }

  .kano-sheet-ico img{
    width: 22px;
    height: 22px;
  }

  /* Product sheet top link */
  #kanoChangeProductBtn{
    font-weight: 800;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,.06);
  }

  /* ====== Views strip (n/Arka/Sol/Sa) ======
     Bunu daha yatay scroll + snap gibi premium yapyoruz.
  */
  #kanoProductViewsMount .designer-views-strip{
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 2px 2px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  #kanoProductViewsMount .designer-view-thumb{
    scroll-snap-align: start;
    min-width: 88px;
    padding: 10px 10px 8px;
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,.10);
    background: rgba(255,255,255,.98);
    box-shadow: none;
  }

  #kanoProductViewsMount .designer-view-thumb img{
    width: 34px;
    height: 34px;
    object-fit: contain;
    margin-bottom: 6px;
  }

  #kanoProductViewsMount .designer-view-thumb span{
    font-size: 12px;
    font-weight: 700;
    opacity: .92;
  }

  /* Seili grnm: daha net ama barmayan */
  #kanoProductViewsMount .designer-view-thumb.is-selected{
    border-width: 2px;
  }

  /* Kk estetik: scroll bar gizle */
  #kanoProductViewsMount .designer-views-strip::-webkit-scrollbar{
    height: 0;
  }
}


/* =========================================================
   SPREADSHIRT-LIKE MOBILE HEADER (single row)
   - Search becomes icon-only so everything fits
   ========================================================= */
@media (max-width: 520px){

  header.site-header .utility-bar{ display:none !important; }

  header.site-header .nav-search-bar .nav-search-inner,
  header.site-header .nav-search-inner{
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;

    padding: 8px 12px !important;
    min-height: var(--kanoHeaderH, 56px) !important;

    grid-template-columns: unset !important;
    grid-template-areas: unset !important;
  }

  header.site-header .nav-center{ display:none !important; }

  header.site-header .header-actions,
  header.site-header .header-actions.header-right{
    width: auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 14px !important;
  }

  header.site-header .header-logo{ flex: 0 0 auto !important; }
  header.site-header .header-logo img{
    height: 22px !important;
    width: auto !important;
    display: block !important;
  }

  header.site-header form.header-search-main{
    flex: 0 0 auto !important;
    width: 40px !important;
    height: 40px !important;
    max-width: none !important;
    margin: 0 !important;
    position: relative !important;
  }
  header.site-header form.header-search-main input,
  header.site-header form.header-search-main .search-suggestions{
    display:none !important;
  }
  header.site-header form.header-search-main button{
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    display: grid !important;
    place-items: center !important;
    position: static !important;
  }

  header.site-header a.header-fav,
  header.site-header button.header-cart.header-icon{
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    display: grid !important;
    place-items: center !important;
  }

  header.site-header .ui-ico{
    width: 22px !important;
    height: 22px !important;
  }

  header.site-header .cart-badge{
    top: -6px !important;
    right: -6px !important;
  }
}


/* ====== PRODUCT PICKER OVERLAY (mobilde Spreadshirt gibi tek kolon, taşma yok) ====== */
@media (max-width: 980px){
  body.kano-v18-mobile-dock .product-picker-overlay{
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
  }
  body.kano-v18-mobile-dock .product-picker-shell{
    width: 100vw;
    max-width: none;
    height: calc(100dvh - var(--kano-dock-h) - env(safe-area-inset-bottom));
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
  body.kano-v18-mobile-dock .product-picker-topbar{
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
  }
  body.kano-v18-mobile-dock .product-picker-content{
    grid-template-columns: 1fr;
    min-height: 0;
  }
  body.kano-v18-mobile-dock .mini-store-sidebar{
    display:none;
  }
  body.kano-v18-mobile-dock .mini-store-main{
    overflow:auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ====== DESIGN PICKER: categories <-> designs view (mobile) ====== */
  #designPickerOverlay.kano-designs-view .design-picker-sidebar{
    display: none !important;
  }
  #designPickerOverlay.kano-designs-view .design-picker-body{
    grid-template-columns: 1fr !important;
  }
  /* back button in overlay header (shown only in designs view) */
  #designPickerBack{
    display: none;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 44px;
    padding: 0 10px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.10);
    background: rgba(255,255,255,.95);
    font-size: 18px;
    line-height: 1;
    margin-right: 10px;
    -webkit-tap-highlight-color: transparent;
  }
  #designPickerOverlay.kano-designs-view #designPickerBack{
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  body.cart-open #kanoMobileDock {
    display: none !important;
  }
}

/* === KANO item toolbar skin === */
.kano-item-toolbar{
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 6px 8px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);

  /* sizde position/left/top/transform inline geliyor, dokunmuyoruz */
}

/* Butonları net kare ve center */
.kano-item-toolbar button{
  width: 30px;
  height: 30px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;                 /* mevcut 1px 6px gibi padding'i sıfırla */
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 10px;

  background: #f8fafc;
  cursor: pointer;

  /* browser default'larını yumuşat */
  -webkit-tap-highlight-color: transparent;
}

/* Hover/Active */
.kano-item-toolbar button:hover{
  background: #f1f5f9;
}
.kano-item-toolbar button:active{
  transform: translateY(1px);
}

/* Klavye ile fokus (a11y) */
.kano-item-toolbar button:focus-visible{
  outline: 2px solid rgba(37, 99, 235, .55);
  outline-offset: 2px;
}

/* İkonlar: square box + contain => trash.svg gibi dik oranlar bozulmaz */
.kano-item-toolbar .kano-tool-icon{
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
  pointer-events: none; /* tıklama her zaman butona gitsin */
}

/* Delete butonu ayrı dil: biraz “danger” */
.kano-item-toolbar button[data-act="del"]{
  background: #fff5f5;
  border-color: rgba(239, 68, 68, .25);
}
.kano-item-toolbar button[data-act="del"]:hover{
  background: #ffecec;
}

/* İstersen delete ikonu kırmızıya çekmek için (svg siyahsa çalışır, renkli svg'de gereksiz) */
.kano-item-toolbar button[data-act="del"] .kano-tool-icon{
  /* bu filter siyah ikonu kırmızıya yaklaştırır */
  filter: invert(30%) sepia(86%) saturate(2400%) hue-rotate(345deg) brightness(100%) contrast(95%);
}

.kano-measure-tooltip,
.kano-measure-tooltipip {
  transform: translateX(-50%) !important;
}
