/*
Theme Name: Storefront Custom Header
Template: storefront
Version: 2.6
*/

*,
*::before,
*::after { box-sizing: border-box; }

/* Remove purple outlines only for header/nav */
.site-header a:focus,
.site-header a:focus-visible,
.site-header button:focus,
.site-header button:focus-visible,
.site-header input:focus,
.site-header input:focus-visible,
.site-header textarea:focus,
.site-header textarea:focus-visible,
.site-header select:focus,
.site-header select:focus-visible,
.custom-main-nav a:focus,
.custom-main-nav a:focus-visible{
  outline: none !important;
  box-shadow: none !important;
}
.site-header a, .site-header button { -webkit-tap-highlight-color: transparent; }
.site-header input, .site-header select, .site-header textarea { -webkit-tap-highlight-color: transparent; }

/* Hide Storefront defaults if they appear */
.main-navigation,
.storefront-handheld-navigation,
.handheld-navigation,
.menu-toggle,
.storefront-handheld-footer-bar{
  display:none !important;
}

/* =========================
   DESKTOP HEADER (NO CUT-OFF)
========================= */
.site-header { padding:0 !important; margin:0 !important; }

.site-header .col-full{
  padding: 12px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  flex-wrap: wrap;            /* allows nav row */
}

/* Force branding left (fix "logo goes right") */
.site-header .site-branding{
  float:none !important;
  width:auto !important;
  margin:0 !important;
  flex: 0 0 auto;
  text-align:left !important;
}
.site-header .site-branding a{ display:inline-flex; align-items:center; }
.site-header .site-branding img{ max-height: 56px; width:auto; }

/* Tools area right */
.custom-header-tools{
  flex: 1 1 auto;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  min-width: 0;
}

/* Desktop tools: search shrinks BEFORE overflowing */
.custom-header-tools-desktop{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 18px;
  width: 100%;
  min-width: 0;
}

/* Search: flexible and never cut off */
.custom-header-search{
  flex: 1 1 540px;        /* can shrink */
  max-width: 760px;       /* stays wide when possible */
  min-width: 260px;
  min-width: 0;           /* allow true shrink */
  overflow: visible;
}

/* =========================
   SEARCH BAR (UPDATED ONLY)
========================= */

/* WooCommerce search form (match screenshot) */
.site-search{ margin:0 !important; padding:0 !important; overflow: visible; }
.woocommerce-product-search{
  display:flex;
  width:100% !important;
  margin:0 !important;
  min-width: 0;
}

/* Input: light background + subtle border */
.woocommerce-product-search input[type="search"]{
  flex:1 1 auto;
  min-width: 0;
  border:1px solid #d1d5db;
  border-right:0;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 3px 0 0 3px;
  height: 40px;
  line-height: 40px;
  outline: none;
  box-shadow: none;
  background:#f9fafb;
}

.woocommerce-product-search input[type="search"]:focus{
  outline: none !important;
  box-shadow: none !important;
}

/* Button: dark square with white SVG magnifier */
.woocommerce-product-search button[type="submit"]{
  width:48px;
  min-width:48px;
  border:1px solid #0f2236;
  background:#0f2236;
  border-radius: 0 3px 3px 0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  font-size:0;             /* hide text */
  line-height:0;
  height: 40px;
}
.woocommerce-product-search button[type="submit"]::before{
  content:"";
  width:18px;
  height:18px;
  display:block;
  background-repeat:no-repeat;
  background-position:center;
  background-size:18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.2-3.2'/%3E%3C/svg%3E");
}

/* Desktop buttons */
.custom-header-buttons{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 0 0 auto;
}
.custom-btn{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  background:#fff;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-weight: 600;
  text-decoration:none;
  color:#111827;
  white-space:nowrap;
}
.custom-btn:hover{ background:#f3f4f6; }

/* If space gets tight on desktop, drop search to its own line instead of cutting off */
@media (max-width: 980px){
  .custom-header-tools-desktop{ flex-wrap: wrap; }
  .custom-header-search{
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* =========================
   DESKTOP NAV BAR
========================= */
.custom-main-nav{
  flex: 0 0 100%;
  width:100%;
  background-color:#0f2236;
  border-bottom: 2px solid #1e73be;
  padding: 0 22px;
}

.custom-menu{
  list-style:none;
  margin:0 auto;
  padding:0;
  display:flex;
  max-width: 1400px;
}
.custom-menu > li{
  flex:1;
  text-align:center;
  position:relative;
}
.custom-menu > li > a{
  display:block;
  padding: 12px 10px;
  color:#fff;
  text-decoration:none;
  font-size: 19px;
  font-weight: 500;
  transition: background-color .2s ease;
  position:relative;
}
.custom-menu > li:not(:last-child)::after{
  content:"";
  position:absolute;
  right:0; top:0;
  height:100%;
  width:1px;
  background: rgba(255,255,255,.35);
}
.custom-menu > li > a:hover{ background-color:#2c3f6d; }

/* Wrap nav items on smaller desktop */
@media (max-width: 1100px){
  .custom-menu{ flex-wrap: wrap; justify-content:flex-start; }
  .custom-menu > li{ flex: 0 0 auto; text-align:left; }
  .custom-menu > li > a{ padding: 12px 16px; font-size: 17px; }
  .custom-menu > li::after{ display:none; }
}

/* Desktop: hide mobile UI */
.custom-header-tools-mobile{ display:none; }
.mobile-search-panel{ display:none; }

/* =========================
   MOBILE (NO OVERLAP + LEFT MENU)
========================= */
@media (max-width: 768px){

  .site-header .col-full{
    padding: 10px 12px;
    gap: 10px;
    display:flex;
    flex-direction: column;   /* prevent any logo/tool overlap */
    align-items: stretch;
  }

  /* Branding row on its own line (no overlap with tools) */
  .site-header .site-branding{
    width: 100% !important;
    text-align: center !important;
    margin: 0 !important;
  }
  .site-header .site-branding a{ justify-content:center; }

  /* Hide desktop header/nav */
  .custom-header-tools-desktop{ display:none !important; }
  .custom-main-nav{ display:none !important; }

  .custom-header-tools{
    flex: 0 0 100%;
    justify-content:flex-start;
    min-width: 0;
  }

  .custom-header-tools-mobile{
    display:flex !important;
    width:100%;
    align-items:center;
    justify-content:space-between;
    gap: 12px;
  }

  /* Burger left, bigger */
  .mobile-burger-btn{
    appearance:none;
    border:0;
    background:transparent;
    display:flex;
    align-items:center;
    gap: 10px;
    padding: 10px 4px;
    font-weight: 800;
    color:#111827;
    flex: 0 0 auto;
    line-height: 1;
    cursor: pointer;
  }
  .mobile-burger-btn svg{ display:block; }

  /* Hide the "Menü" text on very small screens */
  @media (max-width: 360px){
    .mobile-menu-label{ display:none; }
  }

  /* Right icons: fixed size -> no overlap */
  .mobile-right-icons{
    display:flex;
    align-items:center;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .mobile-icon-btn{
    appearance:none;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;            /* CRITICAL: no shrinking */
    border: 1px solid #d1d5db;
    background:#fff;
    border-radius: 12px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    text-decoration:none;
    line-height:0;
    overflow: visible;
    color:#0f2236; /* for currentColor SVGs */
    cursor: pointer;
  }
  .mobile-icon-btn svg{
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display:block;
    width: 24px;
    height: 24px;
  }

  /* Prevent occasional "glitchy" SVG rendering on mobile */
  .mobile-icon-btn svg,
  .mobile-burger-btn svg{
    shape-rendering: geometricPrecision;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  /* Search panel under the icons (toggle) */
  .mobile-search-panel{
    display:block;
    width:100%;
    max-height: 0;
    overflow:hidden;
    opacity: 0;
    transition: max-height .25s ease, opacity .25s ease;
  }
  .mobile-search-panel.is-open{
    max-height: 140px;
    opacity: 1;
  }

  #mobile-search-panel .woocommerce-product-search{
    width:100% !important;
  }
  #mobile-search-panel input[type="search"]{
    width:auto;
    flex: 1 1 auto;
    font-size: 15px;
  }
}

/* =========================
   OFF-CANVAS MENU (LEFT)
========================= */
.mobile-panel-overlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,0.45);
  z-index: 9998;
}
.mobile-panel{
  position:fixed;
  z-index: 9999;
  background:#fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  transition: transform 0.25s ease;
}

/* LEFT slide-in */
.mobile-menu-panel{
  top:0;
  left:0;
  right:auto;
  height:100%;
  width: min(340px, 85vw);
  transform: translateX(-110%);
  padding: 12px 14px 18px;
}
.mobile-menu-panel.is-open{ transform: translateX(0); }

.mobile-menu-header{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  padding: 4px 0 10px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 10px;
}
.mobile-panel-close{
  appearance:none;
  border:0;
  background:transparent;
  padding:8px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.mobile-panel-close{ color:#111827; }
.mobile-panel-close svg{
  fill:none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display:block;
}

.mobile-menu{
  list-style:none;
  margin: 10px 0 0;
  padding: 0;
}
.mobile-menu > li{ border-bottom: 1px solid #eef2f7; }
.mobile-menu > li > a{
  display:block;
  padding: 14px 6px;
  text-decoration:none;
  color:#0f2236;
  font-size: 18px;
  font-weight: 600;
}

body.mobile-panel-open{ overflow:hidden; }
.admin-bar .mobile-menu-panel{ top: 32px; height: calc(100% - 32px); }

/* ================================
   FIX: DESKTOP SEARCH CUT-OFF
   (paste at very bottom of style.css)
==================================*/
@media (min-width: 769px){

  /* Make header a 2-row grid: branding + tools / nav */
  .site-header .col-full{
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "branding tools"
      "nav nav";
    align-items: center;
    gap: 16px;
  }

  .site-header .site-branding{
    grid-area: branding;
    justify-self: start;
    text-align: left !important;
    width: auto !important;
    float: none !important;
  }

  .custom-header-tools{
    grid-area: tools;
    width: 100% !important;
    justify-self: end;
    min-width: 0;
  }

  /* Give search a guaranteed column so it cannot collapse */
  .custom-header-tools-desktop{
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(520px, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-width: 0;
  }

  .custom-header-search{
    width: 100% !important;
    max-width: none !important;
    min-width: 520px;
  }

  .custom-header-search .site-search,
  .custom-header-search .woocommerce-product-search{
    width: 100% !important;
  }

  .custom-header-search .woocommerce-product-search input[type="search"]{
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Shorter desktop search bar */
@media (min-width: 300px){
  .custom-header-tools-desktop{
    /* shrink the search column */
    grid-template-columns: minmax(360px, 520px) auto !important;
  }

  .custom-header-search{
    min-width: 360px !important;
    max-width: 420px !important;
    width: 100% !important;
  }
}

/* If you want it even shorter, reduce these numbers (e.g. 320/460) */

/* If very tight, stack search above buttons instead of cutting */
@media (min-width: 300px) and (max-width: 400px){
  .custom-header-tools-desktop{
    grid-template-columns: 1fr !important;
  }
  .custom-header-buttons{
    justify-self: end;
  }
  .custom-header-search{
    min-width: 0;
  }
}