/* Header styles for MyEcoCosmetic */

.mec-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(210, 192, 197, 0.4);
}

.mec-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.mec-header__brand {
  display: flex;
  align-items: center;
}

.mec-header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.mec-header__logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #fbe9f1 0, #e9d0d8 40%, #c69aa8 100%);
}

.mec-header__logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #232125;
}

.mec-header__nav {
  flex: 1;
}

.mec-header__nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mec-header__nav-link {
  position: relative;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #474248;
  text-decoration: none;
  padding-block: 0.25rem;
}

.mec-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, #c08b9a, #e3b7c5);
  transition: width 0.2s ease-out;
}

.mec-header__nav-link:hover::after,
.mec-header__nav-link:focus-visible::after {
  width: 100%;
}

.mec-header__nav-link:focus-visible {
  outline: 2px solid #c08b9a;
  outline-offset: 2px;
}

.mec-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mec-header__icon-link {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #474248;
  text-decoration: none;
  border: 1px solid rgba(192, 139, 154, 0.28);
  background: rgba(255, 255, 255, 0.9);
  transition: background 0.15s ease-out, transform 0.15s ease-out, box-shadow 0.15s ease-out, border-color 0.15s ease-out;
}

.mec-header__icon-link:hover {
  background: #f6edf0;
  border-color: rgba(192, 139, 154, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(47, 32, 38, 0.12);
}

.mec-header__icon-link:focus-visible {
  outline: 2px solid #c08b9a;
  outline-offset: 2px;
}

.mec-header__cart-count {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  min-width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #232125;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mobile toggle */
.mec-header__toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid rgba(192, 139, 154, 0.35);
  background: rgba(255, 255, 255, 0.9);
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.25rem;
}

.mec-header__toggle-bar {
  width: 1.3rem;
  height: 2px;
  border-radius: 999px;
  background: #2b262c;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

.mec-header__toggle:focus-visible {
  outline: 2px solid #c08b9a;
  outline-offset: 2px;
}

.mec-header--menu-open .mec-header__toggle-bar:nth-child(1) {
  transform: translateY(4px) rotate(40deg);
}

.mec-header--menu-open .mec-header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.mec-header--menu-open .mec-header__toggle-bar:nth-child(3) {
  transform: translateY(-4px) rotate(-40deg);
}

/* Overlay for mobile nav */
.mec-header__overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 7, 10, 0.42);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.mec-header--menu-open .mec-header__overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Responsive behavior */
@media (max-width: 768px) {
  .mec-header__inner {
    padding-inline: 1rem;
  }

  .mec-header__nav {
    position: fixed;
    inset-block-start: 0;
    inset-inline: auto 0;
    right: 0;
    width: min(260px, 80vw);
    height: 100vh;
    background: #fdf9fa;
    border-left: 1px solid rgba(210, 192, 197, 0.7);
    transform: translateX(100%);
    transition: transform 0.23s ease-out;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 4.25rem;
  }

  .mec-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
    padding-inline: 1.5rem;
  }

  .mec-header__nav-link {
    font-size: 0.95rem;
    padding-block: 0.5rem;
  }

  .mec-header__toggle {
    display: inline-flex;
  }

  .mec-header--menu-open .mec-header__nav {
    transform: translateX(0);
  }
}

@media (max-width: 520px) {
  .mec-header__inner {
    gap: 0.75rem;
  }

  .mec-header__logo-text {
    font-size: 1rem;
  }

  .mec-header__actions {
    gap: 0.35rem;
  }

  .mec-header__icon-link {
    width: 2rem;
    height: 2rem;
  }

  .mec-header__cart-count {
    transform: scale(0.9);
  }
}

@media (min-width: 769px) {
  .mec-header__overlay {
    display: none;
  }
}
