/* ═══════════════════════════════════════════════════════════════════
   ASOCIATIA GOOFY ANIMAL RESCUE — HEADER STYLES
   ═══════════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #F9FAFB;
  color: #111827;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

:root {
  --yellow: #FFD400;
  --yellow-hover: #E6BE00;
  --yellow-light: #FFF9D6;
  --green: #1E3A34;
  --green-mid: #2D5A4F;
  --green-light: #3D7A6A;
  --accent: #FF6B35;
  --white: #FFFFFF;
  --bg: #F9FAFB;
  --bg2: #F0F2EF;
  --text: #111827;
  --text2: #4B5563;
  --text3: #9CA3AF;
  --topbar-h: 36px;
  --header-h: 72px;
  --shadow-sm: 0 2px 8px rgba(30, 58, 52, 0.08);
  --shadow-md: 0 8px 32px rgba(30, 58, 52, 0.16);
  --shadow-lg: 0 20px 60px rgba(30, 58, 52, 0.22);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --drawer-w: 320px;
  --font-head: 'Playfair Display', Georgia, serif;
}

/* ── SITE HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.site-header.is-scrolled .header-topbar {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.site-header.is-scrolled .header-main {
  box-shadow: var(--shadow-md);
}

.site-header.is-scrolled .header-inner {
  height: 60px;
}

/* ── TOP BAR ── */
.header-topbar {
  background: var(--green-mid);
  max-height: 60px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.28s ease, opacity 0.2s ease;
  will-change: max-height, opacity;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  white-space: nowrap;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.topbar-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-item a {
  color: var(--yellow);
  font-weight: 600;
  transition: opacity var(--transition);
}

.topbar-item a:hover {
  opacity: 0.8;
}

.topbar-divider {
  opacity: 0.3;
}

.topbar-link {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 500;
  transition: color var(--transition);
}

.topbar-link:hover {
  color: var(--yellow);
}

/* ── MAIN HEADER BAR ── */
.header-main {
  background: var(--green);
  position: relative;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 32px;
  transition: height 0.28s ease;
  will-change: height;
}

/* ── LOGO ── */
.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity var(--transition);
  text-decoration: none;
}

.header-logo:hover {
  opacity: 0.88;
}

/* Logo image — white filter for dark header background */
.header-logo img {
  height: 44px;
  width: auto;
  display: block;
  transition: transform var(--transition);
}

.header-logo:hover img {
  transform: scale(1.03);
}

/* Scrolled: slightly smaller logo */
.site-header.is-scrolled .header-logo img {
  height: 36px;
}

/* ── DESKTOP NAV ── */
.header-nav {
  flex: 1;
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  position: relative;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: calc(100% - 20px);
  height: 2px;
  background: var(--yellow);
  border-radius: 2px;
  transition: transform var(--transition);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-chevron {
  transition: transform var(--transition);
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-item.is-open .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  background: var(--yellow);
  color: var(--green);
  margin-left: 2px;
}

/* ── DROPDOWNS ── */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  z-index: 200;
}

.nav-item.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 24px;
  width: 12px;
  height: 12px;
  background: var(--white);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}

/* ── MEGA DROPDOWN ── */
.nav-dropdown--mega {
  left: -20px;
  width: 680px;
}

.mega-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 220px;
}

.mega-col {
  padding: 24px 20px;
  border-right: 1px solid #F3F4F6;
}

.mega-col:last-child {
  border-right: none;
}

.mega-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F3F4F6;
}

.mega-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  margin-bottom: 2px;
  text-decoration: none;
}

.mega-link:hover {
  background: var(--bg);
}

.mega-link-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.mega-link strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.mega-link:hover strong {
  color: var(--green);
}

.mega-link small {
  display: block;
  font-size: 12px;
  color: var(--text3);
  line-height: 1.4;
}

.mega-col--highlight {
  padding: 20px 16px;
  background: #F9FAFB;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.mega-spotlight {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mega-spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  background: #FEE2E2;
  color: #991B1B;
  width: fit-content;
}

.mega-spotlight-animal {
  font-size: 40px;
  text-align: center;
  padding: 4px 0;
}

.mega-spotlight-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.mega-spotlight-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
}

.mega-spotlight-bar {
  background: #E5E7EB;
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin: 2px 0;
}

.mega-spotlight-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--yellow), var(--accent));
}

.mega-spotlight-meta {
  font-size: 11px;
  color: var(--text3);
}

.mega-spotlight-cta {
  display: inline-block;
  margin-top: 4px;
  padding: 8px 16px;
  border-radius: 99px;
  background: var(--yellow);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  transition: background var(--transition), transform var(--transition);
  text-decoration: none;
}

.mega-spotlight-cta:hover {
  background: var(--yellow-hover);
  transform: translateY(-1px);
}

/* ── SIMPLE DROPDOWN ── */
.nav-dropdown--simple {
  min-width: 220px;
  padding: 8px;
}

.simple-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.simple-link:hover {
  background: var(--bg);
  color: var(--green);
}

.simple-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* ── HEADER ACTIONS ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--transition), background var(--transition);
  position: relative;
  cursor: pointer;
}

.action-btn:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.cart-count {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-donate {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 99px;
  background: var(--yellow);
  color: var(--green);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  border: 2px solid transparent;
  animation: gentlePulse 3s ease-in-out infinite;
  text-decoration: none;
}

.btn-donate:hover {
  background: var(--yellow-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 212, 0, 0.35);
  animation: none;
}

@keyframes gentlePulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 212, 0, 0)
  }

  50% {
    box-shadow: 0 0 0 6px rgba(255, 212, 0, 0.18)
  }
}

.btn-donate--full {
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  font-size: 15px;
  border-radius: var(--radius-sm);
  animation: none;
}

/* ── HAMBURGER ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  gap: 5px;
  transition: background var(--transition);
  cursor: pointer;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
  transform-origin: center;
}

.hamburger.is-open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.is-open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── SEARCH BAR ── */
.header-search {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #162E29;
}

.header-search.is-open {
  max-height: 60px;
}

.search-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.search-inner input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--white);
}

.search-inner input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}

.search-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

/* ── MOBILE OVERLAY ── */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 18, 0.65);
  z-index: 1099;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.mobile-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── MOBILE DRAWER ── */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--drawer-w);
  max-width: 100vw;
  height: 100dvh;
  background: var(--white);
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.mobile-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--green);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Drawer logo — also white filter */
.drawer-header .header-logo img {
  height: 36px;
}

.drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.7);
  transition: background var(--transition);
  cursor: pointer;
}

.drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.drawer-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid #E5E7EB;
  color: var(--text3);
  flex-shrink: 0;
}

.drawer-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
}

.drawer-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.drawer-item {
  border-bottom: 1px solid #F3F4F6;
}

.drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: none;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  text-align: left;
  text-decoration: none;
}

.drawer-link:hover {
  color: var(--green);
  background: var(--bg);
}

.drawer-link--plain {
  font-weight: 500;
}

.drawer-badge {
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--yellow);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.drawer-chevron {
  flex-shrink: 0;
  opacity: 0.5;
  transition: transform var(--transition), opacity var(--transition);
}

.drawer-item--has-sub .drawer-link[aria-expanded="true"] .drawer-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.drawer-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg);
}

.drawer-sub.is-open {
  max-height: 500px;
}

.drawer-sub-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 20px 11px 32px;
  font-size: 14px;
  color: var(--text2);
  font-weight: 400;
  transition: color var(--transition);
  text-decoration: none;
  border-top: 1px solid #EBEBEB;
}

.drawer-sub-link:first-child {
  border-top: none;
}

.drawer-sub-link:hover {
  color: var(--green);
}

.drawer-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 99px;
  background: #E5E7EB;
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
}

.drawer-count.urgent {
  background: #FEE2E2;
  color: #991B1B;
}

.drawer-footer {
  padding: 16px 20px;
  background: var(--bg);
  border-top: 1px solid #E5E7EB;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
}

.drawer-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text3);
  margin-top: 10px;
  flex-wrap: wrap;
  text-align: center;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .header-nav {
    display: none;
  }

  .action-btn--icon:not(.action-btn--cart) {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .header-inner {
    padding: 0 16px;
    gap: 12px;
    justify-content: space-between;
  }

  .btn-donate {
    display: none;
  }
}

@media (max-width: 600px) {
  .header-logo img {
    height: 36px;
  }
}

@media (max-width: 380px) {
  .btn-donate {
    display: none;
  }
}

@media (max-width: 1100px) and (min-width: 901px) {
  .nav-dropdown--mega {
    left: -100px;
  }
}

@media (max-width: 768px) {

  .topbar-left .topbar-item:not(:first-child),
  .topbar-divider,
  .topbar-right {
    display: none;
  }

  .topbar-left {
    justify-content: center;
    width: 100%;
  }
}

:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 4px;
}