/* ============================================
   SHARED COMPONENTS — Clinical Vet
   Header, Footer, Icons, Mobile Menu
   ============================================ */

const { useState, useEffect, useRef, useMemo } = React;

// ============================================
// Base path helper — works from root or /servicos/ /admin/
// ============================================
const BASE = (() => {
  const p = window.location.pathname;
  if (/\/(servicos|admin)\//.test(p)) return '../';
  return '';
})();
const B = (path) => BASE + path;

// ============================================
// Auth helper (lightweight — shared between site & admin)
// ============================================
const CV_AUTH_KEY = 'cv_user_v1';
function readAuth() {
  try { return JSON.parse(localStorage.getItem(CV_AUTH_KEY) || 'null'); } catch { return null; }
}
function clearAuth() {
  try { localStorage.removeItem(CV_AUTH_KEY); } catch {}
  window.dispatchEvent(new Event('cv_auth_change'));
}
function useHeaderAuth() {
  const [u, setU] = useState(() => readAuth());
  useEffect(() => {
    const refresh = () => setU(readAuth());
    window.addEventListener('cv_auth_change', refresh);
    window.addEventListener('storage', refresh);
    return () => {
      window.removeEventListener('cv_auth_change', refresh);
      window.removeEventListener('storage', refresh);
    };
  }, []);
  return u;
}

// ============================================
// ICONS
// ============================================
const Icon = {
  Arrow: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
      <path d="M5 12h14M13 6l6 6-6 6" />
    </svg>
  ),
  ArrowDown: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
      <path d="M12 5v14M6 13l6 6 6-6" />
    </svg>
  ),
  Phone: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
      <path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.37 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.33 1.85.57 2.81.7A2 2 0 0 1 22 16.92z" />
    </svg>
  ),
  Whatsapp: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor">
      <path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.272-.099-.47-.149-.669.15-.198.297-.768.967-.941 1.165-.173.198-.347.223-.644.074-.297-.149-1.255-.462-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.297-.347.446-.52.149-.174.198-.298.297-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51l-.57-.01c-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z"/>
    </svg>
  ),
  Mail: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
      <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" />
      <polyline points="22,6 12,13 2,6" />
    </svg>
  ),
  Pin: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
      <path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" />
      <circle cx="12" cy="10" r="3" />
    </svg>
  ),
  Clock: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
      <circle cx="12" cy="12" r="10" />
      <polyline points="12,6 12,12 16,14" />
    </svg>
  ),
  Heart: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
      <path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" />
    </svg>
  ),
  Paw: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor">
      <ellipse cx="6" cy="9" rx="2" ry="2.6"/>
      <ellipse cx="18" cy="9" rx="2" ry="2.6"/>
      <ellipse cx="9.5" cy="5.5" rx="1.7" ry="2.4"/>
      <ellipse cx="14.5" cy="5.5" rx="1.7" ry="2.4"/>
      <path d="M12 11c-3.5 0-6 2.5-6 5.5 0 2 1.5 3.5 3.5 3.5.8 0 1.6-.3 2.5-.8.9.5 1.7.8 2.5.8 2 0 3.5-1.5 3.5-3.5 0-3-2.5-5.5-6-5.5z"/>
    </svg>
  ),
  Check: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round">
      <polyline points="20,6 9,17 4,12" />
    </svg>
  ),
  Plus: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
      <path d="M12 5v14M5 12h14" />
    </svg>
  ),
  Minus: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
      <path d="M5 12h14" />
    </svg>
  ),
  Close: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
      <path d="M18 6L6 18M6 6l12 12" />
    </svg>
  ),
  Menu: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
      <path d="M3 12h18M3 6h18M3 18h18" />
    </svg>
  ),
  Star: ({ size = 16, filled = true }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill={filled ? "currentColor" : "none"} stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
      <polygon points="12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26" />
    </svg>
  ),
  Stethoscope: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
      <path d="M4.8 2.3A.3.3 0 1 0 5 2H4a2 2 0 0 0-2 2v5a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6V4a2 2 0 0 0-2-2h-1a.2.2 0 1 0 .3.3" />
      <path d="M8 15v1a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6v-4" />
      <circle cx="20" cy="10" r="2" />
    </svg>
  ),
  Microscope: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
      <path d="M6 18h8" />
      <path d="M3 22h18" />
      <path d="M14 22a7 7 0 1 0 0-14h-1" />
      <path d="M9 14h2" />
      <path d="M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z" />
      <path d="M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3" />
    </svg>
  ),
  Bag: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
      <path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z" />
      <path d="M3 6h18" />
      <path d="M16 10a4 4 0 0 1-8 0" />
    </svg>
  ),
  Home: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
      <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
      <polyline points="9,22 9,12 15,12 15,22" />
    </svg>
  ),
  Scissors: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
      <circle cx="6" cy="6" r="3" />
      <circle cx="6" cy="18" r="3" />
      <line x1="20" y1="4" x2="8.12" y2="15.88" />
      <line x1="14.47" y1="14.48" x2="20" y2="20" />
      <line x1="8.12" y1="8.12" x2="12" y2="12" />
    </svg>
  ),
  Shield: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
      <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
    </svg>
  ),
  Cart: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
      <circle cx="9" cy="21" r="1" />
      <circle cx="20" cy="21" r="1" />
      <path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6" />
    </svg>
  ),
  Calendar: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
      <rect x="3" y="4" width="18" height="18" rx="2" ry="2" />
      <line x1="16" y1="2" x2="16" y2="6" />
      <line x1="8" y1="2" x2="8" y2="6" />
      <line x1="3" y1="10" x2="21" y2="10" />
    </svg>
  ),
  Sparkle: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor">
      <path d="M12 2l1.5 6.5L20 10l-6.5 1.5L12 18l-1.5-6.5L4 10l6.5-1.5z" />
    </svg>
  ),
  Cat: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
      <path d="M12 5c0-1.5-1-2.5-2.5-2.5S7 3.5 7 5c0 .5 0 1 .5 1.5L4 9.5C3 10.5 2 12 2 14c0 4 3 7 7 7h6c4 0 7-3 7-7 0-2-1-3.5-2-4.5l-3.5-3c.5-.5.5-1 .5-1.5 0-1.5-1-2.5-2.5-2.5S12 3.5 12 5z" />
      <path d="M9 13h.01M15 13h.01" />
    </svg>
  ),
  Dog: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
      <path d="M10 5.172C10 3.782 8.423 2.679 6.5 3c-2.823.47-4.113 6.006-4 7 .08.703 1.725 1.722 3.656 1 1.261-.472 1.96-1.45 2.844-3" />
      <path d="M14.267 5.172c0-1.39 1.577-2.493 3.5-2.172 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-2.012-1.45-2.896-3" />
      <path d="M8 14v.5" />
      <path d="M16 14v.5" />
      <path d="M11.25 16.25h1.5L12 17l-.75-.75z" />
      <path d="M4.456 13.685a4 4 0 0 0-1.436 4.873C3.499 19.78 4.501 21 6 21h12c1.499 0 2.501-1.22 2.98-2.442a4 4 0 0 0-1.436-4.873A5 5 0 0 0 17.5 13a5 5 0 0 0-5.5 0 5 5 0 0 0-5.5 0 5 5 0 0 0-2.044.685z" />
    </svg>
  ),
  Instagram: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
      <rect x="2" y="2" width="20" height="20" rx="5" />
      <circle cx="12" cy="12" r="4" />
      <line x1="17.5" y1="6.5" x2="17.5" y2="6.5" />
    </svg>
  ),
  Facebook: ({ size = 16 }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor">
      <path d="M22 12c0-5.5-4.5-10-10-10S2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5H15c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12z"/>
    </svg>
  ),
};

// ============================================
// HEADER — Megamenu desktop + nested off-canvas mobile
// ============================================
function Header({ active, dark = false }) {
  const [menuOpen, setMenuOpen] = useState(false);
  const [submenu, setSubmenu] = useState(null); // 'services' | 'shop' | null (desktop)
  const [mobSubmenu, setMobSubmenu] = useState(null); // mobile nested
  const [scrolled, setScrolled] = useState(false);
  const [userMenuOpen, setUserMenuOpen] = useState(false);
  const hoverTimer = useRef(null);
  const userMenuRef = useRef(null);
  const user = useHeaderAuth();

  useEffect(() => {
    document.body.style.overflow = menuOpen ? 'hidden' : '';
  }, [menuOpen]);

  useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 8);
    onScroll();
    window.addEventListener('scroll', onScroll, { passive: true });
    return () => window.removeEventListener('scroll', onScroll);
  }, []);

  useEffect(() => {
    const onClick = (e) => {
      if (userMenuRef.current && !userMenuRef.current.contains(e.target)) setUserMenuOpen(false);
    };
    document.addEventListener('click', onClick);
    return () => document.removeEventListener('click', onClick);
  }, []);

  // Close submenu on Escape
  useEffect(() => {
    const onKey = (e) => { if (e.key === 'Escape') { setSubmenu(null); setMenuOpen(false); } };
    window.addEventListener('keydown', onKey);
    return () => window.removeEventListener('keydown', onKey);
  }, []);

  const openSub = (id) => {
    clearTimeout(hoverTimer.current);
    setSubmenu(id);
  };
  const closeSubDelayed = () => {
    clearTimeout(hoverTimer.current);
    hoverTimer.current = setTimeout(() => setSubmenu(null), 160);
  };

  const services = [
    { href: 'servicos/consulta.html', label: 'Consulta clínica', desc: 'Consultas e check-ups', icon: <Icon.Stethoscope size={18}/> },
    { href: 'servicos/vacinacao.html', label: 'Vacinação', desc: 'V10, V4, antirrábica e mais', icon: <Icon.Shield size={18}/> },
    { href: 'servicos/cirurgia.html', label: 'Cirurgia', desc: 'Centro cirúrgico equipado', icon: <Icon.Plus size={18}/> },
    { href: 'servicos/castracao.html', label: 'Castração', desc: 'Simulador por porte e raça', icon: <Icon.Heart size={18}/> },
    { href: 'servicos/exames.html', label: 'Exames & laboratório', desc: 'Resultado em 2 horas', icon: <Icon.Microscope size={18}/> },
    { href: 'servicos/especialidades.html', label: 'Especialidades', desc: 'Cardio, derma, oftalmo, ortopedia', icon: <Icon.Sparkle size={18}/> },
    { href: 'servicos/emergencia.html', label: 'Emergência 24h', desc: 'Plantão ininterrupto', icon: <Icon.Phone size={18}/>, accent: true },
    { href: 'banho-tosa.html', label: 'Banho & tosa', desc: 'Spa pet hipoalergênico', icon: <Icon.Scissors size={18}/> },
  ];

  const shop = [
    { href: 'petshop.html?cat=racao', label: 'Rações premium', desc: 'Royal Canin, Hills, Premier', icon: <Icon.Bag size={18}/> },
    { href: 'petshop.html?cat=petisco', label: 'Petiscos naturais', desc: 'Snacks saudáveis', icon: <Icon.Sparkle size={18}/> },
    { href: 'petshop.html?cat=brinquedo', label: 'Brinquedos', desc: 'Enriquecimento e diversão', icon: <Icon.Heart size={18}/> },
    { href: 'petshop.html?cat=acessorio', label: 'Acessórios', desc: 'Coleiras, camas, comedouros', icon: <Icon.Home size={18}/> },
    { href: 'petshop.html?cat=higiene', label: 'Higiene', desc: 'Shampoo, areia, antipulgas', icon: <Icon.Shield size={18}/> },
    { href: 'petshop.html?cat=suplemento', label: 'Suplementos', desc: 'Articular, vitamínicos', icon: <Icon.Microscope size={18}/> },
  ];

  const mainLinks = [
    { id:'home', label:'Início', href:'index.html' },
    { id:'about', label:'Sobre', href:'sobre.html' },
    { id:'services', label:'Serviços', href:'servicos.html', sub:'services' },
    { id:'shop', label:'Pet Shop', href:'petshop.html', sub:'shop' },
    { id:'daycare', label:'Day Care', href:'daycare.html' },
    { id:'planos', label:'Planos', href:'planos.html' },
    { id:'blog', label:'Blog', href:'blog.html' },
    { id:'contact', label:'Contato', href:'contato.html' },
  ];

  return (
    <>
      <div className="emergency-strip">
        <span style={{display:'inline-flex', alignItems:'center', gap:6}}>
          <span className="dot dot-pulse" style={{color:'#fff', width:6, height:6}}></span>
          Emergência 24h
        </span>
        <span style={{opacity:0.7}}>·</span>
        <a href="tel:1199990000">(11) 9999-0000</a>
        <span style={{opacity:0.7, display: 'inline'}} className="em-meta">·</span>
        <span style={{opacity:0.85, display:'inline'}} className="em-meta">Av. Paulista, 1900 — São Paulo</span>
      </div>

      <header className={`site-header ${dark ? 'dark' : ''} ${scrolled ? 'scrolled' : ''}`}>
        <div className="nav-inner">
          <a href={B("index.html")} className="brand" aria-label="Clinical Vet — voltar para home">
            <span className="brand-mark" aria-hidden="true">cv</span>
            <span>
              Clinical Vet
              <small>desde 2008 · são paulo</small>
            </span>
          </a>

          <nav className="nav-links" aria-label="Navegação principal" onMouseLeave={closeSubDelayed}>
            {mainLinks.map(l => (
              <div key={l.id} className="nav-item"
                onMouseEnter={() => l.sub ? openSub(l.sub) : closeSubDelayed()}
                onFocus={() => l.sub && openSub(l.sub)}
              >
                <a href={l.href} className={`nav-link ${active === l.id ? 'active' : ''}`}
                   aria-expanded={l.sub ? (submenu === l.sub ? 'true' : 'false') : undefined}
                   aria-haspopup={l.sub ? 'true' : undefined}>
                  {l.label}
                  {l.sub && <Icon.ArrowDown size={11}/>}
                </a>
              </div>
            ))}
          </nav>

          <div className="nav-actions">
            {user ? (
              <div ref={userMenuRef} style={{position:'relative'}} className="desk-only">
                <button onClick={() => setUserMenuOpen(o => !o)} className="user-chip" aria-label="Menu do usuário" aria-expanded={userMenuOpen}>
                  <span className="user-avatar">{user.avatar || user.name?.slice(0,2).toUpperCase()}</span>
                  <span className="user-info">
                    <span className="user-name">{user.name?.split(' ')[0] || 'Tutor'}</span>
                    <span className="user-role">{user.role === 'admin' ? 'admin' : 'tutor(a)'}</span>
                  </span>
                  <Icon.ArrowDown size={11}/>
                </button>
                {userMenuOpen && (
                  <div className="user-dropdown">
                    <div className="user-dd-header">
                      <div className="user-avatar" style={{width:40, height:40, fontSize:14}}>{user.avatar || user.name?.slice(0,2).toUpperCase()}</div>
                      <div style={{minWidth:0, flex:1}}>
                        <div style={{fontWeight:600, fontSize:14, overflow:'hidden', textOverflow:'ellipsis', whiteSpace:'nowrap'}}>{user.name || 'Tutor(a)'}</div>
                        <div style={{fontSize:12, color:'var(--muted)', overflow:'hidden', textOverflow:'ellipsis', whiteSpace:'nowrap'}}>{user.email}</div>
                      </div>
                    </div>
                    <div className="user-dd-list">
                      {user.role === 'admin' ? (
                        <a href={B("admin/index.html")} className="user-dd-item">Painel admin →</a>
                      ) : (
                        <a href="#" className="user-dd-item">Meus pets</a>
                      )}
                      <a href="#" className="user-dd-item">Meus agendamentos</a>
                      <a href="#" className="user-dd-item">Histórico</a>
                      <a href="#" className="user-dd-item">Configurações</a>
                      <button onClick={() => { clearAuth(); window.location.reload(); }} className="user-dd-item" style={{color:'var(--danger)', textAlign:'left', width:'100%', background:'none', border:'none', cursor:'pointer'}}>
                        Sair
                      </button>
                    </div>
                  </div>
                )}
              </div>
            ) : (
              <a href={B("login.html")} className="btn btn-ghost btn-sm desk-only" style={{padding:'10px 18px'}}>
                Entrar
              </a>
            )}
            <a href={B("contato.html")} className="btn btn-primary btn-sm desk-only">
              Agendar consulta <Icon.Arrow size={14} />
            </a>
            <button className="menu-toggle" onClick={() => setMenuOpen(true)} aria-label="Abrir menu" aria-expanded={menuOpen}>
              <Icon.Menu size={18} />
            </button>
          </div>
        </div>

        {/* DESKTOP MEGAMENU */}
        <div className={`megamenu ${submenu ? 'open' : ''}`}
             onMouseEnter={() => clearTimeout(hoverTimer.current)}
             onMouseLeave={closeSubDelayed}>
          <div className="megamenu-inner">
            {submenu === 'services' && (
              <div className="mega-grid">
                <div className="mega-side">
                  <div className="eyebrow" style={{color:'var(--teal-700)'}}>Serviços veterinários</div>
                  <div className="display-sm" style={{margin:'12px 0 12px'}}>Cuidado completo, da prevenção à cirurgia.</div>
                  <p className="body-sm" style={{margin:0, maxWidth:240}}>Equipe especializada com plantão 24h e protocolos adaptados para cada espécie, porte e raça.</p>
                  <a href={B("servicos.html")} className="btn-link" style={{marginTop:16}}>Ver todos serviços <Icon.Arrow size={12}/></a>
                </div>
                <div className="mega-items">
                  {services.map((s, i) => (
                    <a key={i} href={s.href} className={`mega-item ${s.accent ? 'accent' : ''}`}>
                      <div className="mega-item-icon">{s.icon}</div>
                      <div>
                        <div className="mega-item-label">{s.label}</div>
                        <div className="mega-item-desc">{s.desc}</div>
                      </div>
                    </a>
                  ))}
                </div>
              </div>
            )}
            {submenu === 'shop' && (
              <div className="mega-grid">
                <div className="mega-side">
                  <div className="eyebrow" style={{color:'var(--coral-600)'}}>Pet Shop · Boutique</div>
                  <div className="display-sm" style={{margin:'12px 0 12px'}}>Curadoria veterinária para a vida toda.</div>
                  <p className="body-sm" style={{margin:0, maxWidth:240}}>800+ produtos selecionados pela nossa equipe. Delivery em 2h na zona sul.</p>
                  <a href={B("petshop.html")} className="btn-link" style={{marginTop:16}}>Ver catálogo completo <Icon.Arrow size={12}/></a>
                </div>
                <div className="mega-items">
                  {shop.map((s, i) => (
                    <a key={i} href={s.href} className="mega-item">
                      <div className="mega-item-icon">{s.icon}</div>
                      <div>
                        <div className="mega-item-label">{s.label}</div>
                        <div className="mega-item-desc">{s.desc}</div>
                      </div>
                    </a>
                  ))}
                </div>
              </div>
            )}
          </div>
        </div>
      </header>

      {/* MOBILE OFF-CANVAS */}
      <div className={`mobile-menu ${menuOpen ? 'open' : ''}`} role="dialog" aria-modal="true" aria-label="Menu principal">
        <div className="mobile-menu-header">
          <a href={B("index.html")} className="brand">
            <span className="brand-mark">cv</span>
            <span>Clinical Vet</span>
          </a>
          <button className="mobile-menu-close" onClick={() => { setMenuOpen(false); setMobSubmenu(null); }} aria-label="Fechar menu">
            <Icon.Close size={18} />
          </button>
        </div>

        {/* Main panel */}
        <div className={`mob-panel ${mobSubmenu ? 'shifted' : ''}`}>
          <div className="mob-list">
            {mainLinks.map((l, i) => (
              <div key={l.id}>
                {l.sub ? (
                  <button className="mobile-nav-link mobile-nav-btn" onClick={() => setMobSubmenu(l.sub)}>
                    <span>{l.label}</span>
                    <span className="num">{String(i+1).padStart(2,'0')} <Icon.Arrow size={14} /></span>
                  </button>
                ) : (
                  <a href={l.href} className="mobile-nav-link">
                    <span>{l.label}</span>
                    <span className="num">{String(i+1).padStart(2,'0')} <Icon.Arrow size={14} /></span>
                  </a>
                )}
              </div>
            ))}
          </div>

          <div className="mobile-menu-cta">
            {user ? (
              <div style={{display:'flex', gap:12, alignItems:'center', padding:16, background:'rgba(255,255,255,0.08)', borderRadius:'var(--r-md)', marginBottom:12}}>
                <div className="user-avatar" style={{width:44, height:44, fontSize:14}}>{user.avatar || user.name?.slice(0,2).toUpperCase()}</div>
                <div style={{flex:1, minWidth:0}}>
                  <div style={{fontWeight:600, fontSize:15, color:'white'}}>{user.name || 'Tutor(a)'}</div>
                  <div style={{fontSize:12, color:'rgba(255,255,255,0.7)', overflow:'hidden', textOverflow:'ellipsis', whiteSpace:'nowrap'}}>{user.email}</div>
                </div>
                <button onClick={() => { clearAuth(); window.location.reload(); }} className="btn btn-ghost btn-sm" style={{color:'white', borderColor:'rgba(255,255,255,0.2)', padding:'8px 14px'}}>Sair</button>
              </div>
            ) : (
              <a href={B("login.html")} className="btn btn-ghost btn-lg" style={{width:'100%', justifyContent:'center', marginBottom:8, color:'var(--cream-50)', borderColor:'rgba(245,237,220,0.3)'}}>
                Entrar / Criar conta
              </a>
            )}
            <a href={B("contato.html")} className="btn btn-primary btn-lg" style={{width:'100%', justifyContent:'center'}}>
              Agendar consulta <Icon.Arrow size={14} />
            </a>
            <a href="https://wa.me/5511999900000" className="btn btn-ghost btn-lg" style={{width:'100%', justifyContent:'center', marginTop:8, color:'var(--cream-50)', borderColor:'rgba(245,237,220,0.2)'}}>
              <Icon.Whatsapp size={14}/> WhatsApp 24h
            </a>
          </div>

          <div className="mobile-menu-meta">
            <div style={{display:'flex', gap:12, alignItems:'center'}}>
              <Icon.Phone size={14} /> <a href="tel:1199990000">(11) 9999-0000</a>
            </div>
            <div style={{display:'flex', gap:12, alignItems:'center'}}>
              <Icon.Pin size={14} /> Av. Paulista, 1900 — São Paulo
            </div>
            <div style={{display:'flex', gap:12, alignItems:'center'}}>
              <Icon.Clock size={14} /> Seg–Sáb 7h–22h · Emergência 24h
            </div>
            <div style={{display:'flex', gap:10, marginTop:12}}>
              <a href="#" aria-label="Instagram" style={{color:'var(--cream-200)'}}><Icon.Instagram size={18}/></a>
              <a href="#" aria-label="Facebook" style={{color:'var(--cream-200)'}}><Icon.Facebook size={18}/></a>
              <a href="https://wa.me/5511999900000" aria-label="WhatsApp" style={{color:'var(--cream-200)'}}><Icon.Whatsapp size={18}/></a>
            </div>
          </div>
        </div>

        {/* Sub panels */}
        <div className={`mob-sub-panel ${mobSubmenu === 'services' ? 'open' : ''}`}>
          <button className="mob-back" onClick={() => setMobSubmenu(null)}>
            <Icon.Arrow size={14} style={{transform:'rotate(180deg)'}}/> Voltar
          </button>
          <h3 className="display-md" style={{margin:'24px 0 8px', color:'var(--cream-50)'}}>Serviços</h3>
          <p className="body-sm" style={{color:'var(--ink-300)', margin:'0 0 24px'}}>Cuidado integral, da prevenção à cirurgia.</p>
          <div className="mob-sub-list">
            {services.map((s, i) => (
              <a key={i} href={s.href} className={`mob-sub-item ${s.accent ? 'accent' : ''}`}>
                <div className="mob-sub-icon">{s.icon}</div>
                <div>
                  <div style={{fontWeight:500, color:'var(--cream-50)'}}>{s.label}</div>
                  <div style={{fontSize:12, color:'var(--ink-300)', marginTop:2}}>{s.desc}</div>
                </div>
                <Icon.Arrow size={14}/>
              </a>
            ))}
          </div>
        </div>

        <div className={`mob-sub-panel ${mobSubmenu === 'shop' ? 'open' : ''}`}>
          <button className="mob-back" onClick={() => setMobSubmenu(null)}>
            <Icon.Arrow size={14} style={{transform:'rotate(180deg)'}}/> Voltar
          </button>
          <h3 className="display-md" style={{margin:'24px 0 8px', color:'var(--cream-50)'}}>Pet Shop</h3>
          <p className="body-sm" style={{color:'var(--ink-300)', margin:'0 0 24px'}}>Curadoria veterinária. 800+ produtos.</p>
          <div className="mob-sub-list">
            {shop.map((s, i) => (
              <a key={i} href={s.href} className="mob-sub-item">
                <div className="mob-sub-icon">{s.icon}</div>
                <div>
                  <div style={{fontWeight:500, color:'var(--cream-50)'}}>{s.label}</div>
                  <div style={{fontSize:12, color:'var(--ink-300)', marginTop:2}}>{s.desc}</div>
                </div>
                <Icon.Arrow size={14}/>
              </a>
            ))}
          </div>
        </div>
      </div>

      <style>{`
        .desk-only { display: none; }
        @media (min-width: 768px) {
          .desk-only { display: inline-flex; }
        }
        @media (max-width: 600px) {
          .em-meta { display: none !important; }
        }
        .site-header { transition: box-shadow 0.3s var(--ease); }
        .site-header.scrolled { box-shadow: 0 2px 12px rgba(15, 58, 53, 0.05); }
        .nav-item { position: relative; }
        .nav-link {
          display: inline-flex;
          align-items: center;
          gap: 4px;
        }

        /* DESKTOP MEGAMENU */
        .megamenu {
          position: absolute;
          top: 100%;
          left: 0;
          right: 0;
          background: var(--cream-50);
          border-bottom: 1px solid var(--ink-200);
          box-shadow: var(--shadow-lg);
          opacity: 0;
          visibility: hidden;
          transform: translateY(-8px);
          transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
          display: none;
        }
        @media (min-width: 1024px) {
          .megamenu { display: block; }
        }
        .megamenu.open {
          opacity: 1;
          visibility: visible;
          transform: translateY(0);
        }
        .megamenu-inner {
          max-width: var(--max-w);
          margin: 0 auto;
          padding: 40px;
        }
        .mega-grid {
          display: grid;
          grid-template-columns: 1fr 2fr;
          gap: 48px;
        }
        .mega-side {
          padding-right: 48px;
          border-right: 1px solid var(--ink-200);
        }
        .mega-items {
          display: grid;
          grid-template-columns: 1fr 1fr;
          gap: 8px;
        }
        .mega-item {
          display: flex;
          gap: 14px;
          align-items: center;
          padding: 14px 16px;
          border-radius: var(--r-md);
          transition: background 0.2s, transform 0.2s;
        }
        .mega-item:hover {
          background: var(--cream-100);
          transform: translateX(2px);
        }
        .mega-item.accent .mega-item-icon {
          background: var(--coral-100);
          color: var(--coral-700);
        }
        .mega-item-icon {
          width: 40px; height: 40px;
          background: var(--teal-50);
          color: var(--teal-700);
          border-radius: 10px;
          display: grid; place-items: center;
          flex-shrink: 0;
        }
        .mega-item-label {
          font-weight: 500;
          font-size: 14px;
          color: var(--ink-900);
        }
        .mega-item-desc {
          font-size: 12px;
          color: var(--ink-500);
          margin-top: 2px;
        }

        /* MOBILE MENU — nested panels */
        .mobile-menu {
          overflow: hidden;
        }
        .mob-panel {
          flex: 1;
          display: flex;
          flex-direction: column;
          transition: transform 0.3s var(--ease);
        }
        .mob-panel.shifted {
          transform: translateX(-30%);
          opacity: 0.4;
          pointer-events: none;
        }
        .mob-list {
          display: flex;
          flex-direction: column;
        }
        .mobile-nav-btn {
          background: none;
          border: none;
          width: 100%;
          font: inherit;
          text-align: left;
          cursor: pointer;
        }
        .mob-sub-panel {
          position: absolute;
          top: 0; right: 0; bottom: 0;
          width: 100%;
          background: var(--ink-900);
          padding: 24px;
          transform: translateX(100%);
          transition: transform 0.32s var(--ease);
          overflow-y: auto;
          padding-top: 24px;
        }
        .mob-sub-panel.open {
          transform: translateX(0);
        }
        .mob-back {
          display: inline-flex;
          align-items: center;
          gap: 8px;
          color: var(--cream-50);
          background: rgba(245,237,220,0.08);
          padding: 8px 14px;
          border-radius: var(--r-full);
          font-size: 13px;
          font-weight: 500;
          border: 1px solid rgba(245,237,220,0.12);
        }
        .mob-sub-list {
          display: flex;
          flex-direction: column;
          gap: 4px;
        }
        .mob-sub-item {
          display: flex;
          gap: 14px;
          align-items: center;
          padding: 16px 12px;
          border-radius: var(--r-md);
          transition: background 0.2s;
          border-bottom: 1px solid rgba(245,237,220,0.06);
        }
        .mob-sub-item:hover { background: rgba(245,237,220,0.05); }
        .mob-sub-item.accent .mob-sub-icon {
          background: rgba(220, 96, 66, 0.2);
          color: var(--coral-500);
        }
        .mob-sub-icon {
          width: 40px; height: 40px;
          background: rgba(43, 143, 128, 0.15);
          color: var(--teal-500);
          border-radius: 10px;
          display: grid; place-items: center;
          flex-shrink: 0;
        }
        .mob-sub-item > div:nth-child(2) { flex: 1; }
        .mob-sub-item > svg { color: var(--ink-400); }

        /* USER CHIP */
        .user-chip {
          display: inline-flex;
          align-items: center;
          gap: 10px;
          padding: 6px 14px 6px 6px;
          background: white;
          border: 1.5px solid var(--line);
          border-radius: var(--r-full);
          color: var(--ink);
          cursor: pointer;
          transition: border-color 0.2s, background 0.2s;
          font-family: var(--font-body);
        }
        .user-chip:hover { border-color: var(--teal-500); background: var(--paper); }
        .user-avatar {
          width: 32px; height: 32px;
          border-radius: 50%;
          background: linear-gradient(135deg, var(--teal-500), var(--caramel-500));
          color: white;
          font-family: var(--font-display);
          font-weight: 700;
          font-size: 12px;
          display: grid; place-items: center;
          flex-shrink: 0;
        }
        .user-info { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
        .user-name { font-weight: 600; font-size: 13px; color: var(--ink); }
        .user-role { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
        .user-dropdown {
          position: absolute;
          top: calc(100% + 8px);
          right: 0;
          width: 260px;
          background: white;
          border: 1px solid var(--line);
          border-radius: var(--r-lg);
          box-shadow: var(--shadow-lg);
          z-index: 50;
          overflow: hidden;
          animation: ddFade 0.18s var(--ease);
        }
        @keyframes ddFade {
          from { opacity: 0; transform: translateY(-4px); }
          to { opacity: 1; transform: translateY(0); }
        }
        .user-dd-header {
          display: flex; gap: 12px; align-items: center;
          padding: 16px;
          border-bottom: 1px solid var(--line);
          background: var(--paper);
        }
        .user-dd-list { padding: 8px; }
        .user-dd-item {
          display: block;
          padding: 10px 12px;
          color: var(--ink-soft);
          font-size: 14px;
          font-weight: 500;
          border-radius: var(--r-md);
          text-decoration: none;
          font-family: var(--font-body);
        }
        .user-dd-item:hover { background: var(--paper); color: var(--ink); }
      `}</style>
    </>
  );
}

// ============================================
// FOOTER
// ============================================
function Footer() {
  return (
    <footer className="site-footer">
      <div className="container">
        <div className="footer-grid">
          <div>
            <a href={B("index.html")} className="brand" style={{color: 'var(--cream-50)'}}>
              <span className="brand-mark" style={{background:'var(--cream-50)', color:'var(--ink-900)'}}>cv</span>
              <span>
                Clinical Vet
                <small style={{color:'var(--ink-300)'}}>desde 2008 · são paulo</small>
              </span>
            </a>
            <p className="body-sm" style={{color:'var(--ink-300)', maxWidth: 360, marginTop: 24}}>
              Cuidamos de pets e tutores há mais de 15 anos com a precisão de uma clínica
              referência e o carinho de uma família que ama animais.
            </p>

            <div style={{display:'flex', gap:12, marginTop: 24}}>
              <a href="#" className="footer-link" style={{padding:8, border:'1px solid rgba(245,237,220,0.15)', borderRadius:'50%', display:'grid', placeItems:'center', width:36, height:36}} aria-label="Instagram">
                <Icon.Instagram size={14} />
              </a>
              <a href="#" className="footer-link" style={{padding:8, border:'1px solid rgba(245,237,220,0.15)', borderRadius:'50%', display:'grid', placeItems:'center', width:36, height:36}} aria-label="Facebook">
                <Icon.Facebook size={14} />
              </a>
              <a href="#" className="footer-link" style={{padding:8, border:'1px solid rgba(245,237,220,0.15)', borderRadius:'50%', display:'grid', placeItems:'center', width:36, height:36}} aria-label="WhatsApp">
                <Icon.Whatsapp size={14} />
              </a>
            </div>
          </div>

          <div>
            <h4>Navegar</h4>
            <a href={B("index.html")} className="footer-link">Home</a>
            <a href={B("sobre.html")} className="footer-link">Sobre nós</a>
            <a href={B("servicos.html")} className="footer-link">Serviços</a>
            <a href={B("petshop.html")} className="footer-link">Pet Shop</a>
            <a href={B("daycare.html")} className="footer-link">Day Care</a>
            <a href={B("contato.html")} className="footer-link">Contato</a>
          </div>

          <div>
            <h4>Serviços</h4>
            <a href={B("servicos/consulta.html")} className="footer-link">Consultas</a>
            <a href={B("servicos/cirurgia.html")} className="footer-link">Cirurgia</a>
            <a href={B("servicos/castracao.html")} className="footer-link">Castração</a>
            <a href={B("servicos/exames.html")} className="footer-link">Exames</a>
            <a href={B("servicos/vacinacao.html")} className="footer-link">Vacinas</a>
            <a href={B("servicos/emergencia.html")} className="footer-link">Emergência 24h</a>
            <a href={B("banho-tosa.html")} className="footer-link">Banho & tosa</a>
          </div>

          <div>
            <h4>Contato</h4>
            <p className="body-sm" style={{color:'var(--cream-200)', margin:0}}>
              Av. Paulista, 1900<br/>
              Bela Vista — São Paulo, SP<br/>
              CEP 01310-200
            </p>
            <p className="body-sm" style={{color:'var(--cream-200)', margin:'16px 0 0'}}>
              <a href="tel:1199990000" className="footer-link" style={{padding:0, display:'inline'}}>(11) 9999-0000</a><br/>
              <a href="mailto:contato@clinicalvet.com.br" className="footer-link" style={{padding:0, display:'inline'}}>contato@clinicalvet.com.br</a>
            </p>

            <h4 style={{marginTop:32}}>Newsletter</h4>
            <form className="footer-newsletter" onSubmit={e => {e.preventDefault(); e.target.reset(); alert('Inscrito! Vamos enviar dicas de cuidado mensalmente.');}}>
              <input type="email" required placeholder="seu@email.com" />
              <button className="btn btn-primary btn-sm" type="submit"><Icon.Arrow size={14} /></button>
            </form>
          </div>
        </div>

        <div className="footer-bottom">
          <div>© 2026 Clinical Vet · CRMV-SP 12345 · Todos os direitos reservados</div>
          <div style={{display:'flex', gap:24}}>
            <a href={B("politica-privacidade.html")} className="footer-link" style={{padding:0}}>Privacidade</a>
            <a href={B("cookies.html")} className="footer-link" style={{padding:0}}>Cookies</a>
            <a href={B("termos-de-uso.html")} className="footer-link" style={{padding:0}}>Termos</a>
            <a href={B("marca.html")} className="footer-link" style={{padding:0}}>Marca</a>
          </div>
        </div>
      </div>
    </footer>
  );
}

// ============================================
// SHARED CTA STRIP — used in many pages
// ============================================
function CTAStrip() {
  return (
    <section className="section-tight" style={{background: 'var(--ink-900)', color: 'var(--cream-50)'}}>
      <div className="container">
        <div style={{display:'grid', gap:32, alignItems:'center', gridTemplateColumns:'1fr'}} className="cta-grid">
          <div>
            <span className="eyebrow" style={{color: 'var(--coral-500)'}}>● Plantão 24 horas</span>
            <h2 className="display-md" style={{margin:'12px 0 0', color:'var(--cream-50)'}}>
              Vidas não esperam.<br/>
              <span className="italic" style={{color:'var(--coral-500)'}}>Nós também não.</span>
            </h2>
            <p className="body" style={{color:'var(--ink-300)', marginTop:16, maxWidth:520}}>
              Centro cirúrgico, UTI veterinária e equipe de plantão prontos para emergências
              a qualquer hora do dia ou da noite. Sem agendamento, basta chegar.
            </p>
          </div>
          <div style={{display:'flex', flexDirection:'column', gap:12}}>
            <a href="tel:1199990000" className="btn btn-coral btn-lg" style={{justifyContent:'space-between', width:'100%'}}>
              <span style={{display:'inline-flex', alignItems:'center', gap:10}}>
                <Icon.Phone size={16}/> Ligar agora
              </span>
              <span style={{fontFamily:'var(--font-mono)', fontSize:13, opacity:0.9}}>(11) 9999-0000</span>
            </a>
            <a href="https://wa.me/5511999900000" className="btn btn-ghost btn-lg" style={{justifyContent:'space-between', width:'100%', color:'var(--cream-50)', borderColor:'rgba(245,237,220,0.2)'}}>
              <span style={{display:'inline-flex', alignItems:'center', gap:10}}>
                <Icon.Whatsapp size={16}/> WhatsApp 24h
              </span>
              <Icon.Arrow size={14}/>
            </a>
          </div>
        </div>

        <style>{`
          @media (min-width: 900px) {
            .cta-grid { grid-template-columns: 1.4fr 1fr !important; gap: 64px !important; }
          }
        `}</style>
      </div>
    </section>
  );
}

// ============================================
// IMAGE PLACEHOLDER component
// ============================================
function ImgPh({ label, ratio = '4/3', variant = '', style = {}, className = '' }) {
  return (
    <div
      className={`img-ph ${variant === 'dark' ? 'img-ph-dark' : variant === 'teal' ? 'img-ph-teal' : ''} ${className}`}
      style={{aspectRatio: ratio, ...style}}
    >
      [ {label} ]
    </div>
  );
}

// Photo with stripe placeholder bg + emoji-free label
function Photo({ label, ratio = '4/3', tone = 'cream', style = {}, className = '' }) {
  const bgs = {
    cream: 'linear-gradient(135deg, #EAE0CA, #F5EDDC)',
    teal: 'linear-gradient(135deg, #1E6E63, #2A8F80)',
    ink: 'linear-gradient(135deg, #1A2421, #3F4A47)',
    coral: 'linear-gradient(135deg, #DC6042, #E8775B)',
    blue: 'linear-gradient(135deg, #4B6E8B, #6E94B0)',
    sage: 'linear-gradient(135deg, #8FA787, #B5C6AD)',
  };
  const colors = {
    cream: 'var(--ink-700)',
    teal: 'var(--cream-100)',
    ink: 'var(--cream-100)',
    coral: 'var(--white)',
    blue: 'var(--white)',
    sage: 'var(--white)',
  };
  return (
    <div
      className={className}
      style={{
        aspectRatio: ratio,
        background: bgs[tone] || bgs.cream,
        borderRadius: 'var(--r-md)',
        position: 'relative',
        overflow: 'hidden',
        ...style,
      }}
    >
      <div style={{
        position:'absolute',
        inset: 0,
        background: 'repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 24px, transparent 24px 48px)',
      }}/>
      <div style={{
        position:'absolute',
        bottom: 16, left: 16,
        fontFamily:'var(--font-mono)',
        fontSize: 10,
        letterSpacing: '0.12em',
        textTransform:'uppercase',
        color: colors[tone] || colors.cream,
        opacity: 0.85,
      }}>
        [ {label} ]
      </div>
    </div>
  );
}

// Export
Object.assign(window, { Icon, Header, Footer, CTAStrip, ImgPh, Photo });
