:root{
  --brand:#1273eb;
  --bg:#f9fafb;
  --radius:14px;
  --shadow:0 4px 12px rgba(0,0,0,.08);
}
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:Inter,system-ui,sans-serif;background:var(--bg);}
a{text-decoration:none;color:inherit}
img{max-width:100%;display:block}

/* =========================
   HEADER
   ========================= */
header {
  background: var(--brand);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

/* Topbar */
.topbar {
  max-width:1280px;
  margin:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:6px 12px;               /* ↓ tighter vertical space */
  gap:8px;                        /* minimal gap between items */
  flex-direction:column;          /* default stacked for mobile */
}

/* Brand */
.navbar-brand,
.brand a {
  font-size:22px;
  font-weight:700;
  color:#fff;
  text-decoration:none;
  text-align:center;
  width:100%;
  line-height:1.2;
  margin:0;
}

/* Search + menu row */
.search-menu {
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  justify-content:space-between;
  margin-top:0;
}

/* Search Bar */
.search {
  flex:1;
  display:flex;
}

.search input {
  width:100%;
  padding:8px 14px;
  font-size:15px;
  border:none;
  border-radius:var(--radius);
  outline:none;
  background:#fff;
  color:#333;
  box-shadow:0 2px 6px rgba(0,0,0,0.15);
  transition:all 0.3s ease;
}

.search input::placeholder {
  color:#777;
  font-style:italic;
}

.search input:focus {
  box-shadow:0 4px 10px rgba(0,0,0,0.25);
}

/* Hamburger */
.hamburger {
  display:flex;
  flex-direction:column;
  gap:5px;
  cursor:pointer;
}
.hamburger span {
  width:24px;
  height:3px;
  background:#fff;
  border-radius:3px;
}

/* Navigation links */
.nav-links {
  display:flex;
  gap:20px;
}
.nav-links a {
  color:#fff;
  font-weight:500;
  font-size:1rem;
  text-decoration:none;
}
.nav-links a:hover { text-decoration:underline; }

/* Desktop Layout */
@media (min-width:769px) {
  .topbar {
    flex-direction:row;
    justify-content:space-between;
    align-items:center;
    padding:10px 16px;
    gap:12px;
  }
  .navbar-brand {
    width:auto;
    text-align:left;
    font-size:26px;
  }
  .search-menu { width:auto; gap:12px; }
  .hamburger { display:none; }
}

/* Mobile Nav */
@media (max-width:768px) {
  .nav-links {
    display:none;
    flex-direction:column;
    background:var(--brand);
    position:absolute;
    top:60px;
    left:0;
    width:100%;
    padding:8px 0;
    text-align:center;
  }
  .nav-links.show { display:flex; }
}

/* =========================
   BANNER CAROUSEL (UNCHANGED)
   ========================= */
.banner-carousel {
  position:relative;
  overflow:hidden;
  max-width:1280px;
  margin:10px auto 0;
  border-radius:var(--radius);
}
.slides {
  display:flex;
  transition:transform .5s ease-in-out;
}
.slides img {
  width:100%;
  height:400px;
  object-fit:cover;
  flex-shrink:0;
}
@media(max-width:768px){
  .slides img{height:180px;}
}
.carousel-btn {
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  background:rgba(0,0,0,0.4);
  color:#fff;
  border:none;
  padding:8px 12px;
  font-size:18px;
  cursor:pointer;
  border-radius:50%;
  z-index:10;
}
.carousel-btn:hover{background:rgba(0,0,0,0.6);}
.prev{left:10px;}
.next{right:10px;}
.dots {
  position:absolute;
  bottom:10px;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  gap:6px;
}
.dot {
  width:10px;
  height:10px;
  border-radius:50%;
  background:rgba(255,255,255,.5);
  cursor:pointer;
}
.dot.active { background:#fff; }

/* =========================
   CATEGORY BAR (UNCHANGED)
   ========================= */
.catbar {
  background:#fff;
  box-shadow:var(--shadow);
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.catbar::-webkit-scrollbar { display:none; }
.catlist {
  display:flex;
  gap:18px;
  padding:12px 16px;
  width:max-content;
  margin:auto;
}
.catlist a {
  text-align:center;
  font-size:.8rem;
  font-weight:500;
  color:#111;
  width:70px;
  flex:0 0 auto;
}
.catlist img {
  width:55px;
  height:55px;
  object-fit:cover;
  border-radius:12px;
  margin-bottom:4px;
}

/* =========================
   PRODUCTS (UNCHANGED)
   ========================= */
.container { max-width:1280px; margin:auto; padding:20px 16px; }
.product-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:16px;
}
.product-card {
  background:#fff;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  text-align:center;
  transition:.2s;
}
.product-card:hover { transform:translateY(-3px); }
.product-card .thumb {
  aspect-ratio:1/1;
  background:#f3f4f6;
  display:grid;
  place-items:center;
}
.product-card img { max-height:100%; object-fit:contain; padding:6px; }
.product-card h3 {
  font-size:.9rem;
  margin:8px 0;
  height:36px;
  overflow:hidden;
}
.price { color:green; font-weight:700; margin-bottom:8px; }

/* =========================
   FOOTER (UNCHANGED)
   ========================= 
footer {
  background:#111827;
  color:#9ca3af;
  text-align:center;
  padding:16px;
  font-size:.9rem;*/
}
/* === FINAL FIX: Tighten gap between brand and search bar === */
@media (max-width: 768px) {
  header .topbar {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    gap: 2px !important;              /* reduce space between children */
  }

  header .navbar-brand,
  header .brand,
  header .brand a {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.1 !important;      /* tighter line height */
  }

  header .search-menu,
  header .search {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}

/* === SUPER-TIGHT HEADER GAP FIX === */
@media (max-width: 768px) {
  header .topbar {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    gap: 1px !important;              /* almost no space between rows */
  }

  header .navbar-brand,
  header .brand,
  header .brand a {
    font-size: 20px !important;       /* slightly smaller for tighter fit */
    margin: 0 !important;
    line-height: 1.0 !important;      /* very compact line height */
  }

  header .search-menu,
  header .search {
    margin: 0 !important;
    padding: 0 !important;
  }

  header .search input {
    padding: 6px 12px !important;     /* reduce input height */
    font-size: 14px !important;
  }
}
#prev-button,
#next-button {
  display: none !important;
}
