// Inline SVG icons
const Icon = ({ name, size = 18, ...rest }) => {
  const s = size;
  const stroke = { width: 1.8, linecap: "round", linejoin: "round", fill: "none", stroke: "currentColor" };
  const paths = {
    plane: <path d="M2.5 12L21 5l-4 8 4 8-18.5-7L9 12 2.5 12z" {...stroke}/>,
    pin: <><path d="M12 21s-7-7.5-7-12a7 7 0 1114 0c0 4.5-7 12-7 12z" {...stroke}/><circle cx="12" cy="9" r="2.5" {...stroke}/></>,
    calendar: <><rect x="3" y="5" width="18" height="16" rx="2" {...stroke}/><path d="M8 3v4M16 3v4M3 10h18" {...stroke}/></>,
    clock: <><circle cx="12" cy="12" r="9" {...stroke}/><path d="M12 7v5l3 2" {...stroke}/></>,
    user: <><circle cx="12" cy="8" r="4" {...stroke}/><path d="M4 21a8 8 0 0116 0" {...stroke}/></>,
    users: <><circle cx="9" cy="8" r="3.5" {...stroke}/><path d="M2.5 20a6.5 6.5 0 0113 0M16 11a3.5 3.5 0 100-7M21.5 20a5.5 5.5 0 00-4-5.3" {...stroke}/></>,
    child: <><circle cx="12" cy="6" r="2.5" {...stroke}/><path d="M9 12l3-3 3 3v5l-2 4M11 21h-2M13 21h2" {...stroke}/></>,
    luggage: <><rect x="6" y="7" width="12" height="13" rx="2" {...stroke}/><path d="M9 7V4h6v3M10 11v6M14 11v6" {...stroke}/></>,
    car: <><path d="M3 13l2-5a2 2 0 012-1.5h10a2 2 0 012 1.5l2 5M3 13v5a1 1 0 001 1h2a1 1 0 001-1v-2h10v2a1 1 0 001 1h2a1 1 0 001-1v-5M3 13h18" {...stroke}/><circle cx="7" cy="16" r="1.2" fill="currentColor"/><circle cx="17" cy="16" r="1.2" fill="currentColor"/></>,
    arrowRight: <path d="M5 12h14M13 5l7 7-7 7" {...stroke}/>,
    check: <path d="M5 12l5 5L20 7" {...stroke}/>,
    star: <path d="M12 2.5l3 6.5 7 1-5 5 1 7-6-3-6 3 1-7-5-5 7-1z" fill="currentColor"/>,
    phone: <path d="M5 4l4 1 1.5 4-2 1.5a12 12 0 005 5l1.5-2 4 1.5 1 4a18 18 0 01-15-15z" {...stroke}/>,
    mail: <><rect x="3" y="5" width="18" height="14" rx="2" {...stroke}/><path d="M3 7l9 6 9-6" {...stroke}/></>,
    shield: <><path d="M12 3l8 3v6c0 5-4 8-8 9-4-1-8-4-8-9V6l8-3z" {...stroke}/><path d="M9 12l2 2 4-4" {...stroke}/></>,
    sparkle: <><path d="M12 3v6M12 15v6M3 12h6M15 12h6M5.5 5.5l4 4M14.5 14.5l4 4M5.5 18.5l4-4M14.5 9.5l4-4" {...stroke}/></>,
    leaf: <><path d="M5 19c0-9 7-15 16-14-1 9-6 14-14 14H5z" {...stroke}/><path d="M5 19l9-9" {...stroke}/></>,
    chevronDown: <path d="M6 9l6 6 6-6" {...stroke}/>,
    minus: <path d="M5 12h14" {...stroke}/>,
    plus: <path d="M12 5v14M5 12h14" {...stroke}/>,
    search: <><circle cx="11" cy="11" r="7" {...stroke}/><path d="M20 20l-4-4" {...stroke}/></>,
    headset: <path d="M3 14v-2a9 9 0 0118 0v2M3 14a2 2 0 002 2h1v-6H5a2 2 0 00-2 2v2zM21 14a2 2 0 01-2 2h-1v-6h1a2 2 0 012 2v2zM18 16v1a3 3 0 01-3 3h-2" {...stroke}/>,
    creditCard: <><rect x="2" y="6" width="20" height="13" rx="2" {...stroke}/><path d="M2 11h20M6 16h3" {...stroke}/></>,
    lock: <><rect x="5" y="11" width="14" height="10" rx="2" {...stroke}/><path d="M8 11V7a4 4 0 018 0v4" {...stroke}/></>,
    sign: <><rect x="3" y="6" width="18" height="9" rx="1.5" {...stroke}/><path d="M12 15v6M9 21h6" {...stroke}/></>,
    seat: <path d="M6 21V11a3 3 0 013-3h6a3 3 0 013 3v3M6 21h12M4 21h2M18 21h2M9 14h6" {...stroke}/>,
    wifi: <path d="M2 9a16 16 0 0120 0M5 13a10 10 0 0114 0M8.5 16.5a5 5 0 017 0M12 20h.01" {...stroke}/>,
    snow: <path d="M12 2v20M2 12h20M5 5l14 14M19 5L5 19M9 4l3 2 3-2M9 20l3-2 3 2M4 9l2 3-2 3M20 9l-2 3 2 3" {...stroke}/>,
    whatsapp: <path d="M12 2a10 10 0 00-8.5 15.2L2 22l4.9-1.4A10 10 0 1012 2zM8.5 7.5c.3 0 .6 0 .8.5l1 2.2c.1.3 0 .6-.2.8l-.6.6c-.3.3-.4.6-.2.9.7 1.4 1.7 2.4 3.1 3.1.3.2.6.1.9-.2l.6-.6c.2-.2.5-.3.8-.2l2.2 1c.5.2.5.5.5.8 0 1.4-1.1 2.5-2.5 2.5-3.6 0-8-4.4-8-8 0-1.4 1.1-2.5 2.5-2.5z" fill="currentColor"/>,
    eur: <path d="M16 7a6 6 0 100 10M4 10h10M4 14h10" {...stroke}/>,
    facebook: <path d="M14 21v-7h2.5l.5-3H14V9c0-1 .5-1.5 1.5-1.5H17V5h-2c-2 0-3 1-3 3v3H10v3h2v7h2z" fill="currentColor"/>,
    instagram: <><rect x="3" y="3" width="18" height="18" rx="5" {...stroke}/><circle cx="12" cy="12" r="4" {...stroke}/><circle cx="17.5" cy="6.5" r="0.5" fill="currentColor"/></>,
    twitter: <path d="M22 5.5c-.7.3-1.5.6-2.3.7a4 4 0 001.8-2.2c-.8.5-1.7.8-2.6 1A4 4 0 0012 9c0 .3 0 .6.1.9C8.7 9.7 5.7 8.1 3.7 5.6a4 4 0 001.2 5.4c-.6 0-1.3-.2-1.8-.5a4 4 0 003.2 4 4 4 0 01-1.8.1 4 4 0 003.7 2.8A8 8 0 012 19a11 11 0 006 1.7c7.2 0 11.1-6 11.1-11.1V9a8 8 0 002-2z" fill="currentColor"/>,
    arrowLeft: <path d="M19 12H5M12 19l-7-7 7-7" {...stroke}/>,
    info: <><circle cx="12" cy="12" r="9" {...stroke}/><path d="M12 8v.01M11 12h1v5h1" {...stroke}/></>,
    tag: <><path d="M3 12V4a1 1 0 011-1h8l9 9-9 9-9-9z" {...stroke}/><circle cx="7.5" cy="7.5" r="1.2" fill="currentColor"/></>,
    map: <><path d="M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2V6z" {...stroke}/><path d="M9 4v16M15 6v16" {...stroke}/></>,
    bolt: <path d="M13 2L4 14h6l-1 8 9-12h-6l1-8z" {...stroke}/>,
    bag: <><rect x="4" y="7" width="16" height="14" rx="2" {...stroke}/><path d="M9 7V5a3 3 0 016 0v2" {...stroke}/></>,
  };
  return (
    <svg width={s} height={s} viewBox="0 0 24 24" {...rest}>
      {paths[name] || null}
    </svg>
  );
};

// Flag SVGs
const Flag = ({ code }) => {
  const flags = {
    tr: <svg viewBox="0 0 30 20" width="18" height="12"><rect width="30" height="20" fill="#E30A17"/><circle cx="11" cy="10" r="4.5" fill="#fff"/><circle cx="12.5" cy="10" r="3.6" fill="#E30A17"/><polygon points="16,8 17.5,9.5 19,8.5 18.2,10 19.5,11 17.5,11 17,12.5 16,11 14,11 15.5,10 14.5,8.5 16,9" fill="#fff" transform="translate(0.5,0)"/></svg>,
    en: <svg viewBox="0 0 30 20" width="18" height="12"><rect width="30" height="20" fill="#012169"/><path d="M0,0 L30,20 M30,0 L0,20" stroke="#fff" strokeWidth="3"/><path d="M0,0 L30,20 M30,0 L0,20" stroke="#C8102E" strokeWidth="1.5"/><path d="M15,0 V20 M0,10 H30" stroke="#fff" strokeWidth="5"/><path d="M15,0 V20 M0,10 H30" stroke="#C8102E" strokeWidth="3"/></svg>,
    de: <svg viewBox="0 0 30 20" width="18" height="12"><rect width="30" height="6.66" fill="#000"/><rect y="6.66" width="30" height="6.66" fill="#DD0000"/><rect y="13.33" width="30" height="6.66" fill="#FFCE00"/></svg>,
    ru: <svg viewBox="0 0 30 20" width="18" height="12"><rect width="30" height="6.66" fill="#fff"/><rect y="6.66" width="30" height="6.66" fill="#0039A6"/><rect y="13.33" width="30" height="6.66" fill="#D52B1E"/></svg>,
  };
  return flags[code] || null;
};

window.Icon = Icon;
window.Flag = Flag;
