/*
Theme Name: Prekes1 (Custom)
Author: ChatGPT
Version: 1.0.0
Text Domain: prekes1
*/

:root{
  --blue:#0a74ff;
  --black:#0b0b0b;
  --bg:#f3f4f6;
  --card:#ffffff;
  --muted:#6b7280;
  --radius:16px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color:#111827;
}

/* Layout */
.container{
  width:min(1200px, calc(100% - 32px));
  margin-inline:auto;
}

a{color:inherit; text-decoration:none}
img{max-width:100%; height:auto; display:block}

/* Top bar */
.topbar{
  background: var(--black);
  color:#fff;
  font-size:13px;
}
.topbar .row{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px 0;
  letter-spacing:.2px;
}

/* Header */
.site-header{
  background: var(--blue);
  color:#fff;
}
.header-main{
  display:flex;
  align-items:center;
  gap:16px;
  padding:14px 0;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:220px;
}
.brand .site-title{
  font-weight:800;
  font-size:28px;
  line-height:1;
}
.brand .site-title span{opacity:.95}
.search{
  flex:1;
  display:flex;
  align-items:center;
  gap:10px;
}
.search form{
  width:100%;
  display:flex;
  align-items:center;
  background:#fff;
  border-radius:999px;
  padding:10px 12px;
}
.search input[type="search"]{
  border:0;
  outline:0;
  width:100%;
  font-size:15px;
}
.search button{
  border:0;
  background:var(--blue);
  color:#fff;
  border-radius:999px;
  width:40px;
  height:40px;
  cursor:pointer;
}
.header-actions{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:120px;
  justify-content:flex-end;
}
.icon-btn{
  width:40px;height:40px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.14);
}
.icon-btn:hover{background:rgba(255,255,255,.22)}

/* Nav row */
.nav-row{
  background:#fff;
  border-bottom:1px solid #e5e7eb;
}
.nav-inner{
  display:flex;
  align-items:center;
  gap:14px;
  padding:10px 0;
}
.all-products{
  display:flex;
  align-items:center;
  gap:10px;
  background: var(--blue);
  color:#fff;
  border-radius:10px;
  padding:10px 14px;
  font-weight:700;
  white-space:nowrap;
}
.primary-menu{
  display:flex;
  gap:18px;
  align-items:center;
  flex-wrap:wrap;
}
.primary-menu a{
  color:#111827;
  font-weight:600;
  font-size:14px;
}
.primary-menu a:hover{color:var(--blue)}

/* Main blocks */
.home-grid{
  display:grid;
  grid-template-columns: 1fr 0.9fr 1fr;
  gap:18px;
  padding:18px 0 26px;
}
.panel{
  background:var(--card);
  border-radius: var(--radius);
  padding:14px;
  box-shadow: 0 6px 20px rgba(17,24,39,.06);
}
.panel h2{
  margin:0 0 12px;
  font-size:22px;
  font-weight:800;
}

/* Product list grid (2x2 like screenshot) */
.products-2x2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.product-card{
  border:1px solid #e5e7eb;
  border-radius:14px;
  overflow:hidden;
  background:#fff;
  position:relative;
}
.product-card .thumb{
  aspect-ratio: 1 / 1;
  background:#f9fafb;
  display:grid;
  place-items:center;
}
.product-card .meta{
  padding:10px 10px 12px;
}
.product-card .title{
  font-weight:700;
  font-size:13px;
  line-height:1.2;
  height:32px;
  overflow:hidden;
}
.product-card .price{
  margin-top:8px;
  display:flex;
  align-items:baseline;
  gap:8px;
  flex-wrap:wrap;
}
.product-card .price ins{
  text-decoration:none;
  font-weight:900;
}
.product-card .price del{
  color:var(--muted);
  font-size:13px;
}
.badge-pickup{
  margin-top:8px;
  font-size:12px;
  color:#059669;
  font-weight:800;
  display:flex;
  align-items:center;
  gap:6px;
}
.actions{
  position:absolute;
  right:10px;
  top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.mini-btn{
  width:34px;height:34px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.mini-btn:hover{border-color:#cbd5e1}

/* Top pasirinkimai tiles */
.tiles{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.tile{
  border-radius:16px;
  overflow:hidden;
  position:relative;
  min-height:180px;
  display:flex;
  align-items:flex-end;
  background:#e5e7eb;
}
.tile .label{
  width:100%;
  padding:12px;
  background:rgba(255,255,255,.9);
  font-weight:900;
}
.tile img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
}

/* Footer */
.site-footer{
  background: var(--black);
  color:#fff;
  padding:30px 0;
  margin-top:10px;
}
.footer-grid{
  display:grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap:20px;
  align-items:start;
}
.footer-title{
  font-weight:900;
  margin:0 0 10px;
}
.footer-links a{
  display:block;
  color:#d1d5db;
  padding:6px 0;
  font-weight:600;
  font-size:14px;
}
.footer-links a:hover{color:#fff}
.flags{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.flag-item{
  display:flex;
  align-items:center;
  gap:10px;
  color:#e5e7eb;
  font-weight:800;
}
.flag-dot{
  width:22px;height:14px;border-radius:3px;background:#374151;
}
.footer-bottom{
  border-top:1px solid rgba(255,255,255,.08);
  margin-top:22px;
  padding-top:14px;
  color:#9ca3af;
  font-size:13px;
  text-align:center;
}

/* Responsive */
@media (max-width: 980px){
  .home-grid{grid-template-columns: 1fr; }
  .brand{min-width:auto}
  .header-main{flex-wrap:wrap}
  .header-actions{min-width:auto}
}

/* Fix custom logo sizing */
.logo img, .custom-logo{
  max-height:48px;
  width:auto;
}
.brand .logo a{display:flex; align-items:center}

/* Ensure header/nav are full-width on desktop */
.site-header, .nav-row, .topbar, .site-footer{width:100%}

/* Improve desktop spacing */
@media (min-width: 981px){
  .header-main{gap:22px}
  .search form{max-width:720px}
}
/* === HARD LIMIT LOGO SIZE (works with .custom-logo-link + img.custom-logo) === */
.site-header .brand{
  min-width: 0 !important;      /* nuima priverstinį plotį */
}

.site-header .logo{
  max-width: 220px !important;  /* maksimalus logo zonos plotis */
  width: 220px;                 /* fiksuotas, kad neaugtų */
  display: flex;
  align-items: center;
}

.site-header .custom-logo-link{
  display:flex !important;
  align-items:center !important;
  max-height: 52px !important;  /* max aukštis */
  width: 100% !important;
}

.site-header img.custom-logo{
  max-height: 52px !important;  /* svarbiausia */
  max-width: 220px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}
