/* --------------------------------------------------
   Base / Reset
   -------------------------------------------------- */
html, body {
  height: 100%;
  margin: 0;
  /* overflow-x: hidden; */
}

body {
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  background: #fafafa;
  color: #333;
}


/* --------------------------------------------------
   Header
   -------------------------------------------------- */
header {
  display: flex;
  justify-content: center; /* center the inner container */
  padding: 1rem;
  background: #492c50;
  color: white;
  position: relative; /* allow absolute-positioned hamburger to center vertically */
}

.header-wrapper {
  display: flex;
  align-items: center;
  justify-content: center; /* center title + nav */
  gap: 5rem; /* increased from 1.25rem */
  flex: 1;
  max-width: 1600px; /* max width of content */
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Logo and title */
header img {
  max-height: 3rem;
  width: auto;
  vertical-align: middle;
  user-select: none;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  min-width: 3rem;
  min-height: 3rem;
}

header .logo-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap; /* always inline horizontally */
}

header .logo-title img {
  max-height: 3rem;
}

header .logo-title h1 {
  font-size: 2rem;
  margin: 0;
  white-space: nowrap; /* prevent breaking */
}


/* --------------------------------------------------
   Navigation (header)
   -------------------------------------------------- */
header nav, .main-nav {
  margin-top: 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap; /* wrap if needed on very narrow screens */
  justify-content: center;
}

/* header links */
header nav a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease, transform 0.2s ease, background 0.2s;
  font-size: 1.25rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  margin: 0 0.15rem;
  font-weight: 500;
}

header nav a:hover {
  color: #f1c40f;
  background: #3a1f3f;
  transform: scale(1.15);
}

header nav a[href*="support"] {
  background: #e74c3c;
  color: #fff;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(231,76,60,0.15);
}

header nav a[href*="support"]:hover {
  background: #c0392b;
  color: #fff;
}


/* --------------------------------------------------
   Layout: main / footer
   -------------------------------------------------- */
main {
  flex: 1; /* pushes footer down */
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  margin: 2rem auto;
  padding: 0 1rem;
  font-size: 1.2rem;
}

footer {
  background: #492c50;
  color: white;
  text-align: center;
  padding: 0.5rem;
}


/* --------------------------------------------------
   Buttons / CTAs
   -------------------------------------------------- */
.cta {
  display: inline-block;
  margin: 0.5rem 1rem 0 0;
  padding: 0.75rem 1.5rem;
  background: #e74c3c;
  color: white;
  font-weight: bold;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.cta:hover { background: #c0392b; }

/* Global primary CTA variant (falls back to a sensible accent) */
.cta-primary {
  background: var(--accent, #ff6b4a);
  color: #fff;
  box-shadow: 0 6px 18px rgba(255,107,74,0.12);
}
.cta-primary:hover {
  background: color-mix(in srgb, var(--accent, #ff6b4a) 85%, black 15%);
}


/* --------------------------------------------------
   Overlay / Modal
   -------------------------------------------------- */
.overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.overlay.hidden { display: none; }

.overlay-content {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: min(90vw, 48rem);
  max-height: 90vh; /* Prevent stretching off screen */
  box-sizing: border-box; /* Include padding in size */
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  position: relative;
  animation: fadeIn 0.3s ease-out;
  overflow: hidden;
}

.overlay-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 2rem;
  overflow-y: auto;
  border-radius: inherit;
  background-clip: padding-box;
}

/* Align title with close button in overlay */
.overlay-body > .pet-name {
  margin-top: -1rem;
}

/* WebKit custom scrollbar for overlay-body */
.overlay-body::-webkit-scrollbar { width: 10px; height: 10px; }
.overlay-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 8px; }
.overlay-body::-webkit-scrollbar-track { background: transparent; }
.overlay-body::-webkit-scrollbar-button:single-button { display: none; width: 0; height: 0; }

.overlay-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  font-size: 1.5rem;
  font-weight: bold;
  color: #555;
  cursor: pointer;
  transition: color 0.2s;
  background: none;
  border: none;
  z-index: 10;
}

.overlay-close:hover { color: #e74c3c; }

/* Carousel styles */
.overlay-carousel {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.overlay-carousel picture {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: clamp(300px, 40vw, 600px);
  aspect-ratio: 1 / 1;
  max-width: 100%;
  max-height: 60vh;
  box-sizing: border-box;
}

.overlay-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
  display: block;
  background: #f8f8f8;
  max-width: 100%;
  max-height: 100%;
}

.carousel-arrow {
  font-size: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  color: #0077cc;
  transition: color 0.2s, transform 0.2s;
  padding: 0 0.5rem;
}

.carousel-arrow:hover {
  color: #e74c3c;
  transform: scale(1.2);
}

/* Specific override for home page overlays */
.home-root .overlay-carousel .carousel-arrow {
  font-size: 2.5rem;
  color: #0077cc;
  padding: 0 0.5rem;
}

.home-root .overlay-carousel .carousel-arrow:hover {
  color: #e74c3c;
  transform: scale(1.2);
}

.overlay-thumbs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.overlay-thumb {
  height: 48px;
  width: 48px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.overlay-thumb.active {
  border-color: #0077cc;
}

/* Pet details grid */
.pet-details {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: #f9f9f9;
  border-radius: 8px;
  border-left: 4px solid #0077cc;
}

/* Dynamic columns based on item count */
.pet-details[data-items="2"] {grid-template-columns: repeat(2, 1fr);}
.pet-details[data-items="3"] {grid-template-columns: repeat(3, 1fr);}
.pet-details[data-items="4"] {grid-template-columns: repeat(2, 1fr);}
.pet-details[data-items="5"] {grid-template-columns: repeat(3, 1fr);}
.pet-details:not([data-items]) {grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));}

.pet-details p {
  margin: 0;
  font-size: 0.95rem;
  color: #444;
}

.pet-details .label {
  font-weight: 600;
  color: #333;
  margin-right: 0.4rem;
}

/* Description section */
.overlay-body > p:has(.pet-description) {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.overlay-body > p:has(.pet-description) .label {
  display: block;
  font-weight: 600;
  color: #333;
}

.pet-description {
  font-size: 1.05rem;
  line-height: 1.5;
  color: #555;
}


/* --------------------------------------------------
   Responsive title variants
   -------------------------------------------------- */
.site-titles { display: inline; }
.short-title { display: none; }
.full-title { display: inline; }


/* --------------------------------------------------
   Hamburger (three-line) button
   -------------------------------------------------- */
.hamburger {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem; /* larger hit area */
  margin-left: 0.5rem;
  cursor: pointer;
  position: absolute; /* vertically center within header */
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1300;
  transition: transform 0.18s ease;
}

.hamburger-box { display: inline-block; width: 34px; height: 24px; position: relative; }
.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  display: block;
  background-color: #fff;
  position: absolute;
  height: 3px;
  width: 100%;
  border-radius: 3px;
  transition: transform 0.18s ease, opacity 0.12s ease, background-color 0.18s ease;
}

.hamburger-inner { top: 50%; transform: translateY(-50%); }
.hamburger-inner::before { content: ''; top: -9px; }
.hamburger-inner::after { content: ''; top: 9px; }

/* hover: slightly grow and change line color to light blue */
.hamburger:hover { transform: translateY(-50%) scale(1.12); }
.hamburger:hover .hamburger-inner,
.hamburger:hover .hamburger-inner::before,
.hamburger:hover .hamburger-inner::after { background-color: #bfe7ff; }


/* --------------------------------------------------
   Sidebar / slide-out menu (right)
   -------------------------------------------------- */
.side-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1350;
}

.side-overlay.visible { opacity: 1; pointer-events: auto; }

.side-menu {
  position: fixed;
  right: 0;
  left: auto;
  top: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: white;
  transform: translateX(110%);
  transition: transform 0.28s cubic-bezier(.2,.9,.2,1);
  box-shadow: -2px 0 18px rgba(0,0,0,0.18);
  z-index: 1400; /* ensure sidebar overlays the hamburger */
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.side-menu.open { transform: translateX(0); }

/* WebKit custom scrollbar for side-menu */
.side-menu::-webkit-scrollbar { width: 10px; height: 10px; }
.side-menu::-webkit-scrollbar-thumb { background: #ccc; border-radius: 8px; }
.side-menu::-webkit-scrollbar-track { background: transparent; }
.side-menu::-webkit-scrollbar-button:single-button { display: none; width: 0; height: 0; }

.side-header { display:flex; align-items:center; gap:0.5rem; }
.side-header img { max-height:2.4rem; }
.side-title { margin:0; font-size:1.25rem; }

.side-close {
  margin-left:auto;
  background:none;
  border:none;
  font-size:1.35rem;
  cursor:pointer;
  transition: transform 0.14s ease, color 0.14s ease;
}

.side-nav { display:flex; flex-direction:column; gap:0.5rem; margin-top:1rem; }
.side-nav a {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1.05rem 0.9rem;
  color: #333;
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.15rem;
  background: transparent;
}

.side-nav a:hover { 
  background: #f6f6f8;
  color: #287eff; /* changed: text color on hover */
  transform: scale(1.18);
  transform-origin: center left;
}

.side-close:hover { transform: scale(1.12); color: #e74c3c; }


/* Keep header nav styling distinct and unchanged */
header nav a {
  font-size: 1.25rem;
  padding: 0.6rem 1rem;
}


/* --------------------------------------------------
   Responsive behavior
   -------------------------------------------------- */
@media (max-width: 965px) {
  header nav { display: none; }
  /* also hide the main-nav explicitly when hamburger is shown */
  .main-nav { display: none; }
  .hamburger { display: inline-block; }
  /* move title+logo to the left while hamburger is fixed to the right */
  .header-wrapper { justify-content: flex-start; padding-left: 1rem; padding-right: 3.75rem; }
  header .logo-title { gap: 0.75rem; } /* increased from 0.5rem */
  header .logo-title img { max-height: 2.4rem; }
}

/* Swap title a bit later than the sidebar (short title at 620px) */
@media (max-width: 620px) {
  .full-title { display: none; }
  .short-title { display: inline; }
  header .logo-title h1 { font-size: 1.6rem; }
}

/* hidden checkbox used to toggle the menu */
.menu-toggle {
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

/* default: menu hidden (keeps current transform) */
.menu-toggle:not(:checked) ~ .side-menu { transform: translateX(110%); }
.menu-toggle:not(:checked) ~ .side-overlay { opacity: 0; pointer-events: none; }

/* when checked: show menu + overlay */
.menu-toggle:checked ~ .side-menu { transform: translateX(0); }
.menu-toggle:checked ~ .side-overlay { opacity: 1; pointer-events: auto; }

/* optionally hide the hamburger while open to avoid overlap (input is before header) */
.menu-toggle:checked ~ header .hamburger { visibility: hidden; }

/* ensure the overlay label looks/behaves as before */
.side-overlay { cursor: pointer; }
