/**
 * Custom Header Stylesheet - Eucheuma Cottonii
 * File Name: custom-header.css
 * Optimasi: Pencegahan CLS (Aspect Ratio), Min-tap target 48px untuk Mobile UX, Smooth Transition
 */

:root {
  --ec-header-bg: #10393b;
  --ec-pill-bg: rgba(214, 227, 224, 0.08);
  --ec-text-white: #ffffff;
  --ec-accent-teal: #1cb5a9;
  --ec-accent-teal-hover: #179b90;
  --ec-header-height: 122.563px;
}

/* ======================================================
   1. SECTION HEADER UTAMA (STICKY)
====================================================== */
.ec-floating-wrapper {
  position: sticky !important;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--ec-header-height) !important;
  min-height: var(--ec-header-height) !important;
  background-color: var(--ec-header-bg) !important;
  margin: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  z-index: 1050;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Penyesuaian saat admin WordPress login */
body.admin-bar .ec-floating-wrapper {
  top: 32px !important;
}
@media (max-width: 782px) {
  body.admin-bar .ec-floating-wrapper {
    top: 46px !important;
  }
}

.ec-floating-wrapper > .container {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* 2. Container Kapsul */
.ec-pill-navbar {
  background-color: var(--ec-pill-bg) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0 !important;
  border-radius: 24px;
  min-height: 80px;
  padding: 18px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

/* Logo Image - Anti CLS dengan aspect-ratio */
.ec-pill-logo {
  max-height: 44px;
  width: auto;
  height: auto;
  aspect-ratio: 200 / 44; /* Kunci rasio agar browser mereservasi ruang sebelum gambar termuat */
  display: block;
  object-fit: contain;
}

/* Navigasi Desktop */
.ec-pill-nav {
  gap: 2.25rem;
}

.ec-pill-link {
  color: var(--ec-text-white) !important;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none !important;
  transition: color 0.2s ease;
  display: inline-block;
  padding: 8px 0; /* Menambah area klik (SEO touch target) */
}

.ec-pill-link:hover,
.ec-pill-link.is-active {
  color: var(--ec-accent-teal) !important;
}

/* Tombol CTA */
.ec-pill-btn {
  background-color: var(--ec-accent-teal);
  color: #ffffff !important;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 24px;
  min-height: 44px; /* Standar minimum touch-target Google */
  border-radius: 12px;
  border: none;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(28, 181, 169, 0.25);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ec-pill-btn:hover {
  background-color: var(--ec-accent-teal-hover);
  box-shadow: 0 6px 18px rgba(28, 181, 169, 0.35);
  transform: translateY(-1px);
}

/* ======================================================
   3. TOGGLER HAMBURGER
====================================================== */
.ec-pill-toggler {
  display: none !important;
}

.ec-burger-box {
  width: 24px !important;
  height: 18px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.ec-burger-line {
  display: block !important;
  width: 100% !important;
  height: 3px !important;
  background-color: #ffffff !important;
  border-radius: 4px !important;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animasi silang (X) */
.ec-pill-toggler[aria-expanded="true"] .ec-burger-line:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.ec-pill-toggler[aria-expanded="true"] .ec-burger-line:nth-child(2) {
  opacity: 0 !important;
  transform: scale(0);
}

.ec-pill-toggler[aria-expanded="true"] .ec-burger-line:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ======================================================
   4. PANEL DROPDOWN MENU MOBILE
====================================================== */
#ecMobileMenu {
  position: absolute;
  top: calc(100% + 10px);
  left: 12px;
  right: 12px;
  z-index: 1060;
}

.ec-mobile-card {
  background: #0d2f31;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.ec-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ec-mobile-item {
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 16px; /* Target sentuh minimum di mobile */
  min-height: 48px;
  display: flex;
  align-items: center;
  border-radius: 10px;
  text-decoration: none !important;
  transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.ec-mobile-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ec-accent-teal) !important;
  padding-left: 20px;
}

.ec-mobile-item.is-active {
  background: rgba(28, 181, 169, 0.15);
  color: var(--ec-accent-teal) !important;
  font-weight: 700;
}

.ec-mobile-cta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ======================================================
   5. TAMPILAN RESPONSIVE TABLET & MOBILE (< 992px)
====================================================== */
@media (max-width: 991.98px) {
  :root {
    --ec-header-height: 90px;
  }

  .ec-pill-toggler {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: var(--ec-accent-teal) !important;
    border: none !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 12px !important;
    padding: 0 !important;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(28, 181, 169, 0.35) !important;
    transition: background-color 0.25s ease, transform 0.25s ease;
  }

  .ec-pill-toggler:hover {
    background-color: var(--ec-accent-teal-hover) !important;
    transform: scale(1.03);
  }

  .ec-pill-toggler:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(28, 181, 169, 0.4) !important;
  }

  .ec-pill-navbar {
    min-height: 60px;
    padding: 8px 16px;
    border-radius: 16px;
  }

  .ec-pill-logo {
    max-height: 36px;
  }
}