/* =========================================================
   SISIMO — Global Header CSS
   New layout: hamburger + logo | search pill | icon actions
   Variants: .header--transparent (homepage) / .header--standard (internal)
   ========================================================= */

/* ─────────────────────────────────────────────────────────
   Z-index / position
   ───────────────────────────────────────────────────────── */
.global-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 200;
  /* No background by default — set per variant below */
}

/* Transparent variant (homepage: floats over hero) */
.header--transparent {
  background: transparent;
}

/* Standard variant (all internal pages) */
.header--standard {
  position: relative;
  background: #ffffff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
}

/* ─────────────────────────────────────────────────────────
   Main header bar
   ───────────────────────────────────────────────────────── */
.gh-bar {
  position: relative;
  z-index: 1;
}

.gh-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  height: 82px;
  gap: 24px;
}

/* ─────────────────────────────────────────────────────────
   LEFT: Hamburger + Logo
   ───────────────────────────────────────────────────────── */
.gh-left {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-shrink: 0;
}

/* Hamburger */
.gh-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.gh-ham-line {
  display: block;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  transition: background 0.2s ease;
}

/* Logo */
.gh-logo {
  display: inline-flex;
  align-items: center;
  position: relative;
  flex-shrink: 0;
  text-decoration: none;
}
.gh-logo-img {
  display: block;
  max-width: 160px;
  width: auto;
  height: auto;
  max-height: 44px;
  object-fit: contain;
}
/* White logo overlay for transparent header — CSS filter */
.gh-logo-white {
  position: absolute;
  top: 0; left: 0;
  opacity: 0;
  filter: brightness(0) invert(1);
  transition: opacity 0.2s ease;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────
   CENTER: Search bar
   ───────────────────────────────────────────────────────── */
.gh-center {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.gh-search {
  position: relative;
  width: 100%;
  max-width: 590px;
}
.gh-search-form {
  width: 100%;
}
.gh-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 24px;
  height: 46px;
  padding: 0 20px;
  border: 1.5px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gh-search-wrap:focus-within {
  border-color: #1B3FE0;
  box-shadow: 0 2px 12px rgba(27,63,224,0.12);
}
.gh-search-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: #707070;
  margin-right: 10px;
}
.gh-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  color: #333;
  line-height: 1;
  min-width: 0;
}
.gh-search-input::placeholder {
  color: #909090;
}

/* Search results panel (default simple dropdown if not mega-panel) */
.gh-search-results:not(.mega-panel) {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 600;
}

/* ─────────────────────────────────────────────────────────
   RIGHT: Icon actions
   ───────────────────────────────────────────────────────── */
.gh-right {
  flex-shrink: 0;
}

.gh-actions {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 20px;
}

.gh-action-item {
  position: relative;
}

.gh-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  text-decoration: none;
  transition: opacity 0.2s ease;
  border-radius: 8px;
}
.gh-action-btn:hover {
  opacity: 0.75;
}

.gh-icon {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
}

/* Badge */
.gh-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 50px;
  background: #A8D5A2; /* SISIMO green */
  color: #1A2E1A;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────
   COLOR VARIANTS
   Transparent header (homepage) → white icons/hamburger
   Standard header (internal) → dark icons/hamburger
   ───────────────────────────────────────────────────────── */

/* Transparent: white everything */
.header--transparent .gh-ham-line {
  background: #ffffff;
}
.header--transparent .gh-logo-default {
  opacity: 0;
}
.header--transparent .gh-logo-white {
  opacity: 1;
}
.header--transparent .gh-icon {
  stroke: #ffffff;
}
.header--transparent .gh-action-btn {
  color: #ffffff;
}
.header--transparent .gh-search-wrap {
  background: rgba(255, 255, 255, 0.92);
}

/* Standard: dark everything */
.header--standard .gh-ham-line {
  background: #1a1a2e;
}
.header--standard .gh-logo-default {
  opacity: 1;
}
.header--standard .gh-logo-white {
  opacity: 0;
}
.header--standard .gh-icon {
  stroke: #1a1a2e;
}
.header--standard .gh-action-btn {
  color: #1a1a2e;
}

/* ─────────────────────────────────────────────────────────
   Sticky header (solid white always)
   ───────────────────────────────────────────────────────── */
.sticky-header {
  background: #ffffff;
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
}
.sticky-header .gh-ham-line { background: #1a1a2e; }
.sticky-header .gh-logo-white { opacity: 0 !important; }
.sticky-header .gh-logo-default { opacity: 1 !important; }
.sticky-header .gh-icon { stroke: #1a1a2e; }
.sticky-header .gh-action-btn { color: #1a1a2e; }
.sticky-header .gh-inner {
  height: 70px;
}

/* ─────────────────────────────────────────────────────────
   Mobile: 2-row layout
   Row 1: hamburger + logo + icons
   Row 2: full-width search
   ───────────────────────────────────────────────────────── */
.gh-mobile-search {
  display: none;
}

@media (max-width: 767px) {
  .gh-inner {
    height: auto;
    padding: 10px 16px 0;
    flex-wrap: nowrap;
    gap: 12px;
  }
  .gh-center {
    display: none; /* hidden in row 1 */
  }
  .gh-mobile-search {
    display: block;
    padding: 10px 16px 12px;
  }
  .gh-mobile-search .gh-search {
    width: 100%;
    max-width: 100%;
    position: relative;
    margin: 0;
  }
  .gh-mobile-search .gh-search-form {
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .gh-mobile-search .gh-search-wrap {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
  }
  .gh-actions {
    gap: 12px;
  }
  .gh-icon {
    width: 24px;
    height: 24px;
  }
  .gh-logo-img {
    max-width: 120px;
  }
  .gh-hamburger {
    width: 28px;
  }
  .gh-left {
    gap: 14px;
  }
}

/* ─────────────────────────────────────────────────────────
   Tablet: reduce search width
   ───────────────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1199px) {
  .gh-inner {
    padding: 0 24px;
    gap: 16px;
  }
  .gh-search {
    max-width: 420px;
  }
  .gh-logo-img {
    max-width: 135px;
  }
}

/* ─────────────────────────────────────────────────────────
   Keep old classes working for non-refactored pages
   ───────────────────────────────────────────────────────── */
.main-header .logo-box img {
  max-width: clamp(90px, 22vw, 180px);
  height: auto;
}

/* ─────────────────────────────────────────────────────────
   Reduced motion
   ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .gh-ham-line,
  .gh-search-wrap,
  .gh-action-btn,
  .gh-logo-white,
  .gh-logo-default { transition: none; }
}
