export const MARKETPLACES = {
  DE: {
    id: 'de',
    name: 'Germany',
    domain: 'kaufland.de',
    flag: '🇩🇪',
    countryCode: 'DE'
  },
  CZ: {
    id: 'cz',
    name: 'Czech Republic',
    domain: 'kaufland.cz',
    flag: '🇨🇿',
    countryCode: 'CZ'
  },
  SK: {
    id: 'sk',
    name: 'Slovakia',
    domain: 'kaufland.sk',
    flag: '🇸🇰',
    countryCode: 'SK'
  },
  RO: {
    id: 'ro',
    name: 'Romania',
    domain: 'kaufland.ro',
    flag: '🇷🇴',
    countryCode: 'RO'
  },
  HR: {
    id: 'hr',
    name: 'Croatia',
    domain: 'kaufland.hr',
    flag: '🇭🇷',
    countryCode: 'HR'
  },
  PL: {
    id: 'pl',
    name: 'Poland',
    domain: 'kaufland.pl',
    flag: '🇵🇱',
    countryCode: 'PL'
  }
};

export const getDefaultMarketplace = (storeCountry) => {
  const marketplace = Object.entries(MARKETPLACES).find(
    ([_, market]) => market.countryCode === storeCountry
  );
  return marketplace ? marketplace[0] : 'DE'; // fallback to DE if no match
};