/*
Theme Name: SZP Minimal (Mobile-First) v0.2
Theme URI: https://svezaprofesionalce.rs/
Author: SZP + ChatGPT
Version: 0.2.0
Description: Ultra-minimal, fast WooCommerce theme with SZP colors (#0066CB, #FFD701) and navy bars (#004C94), mobile-first layout, AJAX search, back button.
Text Domain: szp-minimal
*/
:root{
  --topbar-h:56px;
  --szp-yellow:#FFD701;
  --szp-blue:#0066CB;
  --szp-navy:#004C94; /* teget trake */
  --radius:14px;
  --border:2px;
}

html{ box-sizing:border-box; }
*,*:before,*:after{ box-sizing:inherit; }
body{
  margin:0; font-family:'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height:1.4; color:#111; background:#fff;
}
a{ color:var(--szp-blue); text-decoration:none; }
a:hover{ text-decoration:underline; }
.container{ width:100%; max-width:1200px; margin:0 auto; padding:0 12px; }

/* Header with navy bars ("teget trake") */
.site-header{
  background:#fff; border-bottom:3px solid var(--szp-yellow);
}
.topbar{
  background:var(--szp-navy);
  color:#fff;
}
.topbar .inner {
  display:flex;
  align-items:center;
  gap:.75rem; padding:.6rem .75rem;
}
.brand {
  font-weight: 900;
  font-size: 1.7rem;
  letter-spacing: 0.6px;
  color: var(--szp-yellow);
  display:flex;
  align-items:center;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.brand a{ color:var(--szp-yellow); text-decoration:none; }
.header-search{ margin-left:auto; position:relative; max-width:520px; flex:1; }
.header-search input[type="search"]{
  width:100%; padding:.6rem .9rem; border:2px solid var(--szp-yellow);
  border-radius:12px; outline:none; background:#fff; color:#111;
}

/* Autocomplete dropdown */
.autocomplete{
  position:absolute; left:0; right:0; top:calc(100% + 6px);
  background:#fff; border:2px solid var(--szp-blue); border-radius:12px;
  box-shadow:0 10px 20px rgba(0,0,0,.08); z-index:9999; display:none; max-height:60vh; overflow:auto;
}
.autocomplete-item{ padding:.6rem .8rem; border-bottom:1px solid #eee; }
.autocomplete-item:last-child{ border-bottom:0; }
.autocomplete-item a{ color:#111; text-decoration:none; display:block; }
.autocomplete-empty{ padding:.6rem .8rem; color:#666; }

/* Horizontal main menu ("glavne kategorije / akcije") */
.navbar{}
.navbar .menu {
  display: flex;
  gap: 0.6rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: center;        /* vertically center items */
  padding: .4rem .75rem;
  margin: 0;
  list-style: none;
}
.navbar .menu a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: .3rem .1rem;
  border: none;
  border-radius: 0;
  position: relative;
}
.navbar .menu a:hover{ background:rgba(255,255,255,.07); text-decoration:none; }

/* Shop Title + Banner (between navbar and grid) */
.szp-shop-title{
  font-size:1.6rem; font-weight:700; color:var(--szp-yellow);
  margin:1rem .75rem .5rem; text-align:left;
}
.szp-shop-title a{ color:inherit; text-decoration:none; }
.szp-shop-banner{ width:100%; display:block; margin:0 auto 1rem; border-radius:var(--radius); }

/* Grid: category tiles (centered titles) */
.woocommerce ul.products li.product-category a{
  display:flex; flex-direction:column; justify-content:center; align-items:center;
  text-align:center; padding:1rem; border:var(--border) solid var(--szp-blue);
  border-radius:var(--radius); background:linear-gradient(0deg, rgba(255,215,1,.06), rgba(255,215,1,.06));
  min-height:130px;
}
.woocommerce ul.products li.product-category .woocommerce-loop-category__title{
  width:100%; text-align:center; margin-top:.5rem;
}

/* Subcategory pages: blue title with yellow underline */
.szp-subcat-title{ color:var(--szp-blue); display:inline-block; font-weight:600; padding-bottom:6px; position:relative; }
.szp-subcat-title:after{ content:""; position:absolute; left:0; bottom:0; width:100%; height:3px; background:var(--szp-yellow); border-radius:2px; }

/* Back one level button (bottom, centered) */
.szp-back-wrap{ display:flex; justify-content:center; margin:1.25rem 0 1.5rem; }
.szp-back{
  display:inline-flex; align-items:center; gap:.5rem;
  background:var(--szp-yellow); color:#111; padding:.55rem .9rem; border-radius:999px;
  font-weight:700; text-decoration:none; border:2px solid var(--szp-blue);
}
.szp-back:hover{ filter:brightness(.98); text-decoration:none; }

/* Footer */
.site-footer{
  margin-top:2rem; border-top:3px solid var(--szp-yellow); padding:1rem .75rem; text-align:center;
}
.site-footer a{ color:var(--szp-blue); }


/* Sticky header (teget traka ostaje vidljiva) */
.site-header{ background:#fff; border-bottom:3px solid var(--szp-yellow); }
.site-header.scrolled {
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
}
/* Ensure dropdowns from header are above content */
.topbar, .navbar{}

.szp-shop-banner-wrap{display:block;margin:0 auto 1rem;}

/* Minimalist navbar underline effect */
.navbar .menu {
  display: flex;
  gap: 0.6rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: center;        /* vertically center items */
  padding: .4rem .75rem;
  margin: 0;
  list-style: none;
}
.navbar .menu li {
  display: inline-block;
}
.navbar .menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0%;
  height: 2px;
  background: var(--szp-yellow);
  transition: width 0.25s ease;
}
.navbar .menu a:hover,
.navbar .menu .current-menu-item a {
  color: var(--szp-yellow);
}
.navbar .menu a:hover::after,
.navbar .menu .current-menu-item a::after {
  width: 100%;
}


/* Active menu highlighting (current page / ancestor) */
.navbar .menu .current-menu-item a,
.navbar .menu .current-menu-ancestor a {
  color: var(--szp-yellow);
}
.navbar .menu .current-menu-item a::after,
.navbar .menu .current-menu-ancestor a::after {
  width: 100%;
}


/* Two-stage sticky: topbar + navbar */
.topbar{ position: sticky; top: 0; z-index: 1002; }
.navbar{}

/* Heights for proper offset */
.topbar .inner{ min-height: var(--topbar-h); }
@media (min-width:768px){
  :root{ --topbar-h:64px; }
}

/* Shadows when page scrolled */
.topbar.stuck, .navbar.stuck{ box-shadow: 0 8px 18px rgba(0,0,0,.08); }


/* v0.3.1: Minimalist thin navbar text */
.navbar .menu a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 0.25rem 0.2rem;
}

@media (min-width:768px){
  .navbar .menu a {
    font-size: 0.85rem;
  }
}


/* v0.3.2: Navbar minimalist with font-weight 300 */
.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--szp-navy);
  border-bottom: 3px solid var(--szp-yellow);
  min-height: 44px;
}
.navbar .menu {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.navbar .menu a {
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.2px;
  padding: 0.25rem 0.25rem;
}


/* v0.3.3: Align navbar with brand "SVE ZA PROFESIONALCE" */
.topbar .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.navbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  background: var(--szp-navy);
  border-bottom: 3px solid var(--szp-yellow);
  min-height: 44px;
  padding-left: 1rem;
}


/* v0.3.4: Mobile menu wraps into multiple rows (no horizontal scroll) */
@media (max-width: 767px) {
  .navbar .menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
    overflow-x: visible;
    padding: .5rem .75rem;
  }
}


/* v0.3.5: Menu inside topbar (brand + menu + search) */
.topbar{ position: sticky; top: 0; z-index: 1002; }
.topbar .inner{
  display:flex;
  flex-wrap: wrap;            /* allow wrapping on mobile */
  align-items:center;
  justify-content: space-between;
  gap:.5rem .75rem;
  min-height: var(--topbar-h);
}
.topbar .menu{
  display:flex;
  flex-wrap: wrap;            /* mobile wraps into rows */
  justify-content:center;
  align-items:center;
  gap:.5rem 1rem;
  margin:0;
  padding:0;
  list-style:none;
  flex: 1 1 auto;             /* occupy middle space */
  order: 2;                   /* sit after brand on small screens if wraps */
}
.topbar .menu li{ display:inline-block; }
.topbar .menu a{
  font-size:.85rem;
  font-weight:300;            /* minimalist thin */
  letter-spacing:.2px;
  color:#fff;
  text-decoration:none;
  padding:.25rem .25rem;
  position:relative;
}
/* underline hover/active */
.topbar .menu a::after{
  content:""; position:absolute; left:0; bottom:-3px; width:0%; height:2px;
  background:var(--szp-yellow); transition:width .25s ease;
}
.topbar .menu a:hover,
.topbar .menu .current-menu-item a,
.topbar .menu .current-menu-ancestor a{ color:var(--szp-yellow); }
.topbar .menu a:hover::after,
.topbar .menu .current-menu-item a::after,
.topbar .menu .current-menu-ancestor a::after{ width:100%; }

/* Keep brand left, search right */
.brand{ flex:0 0 auto; }
.header-search{ flex:0 0 auto; }

/* Mobile: put brand first, then menu full width, then search */
@media(max-width:767px){
  .brand{ order:1; width:auto; }
  .topbar .menu{ order:2; width:100%; }
  .header-search{ order:3; width:100%; }
}


/* v0.3.6: Permanent yellow underline for all menu items, stronger for active/ancestor */
.topbar .menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: var(--szp-yellow);
  opacity: 0.5; /* default lighter underline */
  transition: opacity .25s ease;
}
.topbar .menu .current-menu-item a::after,
.topbar .menu .current-menu-ancestor a::after {
  opacity: 1; /* full strength underline for active item and its ancestors */
}
.topbar .menu a:hover::after {
  opacity: 1; /* also brighten on hover */
}


/* v0.3.7: Thinner underline closer to text */
.topbar .menu a::after {
  bottom: -1px;  /* closer to letters */
  height: 1px;   /* thinner line */
}


/* v0.3.8: Solid underline (no transition, always full yellow) */
.topbar .menu a::after {
  bottom: -1px;
  height: 1px;
  background: var(--szp-yellow);
  width: 100%;
  opacity: 1 !important;
  transition: none !important;
}


/* v0.3.9: Underline only on active/ancestor menu items, closer to text */
.topbar .menu a::after {
  content: none !important; /* no underline by default */
}
.topbar .menu .current-menu-item a::after,
.topbar .menu .current-menu-ancestor a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0; /* as close as possible to text */
  width: 100%;
  height: 1px;
  background: var(--szp-yellow);
}


/* v0.3.10: Active/ancestor menu items also yellow text */
.topbar .menu .current-menu-item a,
.topbar .menu .current-menu-ancestor a {
  color: var(--szp-yellow);
}
