/* =====================================================
   HEADER.CSS — MoonLight
   ===================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; width: 100%;
  background-color: rgb(23,23,23);
  overflow-x: hidden;
}

/* ── APP WRAPPER ── */
#app-wrapper { display: flex; flex-direction: column; min-height: 100vh; width: 100%; }
#app-content  { flex: 1 0 auto; width: 100%; }

/* ── HEADER SHELL ── */
header {
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  height: 627px;
  width: 100%;
  position: relative;
  color: white;
  overflow: hidden;
}

/* Carousel fills header */
header .carousel,
header #headerCarousel {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; z-index: 1;
}
header .carousel-inner,
header .carousel-item,
header #headerCarousel .carousel-inner,
header #headerCarousel .carousel-item { height: 100%; }
header .carousel-item img,
header #headerCarousel .carousel-item img {
  object-fit: cover; height: 100%; width: 100%;
}

/* ── NAVBAR ── */
#navbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 48px;
  min-height: 64px;
  width: 100%;
  gap: 16px;
}

/* Transparent by default (over carousel) */
#navbar {
  background-color: rgba(23,23,23,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
/* ── BRAND (left) ── */
.navbar-brand {
  font-family: kapakana, sans-serif;
  color: white !important;
  font-size: 52px;
  line-height: 1;
  font-weight: normal;
  text-decoration: none !important;
  white-space: nowrap;
  justify-self: start;
  -webkit-text-stroke: 0;
}
.navbar-brand:hover,
.navbar-brand:visited,
.navbar-brand:active,
.navbar-brand:focus { color: white !important; text-decoration: none !important; }

/* ── DESKTOP SEARCH (in controls) ── */
.navbar-search {
  display: flex;
  align-items: center;
  width: 260px;
  max-width: 260px;
  background: rgba(255,255,255,0.1);
  border-radius: 25px;
  padding: 0 6px 0 16px;
  border: 1px solid rgba(255,255,255,0.18);
  transition: background 0.2s, border-color 0.2s;
}
.navbar-search:focus-within {
  background: rgba(255,255,255,0.18);
  border-color: rgba(223,191,151,0.5);
}
#search-bar {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 0.95rem;
  padding: 8px 0;
  min-width: 0;
}
#search-bar::placeholder { color: rgba(255,255,255,0.5); }
#lupabutton {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  opacity: 0.85;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
#lupabutton:hover { opacity: 1; }
#lupabutton i, #lupa { font-size: 16px; }

/* ── NAVBAR CONTROLS (right) ── */
.navbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

/* Icon button base */
.nav-icon-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  font-size: 20px;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.nav-icon-btn:hover { opacity: 1; }

/* Search toggle only visible < 600px */
.search-toggle-btn { display: none; }

/* ── SEARCH OVERLAY (mobile) ── */
.search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: #15181a;
  z-index: 2000;
  padding: 12px 16px;
  display: none;
  align-items: center;
}
.search-overlay.open { display: flex; }
[data-theme="light"] .search-overlay { background: #f8f5f0; }
.search-overlay form {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 25px;
  padding: 0 6px 0 16px;
  border: 1px solid rgba(255,255,255,0.18);
}
[data-theme="light"] .search-overlay form {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.12);
}
#search-bar-overlay {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 1rem;
  padding: 10px 0;
}
[data-theme="light"] #search-bar-overlay { color: #1a1a1a; }
#search-bar-overlay::placeholder { color: rgba(255,255,255,0.4); }
[data-theme="light"] #search-bar-overlay::placeholder { color: #bbb; }
#searchOverlaySubmit,
#closeSearchOverlay {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  font-size: 18px;
  display: flex;
  align-items: center;
  opacity: 0.8;
}
[data-theme="light"] #searchOverlaySubmit,
[data-theme="light"] #closeSearchOverlay { color: #333; }
#searchOverlaySubmit:hover, #closeSearchOverlay:hover { opacity: 1; }

/* ── NO-CAROUSEL PAGES (cart, item, contacts…) ── */
body.no-carousel-page header {
  height: auto;
  min-height: unset;
  overflow: visible;
  background-color: #15181a;
}
body.no-carousel-page header #headerCarousel { display: none !important; }
body.no-carousel-page #navbar { background-color: #15181a !important; }
[data-theme="light"] body.no-carousel-page header,
[data-theme="light"] body.no-carousel-page #navbar { background-color: #f8f5f0 !important; }

/* No sticky on no-carousel pages */
body.no-carousel-page #navbar.sticky-navbar { position: static !important; box-shadow: none !important; }

@media (max-width: 590px) {
  body:not(.no-carousel-page) header { min-height: 280px; aspect-ratio: 1/1; height: auto; }
}

/* ── STICKY NAVBAR ── */
#navbar.sticky-navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  background-color: #15181a !important;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.6);
  animation: slideDown 0.3s ease forwards;
}
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}
[data-theme="light"] #navbar.sticky-navbar {
  background-color: rgba(248,245,240,0.98) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  backdrop-filter: blur(8px);
}

/* ── LIGHT THEME NAVBAR ── */
[data-theme="light"] #navbar,
[data-theme="light"] body.no-carousel-page #navbar {
  background-color: rgba(248,245,240,0.95) !important;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
[data-theme="light"] #navbar .navbar-brand { color: #1a1a1a !important; }
[data-theme="light"] #navbar .navbar-brand:hover,
[data-theme="light"] #navbar .navbar-brand:visited,
[data-theme="light"] #navbar .navbar-brand:active { color: #1a1a1a !important; }
[data-theme="light"] .navbar-search {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] #search-bar { color: #1a1a1a; }
[data-theme="light"] #search-bar::placeholder { color: #aaa; }
[data-theme="light"] #lupabutton { color: #1a1a1a; }
[data-theme="light"] .nav-icon-btn { color: #1a1a1a; }
[data-theme="light"] .settings-btn { color: #1a1a1a !important; }

/* ── SETTINGS PANEL ── */
.settings-wrapper { position: relative; display: flex; align-items: center; }
.settings-panel {
  position: fixed;
  top: 70px;
  right: 24px;
}

/* ── BOTTOM NAVIGATION ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 62px;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: stretch;
  z-index: 500;
}
[data-theme="light"] .bottom-nav {
  background: rgba(248, 245, 240, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* Sliding indicator bar */
.bottom-nav-indicator {
  position: absolute;
  top: 0;
  height: 2px;
  background: #dfbf97;
  border-radius: 0 0 3px 3px;
  transition: left 0.32s cubic-bezier(0.4, 0, 0.2, 1), width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
[data-theme="light"] .bottom-nav-indicator { background: #c9a36a; }

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none !important;
  color: #666;
  font-size: 10px;
  font-family: "Josefin Sans", sans-serif;
  letter-spacing: 0.3px;
  transition: color 0.18s, background 0.18s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item i {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.18s;
}
.bottom-nav-item:hover { color: #dfbf97; }
.bottom-nav-item.active { color: #dfbf97; }
.bottom-nav-item.active i { transform: scale(1.12); }
[data-theme="light"] .bottom-nav-item { color: #aaa; }
[data-theme="light"] .bottom-nav-item:hover { color: #c9a36a; }
[data-theme="light"] .bottom-nav-item.active { color: #c9a36a; }

/* Cart badge */
.cart-nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 20px);
  min-width: 16px;
  height: 16px;
  background: #dfbf97;
  color: #1a1a1a;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
  display: none;
  pointer-events: none;
  font-family: "Josefin Sans", sans-serif;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.cart-nav-badge.visible { display: block; }
[data-theme="light"] .cart-nav-badge { background: #c9a36a; color: #fff; }

/* Cart bounce animation */
@keyframes cartBounce {
  0%,100% { transform: scale(1.12); }
  40%     { transform: scale(1.4); }
  70%     { transform: scale(1.0); }
}
.bottom-nav-item.cart-bounce i { animation: cartBounce 0.5s ease; }

/* Body padding so content isn't hidden behind bottom nav */
body { padding-bottom: 62px; }

/* ── DESKTOP: bigger bottom nav ── */
@media (min-width: 601px) {
  .bottom-nav { height: 72px; }
  .bottom-nav-item { font-size: 12px; gap: 5px; }
  .bottom-nav-item i { font-size: 24px; }
  body { padding-bottom: 72px; }
  .cart-nav-badge { top: 8px; right: calc(50% - 24px); }
}

/* ── SOCIALS ── */
.social-container { text-align: center; padding: 20px; }
.social { display: flex; justify-content: center; gap: 15px; margin-top: 10px; }
.social a { font-size: 24px; color: white; text-decoration: none; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  /* Hide desktop search, show search icon - switch to flex for 2-col layout */
  .navbar-search { display: none; }
  .search-toggle-btn { display: flex; }
  #navbar {
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    min-height: 56px;
  }
  .navbar-brand { font-size: 45px; }
}
@media (max-width: 1500px) { #navbar { padding-left: 32px; padding-right: 32px; } }
@media (max-width: 390px)  { #navbar { padding-left: 12px; padding-right: 12px; } }
@media (max-width: 368px)  { .navbar-brand { font-size: 32px; } }
@media (max-width: 316px)  { .navbar-brand { font-size: 26px; } }
